0

Good time a day to everyone.

Today i just started to study pandas. Could you help me with parse dates in DataFrame, when data looks like this: enter image description here

When i try to choose a column I got an error. enter image description here

How can i solve this problem?

2
  • type chas.columns and look your column names Commented Apr 19, 2021 at 8:40
  • Index([ 0, 2020-02-01 00:00:00, 2020-02-02 00:00:00, 2020-02-03 00:00:00, 2020-02-04 00:00:00, 2020-02-05 00:00:00, 2020-02-06 00:00:00, 2020-02-07 00:00:00, 2020-02-08 00:00:00, 2020-02-09 00:00:00, 2020-02-10 00:00:00], dtype='object') Commented Apr 19, 2021 at 9:33

1 Answer 1

1

You can convert your column header type to string with

df.columns = df.columns.astype(str)

Then access one column with

df['2020-02-01 00:00:00']
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.