Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Date Type Corrupting Other Types in Group-by/Apply #15670
Comments
|
this is a duplicate of this: #14423 soln is pretty easy if you'd like to do a PR |
jreback
closed this
Mar 13, 2017
jreback
added this to the
No action
milestone
Mar 13, 2017
gwpdt
referenced
this issue
Mar 16, 2017
Closed
BUG: Group-by numeric type-coercion with datetime #15680
jreback
modified the milestone: 0.20.0, No action
Mar 16, 2017
jreback
added a commit
that referenced
this issue
Mar 16, 2017
|
|
gwpdt + jreback |
37e5f78
|
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
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gwpdt commentedMar 13, 2017
•
edited
Code Sample, a copy-pastable example if possible
Problem description
When I change the type of the Date column to a Pandas datetime, it causes other columns' types to change in unexpected ways when doing a group-by/apply. Notice the contents of the "Str" column changes to a numeric type in the final group-by/apply (a contributing factor is probably that one of the elements is the string "inf"). The "inf" value has become inf, and the "foo" value has become NaN.
Expected Output
I expect the Str column to remain a string type, and contain the original strings. I.e.:
Output of
pd.show_versions()pandas: 0.18.1
nose: 1.3.7
pip: None
setuptools: 0.6
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.18.0
statsmodels: 0.6.1
xarray: 0.7.0
IPython: 5.0.0
sphinx: 1.3.5
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: 1.1.0
tables: 3.2.3.1
numexpr: 2.6.1
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 1.0.0
xlwt: 1.1.2
xlsxwriter: 0.9.2
lxml: 3.6.1
bs4: 4.4.1
html5lib: 0.999
httplib2: None
apiclient: None
sqlalchemy: 1.0.13
pymysql: 0.6.7.None
psycopg2: 2.5.4 (dt dec pq3 ext)
jinja2: 2.8
boto: 2.40.0
pandas_datareader: None