Line 1: import pandas as pd
import numpy as np
from datetime import datetime
Line 2: df = pd.read_csv(‘files/ETH_1h.csv’)
Line 3: df[‘Date’] = pd.to_datetime(df[‘Date’], format=’%Y-%m-%d %I-%p’)
Line 4: df.set_index(‘Date’, inplace=True)
df
After line 4, I get what you see in image one.
Here is the problem:
Line 5: df[‘2020-01-01’][‘High’].max()
This gives me the error, attached as an image.
I get that the problem is the key. What it doesn’t say is what is wrong with it. Is it unreadable, or a string or an unreadable format or something. I tried to improvise with what little I know and with the help of Chat GPT but no help.
thanks in advance for your time.
What I want on the screen is that it returns the max value among all the rows from the January month from the column named “High”, after I have entered a command to return only the January month data using this: df[‘2020-01-01’][‘High’].max()