lux-org / lux

Automatically visualize your pandas dataframe via a single print! 📊 💡
Apache License 2.0
5.15k stars 365 forks source link

Initialization inconsistency for _recommendation between LuxDataFrame and LuxSeries #436

Open cgarciae opened 2 years ago

cgarciae commented 2 years ago

Just noticed that LuxDataFrame initializes _recommendation as a dict while LuxSeries initializes is as a list as show here:

LuxDataFrame: https://github.com/lux-org/lux/blob/91e8e9885668bd42e1a125247a0d3166273b2a9a/lux/core/frame.py#L64

LuxSeries: https://github.com/lux-org/lux/blob/91e8e9885668bd42e1a125247a0d3166273b2a9a/lux/core/series.py#L60

I wonder if this is intended or is having a silent impact over the code base? More over, should I replicate this behaviour or fix this in #435?

dorisjlee commented 2 years ago

The initialization should be set as a dictionary for both series and frame. The recommendation property is meant to be a key-value dictionary where the keys are the names of the actions and the value is a list of recommendations. Even in the case of a series where there is only one action, we still follow the key value dictionary convention. For example, see:

Screen Shot 2021-11-24 at 1 52 56 PM