I have imported an excel file in python and I am trying to make the 7th ROW the starting Columns. I need to hide the first 6 rowsHow can i do that?

Viewed 48

I have imported an excel file in python and I am trying to make the 7th ROW the starting Columns. I need to hide the first 6 rows. How can i do that?

import pandas as pd
df = pd.read_excel('C:/Users/sfreeman/Desktop/userexport.xls')
df

enter image description here

2 Answers
import pandas as pd
df = pd.read_excel('C:/Users/sfreeman/Desktop/userexport.xls', skiprows=6)
display(df)
import pandas as pd
df = pd.read_excel('C:/Users/sfreeman/Desktop/userexport.xls', skiprows=range(7))
df.head()

Then:

df.transpose()

to make columns the rows, and vice versa.

Related