For a current project, I am among others converting data of a Pandas DataFrame.
When calling the line df['date'] = pd.to_datetime(df['date']), I am receiving the error TypeError: 'method' object is not subscriptable.
I have in this context already checked for some approached relating e.g. to missing parentheses but could not find a matching solution yet. Is there any smart tweak to make this run?
The code section is shown below:
import string
import json
import pandas as pd
# Loading and normalising the input file
file = open("sp500.json", "r")
data = json.load(file)
df = pd.json_normalize(data)
df = pd.DataFrame().fillna
# Datetime conversion
df['date'] = pd.to_datetime(df['date'])
pd.DataFrame.fillna()()are missing in thefillna()function.TypeError: fillna() missing 1 required positional argument: 'self'