NREL / flasc

A rich floris-driven suite for SCADA analysis
https://nrel.github.io/flasc/
BSD 3-Clause "New" or "Revised" License
32 stars 18 forks source link

Add observed keyword #223

Closed paulf81 closed 1 month ago

paulf81 commented 1 month ago

This change adds the observed to a pandas groupby operation in filtering.py. Since 'ws_xxx' is not a categorical this setting does nothing, but silences the present warning:

FutureWarning: The default of observed=False is deprecated and will be changed to True in a future version of pandas. Pass observed=False to retain current behavior or observed=True to adopt the future default and silence this warning.
  df_pow_and_ws_bins_subset.groupby(by=f"ws_{ti:03d}")[f"pow_{ti:03d}"].median()

Thinking it over, even though observed only applies to categorical values, still setting to True seemed more appropriate