how to add a column name in pandas

  pandas, python

I am using pandas, and when I do print(df), the result says as follows:

                        open      high       low     close        volume
2021-01-26 09:00:00  0.000230  0.000236  0.000228  0.000228    303.813500
2021-01-27 09:00:00  0.000226  0.000230  0.000223  0.000230   1479.338775
[2 rows x 5 columns]

The problem is that the very first date column has no name and seems not to be regarded as an actual column (it says it has only 5 columns). How can I put a name on the first column?

Source: Python Questions

LEAVE A COMMENT