Skip to content
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

Fix some pprint_thing warts #3038

Merged
1 commit merged into from Apr 23, 2013
Merged

Fix some pprint_thing warts #3038

1 commit merged into from Apr 23, 2013

Conversation

ghost
Copy link

@ghost ghost commented Mar 13, 2013

Part 1
currently:

In [4]: from pandas.core.common import pprint_thing as pp_t
   ...: pp_t([1,None])
Out[4]: u'[1, ]'

after PR:

In [13]: from pandas.core.common import pprint_thing as pp_t
    ...: pp_t([1,None])
Out[13]: u'[1, None]'

and jeff fixed index NaN printing in #3034, at a higher level.

Part 2

currently:

In [1]: pd.Index(['a','b'])
   ...: 
Out[1]: Index([a, b], dtype=object)

after PR:

pd.Index(['a','b'])
Out[3]: Index([u'a', u'b'], dtype=object)

so:

In [7]: from pandas import Index
In [10]: eval(repr(pd.Index([u'a', u'b'], dtype=object)))
Out[10]: Index([u'a', u'b'], dtype=object)

Which is what repr() should enable, in principle.

@ghost
Copy link
Author

ghost commented Mar 13, 2013

added notes to 0.11.0., but maybe this should wait until 0.12/0.11.1

also, make Timstemp repr executable, like datetime.

@jreback
Copy link
Contributor

jreback commented Mar 13, 2013

@y-p I only found the 1 case where a NaN was actually passed to pprint_thing (in index.py/format, which I fixed)

@ghost
Copy link
Author

ghost commented Mar 13, 2013

yep. what bothers you about these changes?

@jreback
Copy link
Contributor

jreback commented Mar 13, 2013

is there a test case where Part 1 actually occurs?

@ghost
Copy link
Author

ghost commented Mar 13, 2013

say there isn't. Why should None be invisible, even in theory?

@jreback
Copy link
Contributor

jreback commented Mar 13, 2013

oh...nothing....they look fine...just curios (I have always though we should ALWAYS convert None anyhow...but that is a separate issue)

@ghost
Copy link
Author

ghost commented Mar 13, 2013

I must have written that at the spur of some 4am moment, "that's no basis for a system of government".

@jreback
Copy link
Contributor

jreback commented Mar 13, 2013

that's pretty funny!

ghost pushed a commit that referenced this pull request Apr 23, 2013
Fix some pprint_thing warts
@ghost ghost merged commit 88c9471 into pandas-dev:master Apr 23, 2013
@ghost ghost deleted the pprint_warts branch April 23, 2013 02:11
@ghost
Copy link
Author

ghost commented Apr 25, 2013

rebase fail, redone with 4aea3f2

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant