Skip to content

Commit

Permalink
fix: preserve dataframe dtypes
Browse files Browse the repository at this point in the history
Fixes #38
  • Loading branch information
samuelwnaylor committed Nov 4, 2024
1 parent 980f6db commit b18e092
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wind_up/scada_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@


def filter_stuck_data(df: pd.DataFrame) -> pd.DataFrame:
diffdf = df.groupby("TurbineName", observed=False).ffill().fillna(0).diff()
original_data_types = df.dtypes.to_dict()
diffdf = df.groupby("TurbineName", observed=False).ffill().fillna(0).astype(original_data_types).diff()
stuck_data = (diffdf == 0).all(axis=1)
very_low_wind_threshold = 1.5
very_low_wind = df["WindSpeedMean"] < very_low_wind_threshold
Expand Down

0 comments on commit b18e092

Please sign in to comment.