We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
>>> import io >>> import pandas as pd >>> pd.read_csv(io.StringIO('foo,bar'), header=0, dtype=np.float64).values array([], shape=(0, 2), dtype=object)
CSV reader doesn't respect the given dtype np.float64 but sets object dtype instead.
np.float64
object
array([], shape=(0, 2), dtype=float64)
pd.show_versions()
pandas: 0.19.1 nose: 1.3.7 pip: 8.1.2 setuptools: 28.8.0 Cython: 0.25.1 numpy: 1.11.2 scipy: 0.18.1 statsmodels: None xarray: None IPython: 5.1.0 sphinx: 1.4.8 patsy: None dateutil: 2.6.0 pytz: 2016.7 blosc: None bottleneck: None tables: 3.3.0 numexpr: 2.6.1 matplotlib: 1.5.3 openpyxl: None xlrd: 1.0.0 xlwt: None xlsxwriter: None lxml: None bs4: 4.5.1 html5lib: None httplib2: 0.9.2 apiclient: 1.5.5 sqlalchemy: 1.1.4 pymysql: None psycopg2: 2.6.2 (dt dec pq3 ext lo64) jinja2: 2.8 boto: None pandas_datareader: None
The text was updated successfully, but these errors were encountered:
BUG: Respect the dtype parameter for empty CSV
30ac610
Closes pandas-devgh-14712.
f87a976
cee4d6a
No branches or pull requests
Code Sample, a copy-pastable example if possible
Problem description
CSV reader doesn't respect the given dtype
np.float64
but setsobject
dtype instead.Expected Output
Output of
pd.show_versions()
pandas: 0.19.1
nose: 1.3.7
pip: 8.1.2
setuptools: 28.8.0
Cython: 0.25.1
numpy: 1.11.2
scipy: 0.18.1
statsmodels: None
xarray: None
IPython: 5.1.0
sphinx: 1.4.8
patsy: None
dateutil: 2.6.0
pytz: 2016.7
blosc: None
bottleneck: None
tables: 3.3.0
numexpr: 2.6.1
matplotlib: 1.5.3
openpyxl: None
xlrd: 1.0.0
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.5.1
html5lib: None
httplib2: 0.9.2
apiclient: 1.5.5
sqlalchemy: 1.1.4
pymysql: None
psycopg2: 2.6.2 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: