Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error : Invalid type promotion #12599

Closed
TulyOpt opened this issue Mar 11, 2016 · 1 comment
Closed

Error : Invalid type promotion #12599

TulyOpt opened this issue Mar 11, 2016 · 1 comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@TulyOpt
Copy link

TulyOpt commented Mar 11, 2016

Code Sample

import pandas as pd

def main():

df1 = pd.Series() #dtype = float64
df1["a"] = pd.Timestamp("2014-01-02") #dtype = datetime64
df1["b"] = "z" # OK ! => dtype = object
df1["c"] = 3.0 # OK! => dtype = object

df2 = pd.Series() #dtype = float64
df2["a"] = pd.Timestamp("2014-01-02") #dtype = datetime64
df2["c"] = 3.0 #BOOM !! => TypeError: invalid type promotion
df2["b"] = "z"

if name == "main":
main()

output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Windows
OS-release: 8.1
machine: AMD64
processor: Intel64 Family 6 Model 61 Stepping 4, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.17.1
nose: 1.3.7
pip: 8.0.2
setuptools: 19.6.2
Cython: 0.23.4
numpy: 1.10.4
scipy: 0.17.0
statsmodels: 0.6.1
IPython: 4.0.3
sphinx: 1.3.1
patsy: 0.4.0
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.4.6
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.5.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: None
Jinja2: 2.8

@jreback
Copy link
Contributor

jreback commented Mar 11, 2016

yeah, prob not the most friendly. Note that you should not be doing this generally. A Series is a single dtyped object.

pull-requests to fix welcome

@jreback jreback added Bug Indexing Related to indexing on series/frames, not to indexes themselves Dtype Conversions Unexpected or buggy dtype conversions Difficulty Intermediate labels Mar 11, 2016
@jreback jreback added this to the 0.18.1 milestone Mar 11, 2016
@jreback jreback modified the milestones: Next Major Release, 0.18.1 Apr 26, 2016
@jreback jreback modified the milestones: 0.18.2, Next Major Release May 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants