jchristo12 / fantasy_football

Files related to fantasy football analysis
0 stars 0 forks source link

wdir and humd NaN replacement not working #3

Closed jchristo12 closed 5 years ago

jchristo12 commented 5 years ago

Attempting to replace the wdir and humd features of indoor conditions rows with imputed data. The data will not update and am getting a SetttingWithCopyWarning warning.

Code in question: game.query('gen_cond == "indoor_cond"').fillna({'wdir': 'CALM', 'humd': 45}, inplace=True)

jchristo12 commented 5 years ago

Fixed via the code below. Just needed a normal assignment rather than using the fillna() method.

game.loc[game['gen_cond']=='indoor_cond', ['wdir', 'humd']] = ['CALM', 45]