0

I have imported some stock prices and converted it to pandas dataframe. What I get is a dataframe with 2 headers (See screenshot attached). The 2nd header just has the work "Data". I want to remove the this 2nd header and then rename the header of the first column (which is blank) to "Date"

enter image description here

I tried the drop and droplevel function but it is not working.

enter image description here

  • It is index name. For remove it use `df.rename_axis(None)`, for convert index `Date` to column `Date` use `df.reset_index()` – jezrael Jan 03 '23 at 06:49

0 Answers0