Aug-15-2022, 05:54 PM
(This post was last modified: Aug-15-2022, 06:01 PM by Led_Zeppelin.)
In the following screenshot, I am trying to rename the first column (0th column) in the df2 dataframe to IndexData. The python code is shown to do this. I am assuming when the csv file is read it automatically sets index to be column 0. So, I have a defined index at column 0, by just reading the csv file.
However, it i not doing this as anyone can see from the df2.head() readout.
I am including a screenshot that shows my dilemma. The code as shown:
So, what am I doing wrong?
Any help appreciated. Thaks in advance.
Screenshot attached.
Respectfuly,
LZ
However, it i not doing this as anyone can see from the df2.head() readout.
I am including a screenshot that shows my dilemma. The code as shown:
df2.rename({'Unamed:0':'IndexData'}, inplace=True)does not through any errors. But it does not rename the 0 column in dataframe df2. So, what am I doing wrong?
Any help appreciated. Thaks in advance.
Screenshot attached.
Respectfuly,
LZ
