-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Issue with parsing PeriodDtype columns in read_csv() #26934
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
Comments
Yep. You may be able to reuse |
@TomAugspurger Thanks! I will take a look at this. |
@mc4229 I tried calling _sequence directly from _from_sequence_of_strings() and it works |
Fixes: pandas-dev#26934 Signed-off-by: Antonio Gutierrez <[email protected]>
Hi all, I created a PR using for this issue using the suggested approach. |
Fixes: pandas-dev#26934 Signed-off-by: Antonio Gutierrez <[email protected]>
Fixes: pandas-dev#26934 Signed-off-by: Antonio Gutierrez <[email protected]>
Fixes: pandas-dev#26934 Signed-off-by: Antonio Gutierrez <[email protected]>
Code Sample
Problem description
Using pandas 0.24.2, I wrote a simple data frame with the following dtypes into a csv file,
When I tried to read it back in, I found that
read_csv()
could not parsePeriodDtype("M")
. I got the following error message:I saw a similar issue #24542 raised for Datetime dtype. It seems that
_from_sequence_of_strings()
is also not defined forPeriodArray
, which prevents parsing columns withPeriodDtype
.I think adding
_from_sequence_of_strings()
forPeriodArray
would be a good enhancement. If that is the case I would be interested in making that change.Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]INSTALLED VERSIONS
commit: None
python: 3.7.2.final.0
python-bits: 64
OS: Darwin
OS-release: 18.6.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.24.2
pytest: 3.8.0
pip: 10.0.1
setuptools: 40.2.0
Cython: 0.28.5
numpy: 1.16.4
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 6.5.0
sphinx: 1.7.9
patsy: 0.5.0
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.8
feather: None
matplotlib: 2.2.3
openpyxl: 2.5.6
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 1.1.0
lxml.etree: 4.2.5
bs4: 4.6.3
html5lib: 1.0.1
sqlalchemy: 1.2.11
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: