I'm using pandas to get data from an URL and add it to a dataframe. It works but the df does have some NaNs in it which is causing me some problems. When I try to replace the NaNs with fillna(0) I get this error:
AttributeError: 'list' object has no attribute 'fillna'
Here is the code:
import pandas as pd
url = 'https://elderscrolls.fandom.com/wiki/Factions_(Skyrim)'
df = pd.read_html(url)
df = df.fillna(0)
skyrim_data = (df[0].to_dict(orient='records'))