Skip to content

64bit read_csv with dtype problem #13256

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

Closed
wildwild opened this issue May 23, 2016 · 1 comment
Closed

64bit read_csv with dtype problem #13256

wildwild opened this issue May 23, 2016 · 1 comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Duplicate Report Duplicate issue or pull request Usage Question

Comments

@wildwild
Copy link

Code Sample, a copy-pastable example if possible

test_str = u'1.7976931348623157e+308,1.7976931348623157e+308'
ts_dbl = u'1.7976931348623157e+308'
print np.float64(ts_dbl)
dt={}
tmpio = StringIO(test_str)
market_head_list = [ "ClosePrice", "SettlementPrice"]
dt['ClosePrice']=np.float64
dt['SettlementPrice']=np.float64
df =pd.read_csv(tmpio,engine = 'c',names=market_head_list,dtype=dt)

Expected Output

data = self._reader.read(nrows)

File "pandas\parser.pyx", line 805, in pandas.parser.TextReader.read (pandas\parser.c:8620)
File "pandas\parser.pyx", line 827, in pandas.parser.TextReader._read_low_memory (pandas\parser.c:8876)
File "pandas\parser.pyx", line 904, in pandas.parser.TextReader._read_rows (pandas\parser.c:9893)
File "pandas\parser.pyx", line 1011, in pandas.parser.TextReader._convert_column_data (pandas\parser.c:11286)
File "pandas\parser.pyx", line 1092, in pandas.parser.TextReader._convert_tokens (pandas\parser.c:12659)
ValueError: cannot safely convert passed user dtype of <f8 for object dtyped data in column 0

output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.18.1
nose: 1.3.7
pip: 8.1.2
setuptools: 18.5
Cython: 0.23.4
numpy: 1.11.0
scipy: 0.16.0
statsmodels: None
xarray: None
IPython: 4.0.1
sphinx: 1.3.1
patsy: 0.4.0
dateutil: 2.5.3
pytz: 2015.7
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.5.2
matplotlib: 1.5.0
openpyxl: 2.2.6
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.7.7
lxml: 3.4.4
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.9
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.38.0
pandas_datareader: None

@jreback
Copy link
Contributor

jreback commented May 23, 2016

this was already closed in #13237 is there a reason you opened again?

@jreback jreback closed this as completed May 23, 2016
@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Usage Question Duplicate Report Duplicate issue or pull request labels May 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions Duplicate Report Duplicate issue or pull request Usage Question
Projects
None yet
Development

No branches or pull requests

2 participants