You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importpandasaspdimportnumpyasnptemp=pd.Series(np.random.randn(10))
temp[3:6] =np.nantemp[8] =np.nannan_index=np.isnan(temp)
# this workstemp1=temp.copy()
temp1[nan_index] = [99, 99, 99, 99]
temp1[nan_index]
399499599899dtype: float64# this doesn't - values look like they're being assigned in a different order?temp2=temp.copy()
temp2[nan_index] = [99, 99, 99, np.nan]
3NaN499599899dtype: float64# ... but it works properly when using .loctemp2=temp.copy()
temp2.loc[nan_index] = [99, 99, 99, np.nan]
3994995998NaNdtype: float64
See repro below:
output of show_versions():
The text was updated successfully, but these errors were encountered: