flasc.flasc_dataframe#
FLASC DataFrame module.
Classes
Subclass of pandas.DataFrame for working with FLASC data. |
- class flasc.flasc_dataframe.FlascDataFrame(*args, channel_name_map=None, long_data_columns=None, **kwargs)[source]#
Subclass of pandas.DataFrame for working with FLASC data.
Stores data in preferred Flasc format, or user format, with option to convert between the two.
Want handling to go between long and wide.
- _metadata: list[str] = ['channel_name_map', '_user_format', '_long_data_columns']#
- property in_flasc_format#
Return True if the data is in FLASC format, False otherwise.
- property _constructor#
Used when a manipulation result has the same dimensions as the original.
- property n_turbines#
Return the number of turbines in the dataset.
- copy_metadata(other)[source]#
Copy metadata from another FlascDataFrame to self.
- Parameters:
other (FlascDataFrame) -- DataFrame to copy metadata from.
- convert_to_user_format(inplace=False)[source]#
Convert the DataFrame to the format that the user expects, given the channel_name_map.
- Parameters:
inplace (bool) -- If True, modify the DataFrame in place. If False, return a new DataFrame.
- Returns:
FlascDataFrame in user format if inplace is False, None otherwise.
- Return type:
- convert_time_to_datetime(inplace=False)[source]#
Convert the time column to a datetime representation.
- Parameters:
inplace (bool) -- If True, modify the DataFrame in place. If False, return a new DataFrame.
- Returns:
FlascDataFrame with time column as datetime object if inplace is False, None otherwise
- Return type:
- convert_to_flasc_format(inplace=False)[source]#
Convert the DataFrame to the format that FLASC expects.
- Parameters:
inplace (bool) -- If True, modify the DataFrame in place. If False, return a new DataFrame.
- Returns:
FlascDataFrame in FLASC format if inplace is False, None otherwise
- Return type:
# TODO: could consider converting "time" to datetime type here. If so, will want to keep # the original "time" column for back-conversion if needed. # Similarly, we could sort on time, but perhaps both are too meddlesome
- _convert_long_to_wide(df_)[source]#
Convert a long format DataFrame to a wide format DataFrame.
- Parameters:
df (FlascDataFrame) -- Long format FlascDataFrame
- Returns:
Wide format FlascDataFrame
- Return type:
- _convert_wide_to_long(df_)[source]#
Convert a wide format DataFrame to a long format DataFrame.
- Parameters:
df (FlascDataFrame) -- Wide format FlascDataFrame
- Returns:
Long format FlascDataFrame
- Return type:
- to_feather(path, **kwargs)[source]#
Raise warning about lost information and save to feather format.
- export_to_windup_format(turbine_names: list[str] | None = None, time_col: str = 'time', power_col: str = 'pow', windspeed_col: str = 'ws', winddirection_col: str = 'wd', normal_operation_col: str | None = None, pitchangle_col: str | None = None, genrpm_col: str | None = None, downtimecounter_col: str | None = None, turbine_num_digits: int = 3)[source]#
Convert the DataFrame to the format that wind-up expects.
- Parameters:
turbine_names (list[str] | None)
time_col (str)
power_col (str)
windspeed_col (str)
winddirection_col (str)
normal_operation_col (str | None)
pitchangle_col (str | None)
genrpm_col (str | None)
downtimecounter_col (str | None)
turbine_num_digits (int)