super_auto_comb.track_changes

This sub-package works with Pandas Dataframes whose first column is ‘datetime’. They are interpreted as setup description (frequency, counter channels, etc..) from the given datetime to the datetime on the next row. These dataframes can me manipulated (loaded, merged, reduced, etc…) to keep track of only a subset of columns. For loading inputs, all changes are tracked (e.g., I need to know when a counter channel is changed). Outputs are instead customizable (e.g., I may or may not want to separate data based on which comb is used). A colum ‘name’ can be added to describe each row based on some columns. A column ‘datetime_end’ is always added to be equal to the datetime in the next row.

Functions

df_merge(df1, df2)

Merge two Dataframes tracking changes from both.

df_fix_end(df)

Update or create the datetime_end column of the Dataframe to be the datetime of the following line (or np.inf)

df_reduce(df, subset)

Return a new df with changes only tracked in the subset columns.

df_extract(df, cols)

Extract columns from a DataFrame OR Series ignoring columns that do not exists

df_add_name(df, fix[, var])

Add a name column to the Dataframe based on certain columns.

df_load(file)

Load a Dataframe from a file. The first column in the file should be a ISO datetime.

df_limit(df, start, stop)

mask the Dataframe from start to stop.

load_do_setup(do, dir)

Load DO and Comb setups. Use Pandas for some magic in keeping track of changes.

df_from_cirt(start, stop)

Return a Dataframe tracking changes in Circular T number.

format_possibly_changing_info(df, key)

Return a single string from values in a Dataframe column that may be one or more.

Module Contents

super_auto_comb.track_changes.df_merge(df1, df2)

Merge two Dataframes tracking changes from both.

super_auto_comb.track_changes.df_fix_end(df)

Update or create the datetime_end column of the Dataframe to be the datetime of the following line (or np.inf)

super_auto_comb.track_changes.df_reduce(df, subset)

Return a new df with changes only tracked in the subset columns.

super_auto_comb.track_changes.df_extract(df, cols)

Extract columns from a DataFrame OR Series ignoring columns that do not exists

super_auto_comb.track_changes.df_add_name(df, fix, var=[])

Add a name column to the Dataframe based on certain columns. Columns in fix will always be recorded in the name. Columns in var will be recorded only if some change is observed.

super_auto_comb.track_changes.df_load(file)

Load a Dataframe from a file. The first column in the file should be a ISO datetime.

super_auto_comb.track_changes.df_limit(df, start, stop)

mask the Dataframe from start to stop.

super_auto_comb.track_changes.load_do_setup(do, dir)

Load DO and Comb setups. Use Pandas for some magic in keeping track of changes.

Parameters:
  • do (str) – DO name

  • dir (str, optional) – working directory, by default ‘’

Returns:

Pandas dataframe with DO and Combs tracked changes.

Return type:

df

Note

Load DO setups, combining it with comb setups (e.g., so if a DO has been measured with both comb1 and comb2, data is populated automatically).

super_auto_comb.track_changes.df_from_cirt(start, stop)

Return a Dataframe tracking changes in Circular T number.

super_auto_comb.track_changes.format_possibly_changing_info(df, key)

Return a single string from values in a Dataframe column that may be one or more.