I want to calculate the median of the "MP" and "FG" column. But I came across the problem that I cant calculate it when some rows in the array/table has strings in it. Like in row 8,18,19,20,21,24. As you can see in the picture.
List of NBA Stats
I tried different ways to do it. But my latest idea was this:
resultfg1920 = morantSeason1920.loc[morantSeason1920['FG'] == float]
print (resultfg1920)
Output
Empty DataFrame
Columns: [Rk, G, Date, Age, Tm, Unnamed: 5, Opp, Unnamed: 7, GS, MP, FG, FGA, FG%, 3P, 3PA, 3P%, FT, FTA, FT%, ORB, DRB, TRB, AST, STL, BLK, TOV, PF, PTS, GmSc, +/-]
Index: []
This is what I get from it, like just the first row, so all column names.