Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Strange output from `DataFrame.apply` when applied func creates a dict #8735
Comments
|
This inference is done in cython. It is indeed trying to get the values attribute (e.g. Do you want something like this?
|
jreback
added the
API Design
label
Nov 7, 2014
|
Hi all, I've run into the same issue myself. I actually need to pass a list of dicts for each row as my output, and it would be nice to be able to do
|
ringw
referenced
this issue
Aug 3, 2015
Closed
ENH: Fixed DF.apply for functions returning a dict, #8735 #10740
jreback
added this to the
0.17.0
milestone
Aug 3, 2015
jreback
added the
Bug
label
Aug 3, 2015
ringw
added a commit
to ringw/pandas
that referenced
this issue
Aug 27, 2015
|
|
ringw |
f235902
|
jreback
closed this
in 59da781
Aug 28, 2015
Casyfill
commented
Dec 13, 2015
|
Hey, I still have this issue with my function returing a dict as part of aggregation |
|
well this was fixed in 0.17.0 |
onesandzeroes commentedNov 5, 2014
Just had something odd come up while trying to come up with something for this SO question.
If we use
DataFrame.apply()to try and create dictionaries from the rows of a dataframe, it seems to return thedict.values()method rather than returning the dict itself.Looks like it's probably something to do with trying to grab the
valuesattribute when the output of the applied function is a Series or something similar.Library versions: