Skip to content

Establish a PandasBaseObject for all pandas objects #3231

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

Closed
ghost opened this issue Apr 1, 2013 · 6 comments
Closed

Establish a PandasBaseObject for all pandas objects #3231

ghost opened this issue Apr 1, 2013 · 6 comments
Labels
Refactor Internal refactoring of code
Milestone

Comments

@ghost
Copy link

ghost commented Apr 1, 2013

generic.PandasObject is not it since it applies to data containers, not Period or TimeStamp for example.

Should leverage subclasse's __unicode__ to do the right thing
on py2/py3 when it comes to repr,str,bytes #3183

I suggest putting in a mandatory self.random_example() (name?) method
that generates a random instance of the object. Convenient for testing, and for code snippets
in test cases/issues. Complements the more general makeX generator functions in util.testing.

Side benefit, can more easily add one-size-fits-all sanity check for a pickle roundrip,
which would have caught #2891.

More ideas?

@jreback
Copy link
Contributor

jreback commented Apr 1, 2013

with #2915 (and others), will be able to unify all primary objects with PandasObject (mainly putting Series under this umbrella), @wesm already seems to be remove numpyness from Index

I would just add needed methods to PandasObject and maybe make a PandasScalar base for things like Period/Timestamp (as a mixin)?

@ghost
Copy link
Author

ghost commented Apr 1, 2013

PandasObject references AXIS*, which doesn't apply to things like Period.
Could rename things and take over PandasObject, but right now there's no
single superclass that all relavent pandas classes derive from, and that entails
some code dupe and inconsistent behaviour.

@wesm
Copy link
Member

wesm commented Apr 1, 2013

Sure, I'm +1 on having a base object to be able to say concretely "here be pandas". Have to be careful about how that class makes its way into, say, tslib.pyx if you want it to be a superclass of Timestamp

@jreback
Copy link
Contributor

jreback commented Apr 1, 2013

no I agree.....

I think may be able to entirely drop PandasObject in favor of NDFrame after Series unification
so can reuse the name (or maybe PandasScalar?) I actually like PandasObject as the base of everything

@ghost
Copy link
Author

ghost commented Apr 1, 2013

Great, that's quite the concensus. names... whatever. we'll draw lots.

@jreback
Copy link
Contributor

jreback commented Jul 2, 2013

closed via #4092

@jreback jreback closed this as completed Jul 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code
Projects
None yet
Development

No branches or pull requests

2 participants