Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
BUG: unwanted numeric coercion after groupby-apply #14423
Comments
|
So I think we a duplicate of this already, need to search for it. In any event I think its doing a coercing conversion. This should strictly be a soft-conversion from object -> numeric. So the following works (though I think the existing code should actually work correctly, maybe something is not getting passed thru).
a pull-request with tests would be welcome. as an aside, what you are doing in side the |
jreback
added Bug Groupby Difficulty Novice Dtypes Effort Low
labels
Oct 14, 2016
jreback
added this to the
Next Major Release
milestone
Oct 14, 2016
jreback
changed the title from
Weird behavior in groupby-apply to BUG: unwanted numeric coercion after groupby-apply
Oct 14, 2016
waqarmalik
commented
Oct 14, 2016
•
|
Tested and the suggested change works on a much larger data set too. As an aside, I'd like to find better ways to do it -- groupby followed by extracting key parameters from each group. I couldn't devise a way to make aggregate work. Could you provide some suggestion on improving this? I've setup another page on stackoverflow for the discussion. http://stackoverflow.com/questions/40032039/pandas-groupby-apply-weird-behavior-with-series |
This was referenced Dec 10, 2016
jreback
modified the milestone: 0.20.0, Next Major Release
Mar 13, 2017
gwpdt
added a commit
to gwpdt/pandas
that referenced
this issue
Mar 14, 2017
|
|
gwpdt |
46d12c2
|
gwpdt
referenced
this issue
Mar 14, 2017
Closed
BUG: Group-by numeric type-coercion with datetime #15680
gwpdt
added a commit
to gwpdt/pandas
that referenced
this issue
Mar 16, 2017
|
|
gwpdt |
e1ed104
|
jreback
closed this
in 37e5f78
Mar 16, 2017
AnkurDedania
added a commit
to AnkurDedania/pandas
that referenced
this issue
Mar 21, 2017
|
|
gwpdt + AnkurDedania |
7d3333c
|
mattip
added a commit
to mattip/pandas
that referenced
this issue
Apr 3, 2017
|
|
gwpdt + mattip |
0c2afdc
|
waqarmalik commentedOct 14, 2016
•
edited by jreback
xref #14873 (boolean casts)
xref #14849 (datetime)
A small, complete example of the issue
Actual Output:
Expected Output
pred1 and pred2 should have the same values in column p1.
pred1 is correct whereas pred2 is changing type to float64.
Output of
pd.show_versions()commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Darwin
OS-release: 14.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.19.0
nose: None
pip: 8.1.2
setuptools: 27.2.0
Cython: None
numpy: 1.11.2
scipy: 0.18.1
statsmodels: None
xarray: None
IPython: 5.1.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.7
blosc: None
bottleneck: None
tables: 3.2.3.1
numexpr: 2.6.1
matplotlib: 1.5.3
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.1.0
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None