Skip to content

REF: split describe categorical function #39287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 20, 2021

Conversation

ivanovmg
Copy link
Member

@ivanovmg ivanovmg commented Jan 20, 2021

Moved handing timestamp data from describe_categorical_1d into describe_timestamp_as_categorical_1d.
Extracted function select_describe_func for selecting the proper function, suitable for a given data type.

Pros:

  • Simplified logic on which function is selected for which data type.
  • Improved way of issuing FutureWarning.
  • Next logical step in enabling the strategy pattern.

Cons:

  • Unnecessary argument percentiles_ignored passed into functions for handling categorical types. This is done to unify the interface across all functions for describing a series. The problem will be handled when enabling strategy pattern as the percentiles will become an instance attribute for the strategy class.
  • Slight duplication in describe_categorical_1d into describe_timestamp_as_categorical_1d, which will be handled as the strategy class for categorical data is created (it will be encapsulated there).

@ivanovmg ivanovmg requested a review from jreback January 20, 2021 08:04
@jreback jreback added Refactor Internal refactoring of code Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Jan 20, 2021
@jreback jreback added this to the 1.3 milestone Jan 20, 2021
@jreback jreback merged commit ae71dc1 into pandas-dev:master Jan 20, 2021
@ivanovmg ivanovmg deleted the refactor/describe branch January 20, 2021 15:17
nofarm3 pushed a commit to nofarm3/pandas that referenced this pull request Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants