Answers for "pandas remove multi header from dataframe"

0

pandas remove multi header from dataframe

df = pd.read_table('yourfile.csv', header=None, delim_whitespace=True, skiprows=1)
df.columns = ['0','POSITION_T','PROB','ID']
del df['0']

# filtering out the rows with `POSITION_T` value in corresponding column
df = df[df.POSITION_T.str.contains('POSITION_T') == False]

print(df)
Posted by: Guest on July-05-2020

Code answers related to "pandas remove multi header from dataframe"

Python Answers by Framework

Browse Popular Code Answers by Language