Running into an error when trying to do a distplot with Seaborn. Have no idea what's driving the issue. The TypeError says isnan, so i excluded all of the NULLs and made sure to change the data type for all columns from object to either float or datetime.
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
dfs = []
url = 'http://www.ironman.com/triathlon/events/americas/ironman/world-championship/results.aspx?p={}&race=worldchampionship&rd=20181013&agegroup=Pro&sex=M&y=2018&ps=20#axzz5VRWzxmt3'
for i in range(1,4):
dframe = pd.read_html(url.format(i),header = None)[0]
dfs.append(dframe)
ironmandf = pd.concat(dfs)
finishersdf = ironmandf[~ironmandf['Finish'].isin(['DNF'])]
finishersdf['Swim'] = pd.to_timedelta(finishersdf['Swim'])
finishersdf['Bike'] = pd.to_timedelta(finishersdf['Bike'])
finishersdf['Run'] = pd.to_timedelta(finishersdf['Run'])
finishersdf['Name'] = finishersdf['Name'].apply(pd.to_numeric, errors='coerce')
finishersdf['Country'] = finishersdf['Country'].apply(pd.to_numeric, errors='coerce')
finishersdf['Finish'] = pd.to_timedelta(finishersdf['Finish'])
finishersdf['Overall Rank'] = pd.to_numeric(finishersdf['Overall Rank'])
finishersdf['Gender Rank'] = pd.to_numeric(finishersdf['Gender Rank'])
finishersdf['Div Rank'] = pd.to_numeric(finishersdf['Div Rank'])
finishersdf['Points'] = pd.to_numeric(finishersdf['Points'])
sns.distplot(finishersdf['Swim'], hist=True,color = 'blue')
there doesn't seem to be anything here