-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
Accessor Recipe - Style Question #16890
Comments
not sure what you are mean here. accessor are by-definition namespaces that make the discovery easier and much more geared to the dtype.
Why is this a problem? There are methods that are generically implemented which belong only to Series, only to DataFrame, to both (and possibly include Panels). So these are layered inclusion methods. You can certainly refactoror, not sure if the decorator syntax is better here. Pls make sweeping changes in separate PR's |
closing this. You can comment on the other issues is prob easier. |
I think switching to decorators would be a welcome cleanup (but indeed, please save it for a separate PR). |
Following up on discussion in #14781 , I am unifying the code that creates the
str
,cat
, anddt
accessors, and making/documenting a recipe for creating custom accessors. Two questions before I push forward, both revolving around methods likeDataFrame._add_series_or_dataframe_operations
(slightly different case, but close enough) that are called immediately after the class definitions, then never needed again.Are these needed in the user-facing namespace for some reason? If not, can we wedge them into
_dir_deletions
? I know the leading underscore makes it private, butdir(pd.DataFrame)
anddir(pd.Series)
have 444 and 441 members respectively. This gets pretty imposing.In many cases these methods are called immediately after the class definition, but others like
ops.add_special_arithmetic_methods
will be easy to miss if you don't know to look for it. One alternative that I am considering for the Accessors is applying a decorator to a class. Effectively replacewith
The question being: is there a convention against using the latter approach?
The text was updated successfully, but these errors were encountered: