Skip to content

BUG: bug when trying to display an embedded PandasObject (GH5324) #5325

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 1 commit into from
Oct 25, 2013

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Oct 25, 2013

closes #5324

There was a bug where this wasn't display at all, so this PR fixes

Do we care about formatting embedded pandas objects? (as we don't recommend this anyhow)

In [15]: df1 = DataFrame({'a':[1, 2, 3], 'b':[3, 4, 5]})

In [19]: df2.dtypes
Out[19]: 
0    object
dtype: object

In [16]: df1
Out[16]: 
   a  b
0  1  3
1  2  4
2  3  5

In [17]: df2 = DataFrame([df1,df1+10])

In [18]: df2
Out[18]: 
                                         0
0             a  b
0  1  3
1  2  4
2  3  5
1      a   b
0  11  13
1  12  14
2  13  15

@jreback
Copy link
Contributor Author

jreback commented Oct 25, 2013

@y-p @jtratner ?

@jtratner
Copy link
Contributor

👍

@jreback
Copy link
Contributor Author

jreback commented Oct 25, 2013

This apparently is what 0.10.0 displayed, which is wrong (because it appears they are lists), but then again
does show a reasonable display.....

        0
0  [a, b]
1  [a, b]
>>> 

@jreback
Copy link
Contributor Author

jreback commented Oct 25, 2013

to contrived?

In [4]: DataFrame([ DataFrame({'A' : [1,2], 'B' : 0}), Series([1,2,3]) ])
Out[4]: 
           0
0  DataFrame
1     Series

@jtratner
Copy link
Contributor

you should just use numpy's array_repr for Series

@ghost
Copy link

ghost commented Oct 25, 2013

I'd say this falls under "undefined behaviour". No objections to making this change though.

jreback added a commit that referenced this pull request Oct 25, 2013
BUG: bug when trying to display an embedded PandasObject (GH5324)
@jreback jreback merged commit caefbf7 into pandas-dev:master Oct 25, 2013
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.

BUG: embedded pandas object cause formatting exceptions
2 participants