I have a dataframe with header. How can I remove the header of the dataframe?
E.g.
From
>>> df aa bb cc0 1 4 71 2 5 82 3 6 9
To
>>> df 0 1 20 1 4 71 2 5 82 3 6 9
Here is one of the approaches to remove the header of a pandas dataframe:
>>> import pandas as pd>>> df=pd.DataFrame({'aa':[1,2,3],'bb':[4,5,6],'cc':[7,8,9]})>>> df aa bb cc0 1 4 71 2 5 82 3 6 9>>> df.valuesarray([[1, 4, 7], [2, 5, 8], [3, 6, 9]])>>> df1=pd.DataFrame.from_records(df.values)>>> df1 0 1 20 1 4 71 2 5 82 3 6 9