Skip to content

COMPAT: .map iterates over python types rather than storage type #13236

Closed
@glaucouri

Description

@glaucouri

Code Sample, a copy-pastable example if possible

import pandas as P
S=P.Series([0.6,0.2,15])

pandas 0.18+numpy 0.10:

In [1]: print S.dtype
float64

In [2]: print S.values.dtype
float64

In [3]: print S.map(type)
0    <type 'numpy.float64'>
1    <type 'numpy.float64'>
2    <type 'numpy.float64'>
dtype: object

pandas 0.18.1+numpy 0.11.0:

In [5]: print S.dtype
float64

In [6]: print S.values.dtype
float64

In [7]: print S.map(type)
0    <type 'float'>
1    <type 'float'>
2    <type 'float'>
dtype: object

I expect to get the same dtype for the 3 print, why this is changed in last version?

output of pd.show_versions()

pandas: 0.18.1
nose: 1.3.7
pip: 1.5.4
setuptools: 21.0.0
Cython: 0.24
numpy: 1.11.0
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: 4.2.0
sphinx: 1.3.5
patsy: 0.4.1
dateutil: 2.4.2
pytz: 2016.4
blosc: 1.2.7
bottleneck: None
tables: 3.2.2
numexpr: 2.5.2
matplotlib: 1.5.1
openpyxl: 2.3.5
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: None
lxml: 3.4.0
bs4: 4.4.1
html5lib: 0.9999999
httplib2: None
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None

Thank you
Gla

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignCompatpandas objects compatability with Numpy or Python functionsDocsDtype ConversionsUnexpected or buggy dtype conversions

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions