This pull request is taking over from #199 to add a new object called a FlascDataFrame inherits from pandas.DataFrame, but will provide some extra utilities for mapping between different naming conventions and dataframe formats ("long" data, "wide" data, etc). Still a work in progress but nearing readiness so opening draft pull request.
Feature or improvement description
Implements a new FlascDataFrame object that inherits from pandas.DataFrame but provides extra utility
Implements methods to convert to user formats such as long or wide with alternative channel names
Provides methods to convert to a wind-up (https://github.com/resgroup/wind-up) style frame and use import wind-up modules to conduct uplift analysis using those methods
Updated documentation and examples
Left to do:
[x] Have we brought in enough capabliities, thinking especially of deprecating some of the functions in dataframe_manipulations.py that could better be FlascDataframe members
[x] Go through code and look to update type hints and returns where appropriate from pd.Dataframe to and/or FlascDataframe
[x] ~Add test of df_reduce_precision with FlascDataFrame~ (updated df_reduce_precision for use with FlascDataFrame and it's used in the examples)
[x] Add test for FlascDataframe driving energy ratio with polars conversion
[x] Test time operations with FlascDataframe
[x] Add FlascDataframe to top-level init and chain through code
[x] Update examples to use FlascDataframe
[x] Add a documention page for FlascDataframe and wind-up
[ ] Review and merge
Additional notes
We took this opportunity to make some improvements to the documentation, although a full work through the documentation is still needed to fully address #116 .
This PR also introduces the Wind-Up tool---thanks @aclerc !
Add FlascDataFrame
This pull request is taking over from #199 to add a new object called a
FlascDataFrame
inherits frompandas.DataFrame
, but will provide some extra utilities for mapping between different naming conventions and dataframe formats ("long" data, "wide" data, etc). Still a work in progress but nearing readiness so opening draft pull request.Feature or improvement description
FlascDataFrame
object that inherits frompandas.DataFrame
but provides extra utilityuser
formats such as long or wide with alternative channel nameswind-up
(https://github.com/resgroup/wind-up) style frame and use importwind-up
modules to conduct uplift analysis using those methodsLeft to do:
FlascDataframe
memberspd.Dataframe
to and/orFlascDataframe
df_reduce_precision
for use withFlascDataFrame
and it's used in the examples)FlascDataframe
driving energy ratio with polars conversionFlascDataframe
FlascDataframe
to top-level init and chain through codeFlascDataframe
FlascDataframe
andwind-up
Additional notes