For a current project, I am planning to clean a Pandas DataFrame off its Null values. For this purpose, I want to use pd.DataFrame().fillna(), which is apparently a solid soluton for data cleanups.
When running the below code, I am however receiving the following error ValueError: Must specify a fill 'value' or 'method'. I tried several options to rewrite the line df = pd.DataFrame().fillna(), none of which led to the desired outcome.
Is there any smart tweak to get this running?
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()