ulmo-dev / ulmo

clean, simple and fast access to public hydrology and climatology data.
http://ulmo.readthedocs.org
Other
169 stars 63 forks source link

pandas 1.1 is causing a problem with ncdc.ghcn_daily.get_data data parsing #195

Closed emiliom closed 3 years ago

emiliom commented 3 years ago

Data are not parsed correctly, and values are returned as NaN. I haven't narrowed it down yet, but I've confirmed that it works in ulmo 0.8.6 when pinning pandas to <1.1.

https://github.com/ulmo-dev/ulmo/blob/master/ulmo/ncdc/ghcn_daily/core.py#L28

joejoezz commented 3 years ago

The problem seems to be with incompatible indexing in line 113, specifically the PeriodIndex of element_df is incompatible with the index of dataframe: dataframe[column_name][dates] = element_df[col][months]

There is probably a better way to do this but changing to element_df[col][months].values will fix the issue since both objects have the same length.

emiliom commented 3 years ago

Closed by #201 and #198