Consider this simple dataframe:
a b
0 1 2
1 2 3
I perform a .apply
as such:
In [4]: df.apply(lambda x: [x.values])
Out[4]:
a [[140279910807944, 140279910807920]]
b [[140279910807944, 140279910807920]]
dtype: object
In [5]: df.apply(lambda x: [x.values])
Out[5]:
a [[37, 37]]
b [[37, 37]]
dtype: object
In [6]: df.apply(lambda x: [x.values])
Out[6]:
a [[11, 11]]
b [[11, 11]]
dtype: object
Why is pandas printing out junk each time?
I've verified this happens in v0.20.
Edit: Looking for an answer, not a workaround.
It looks like bug, so was opened Issue 17487.
For me working add
tolist
:I don't have an answer... just a work around
I tracked it down to
pd.lib.reduce
Versus
Another work around: