pandas remove multi header from dataframe

Solutions on MaxInterview for pandas remove multi header from dataframe by the best coders in the world

showing results for - "pandas remove multi header from dataframe"
Anthony
01 Nov 2018
1df = pd.read_table('yourfile.csv', header=None, delim_whitespace=True, skiprows=1)
2df.columns = ['0','POSITION_T','PROB','ID']
3del df['0']
4
5# filtering out the rows with `POSITION_T` value in corresponding column
6df = df[df.POSITION_T.str.contains('POSITION_T') == False]
7
8print(df)