xxxxxxxxxx
df.rename(columns=df.iloc[0]).drop(df.index[0])
xxxxxxxxxx
# best practice is to use the `header=None` parameter
# this way, the initial header will turn into the first row in the dataframe
df = pd.read_csv(file, header=None)
xxxxxxxxxx
see the difference between these two lines
#no header
data= pd.read_csv(path, header = None, delim_whitespace=True, error_bad_lines=False)
#with headers
data= pd.read_csv(path, delim_whitespace=True, error_bad_lines=False)