I am new in python. My problem is simple but I am struggling to solve this.
I am working with a simple dataframe. It has 2 columns Q and t. I attached a screeshot of my dataframe herewith.
I want to set the Q and t as column names and remove the top header (0,1). Another thing is why the df.columns is showing rangeindex, how can I change that so it shoes the names of the columns.
I tried the following code
header = df.iloc[0]
print(header)
df = df[1:]
df.columns = header
df
I got the the first values of Q and t as header names instead of Q and t. df
I just want to remove the indexing for column names and set Q and t as column names.