aazuspan / sankee

Visualize classified time series data with interactive Sankey plots in Google Earth Engine
https://sankee.readthedocs.io/en/latest/index.html
MIT License
99 stars 15 forks source link

Explicit cast to int to avoid KeyErrors #22 #23

Closed aazuspan closed 2 years ago

aazuspan commented 2 years ago

Fix #22

If null values are sampled in one time step (e.g. nodata classes or masked areas), the resulting dataframe column will be cast to float before the nans can be dropped. When value_counts is run, you'll get a dataframe with a float index. Slicing that dataframe with an int index will throw a KeyError.

Explicitly casting to int after dropping nans avoids the float index problem and solves the issue.