Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
read_csv incompatible with newstr and future #14477
Comments
jorisvandenbossche
added IO CSV Regression
labels
Oct 24, 2016
jorisvandenbossche
added this to the
0.19.1
milestone
Oct 24, 2016
|
@jorisvandenbossche : Might it be best to just add a try:
unicode
except NameError:
unicode = str |
|
FYI, for future reference, here's a slightly easier way to reproduce (Note: Python 2.x required): >>> from pandas import read_csv
>>> from pandas.compat import StringIO, u
>>>
>>> data = 'a\n1'
>>> read_csv(StringIO(data), quotechar=u('"'))
...
TypeError: "quotechar" must be string, not unicode |
|
@gfyoung unicode needs to be very explicit |
|
well it's not explicit |
|
In pandas.compat: try:
unicode
except NameError:
unicode = str
...In parser.pyx: if not isinstance(quote_char, (str, bytes, compat.unicode)) and quote_char is not None:
... |
gfyoung
added a commit
to gfyoung/pandas
that referenced
this issue
Oct 25, 2016
|
|
gfyoung |
9a31321
|
gfyoung
referenced
this issue
Oct 25, 2016
Closed
BUG: Accept unicode quotechars again in pd.read_csv #14492
gfyoung
added a commit
to gfyoung/pandas
that referenced
this issue
Oct 25, 2016
|
|
gfyoung |
814746b
|
gfyoung
added a commit
to gfyoung/pandas
that referenced
this issue
Oct 25, 2016
|
|
gfyoung |
1d3a3d7
|
gfyoung
added a commit
to gfyoung/pandas
that referenced
this issue
Oct 25, 2016
|
|
gfyoung |
6a47510
|
gfyoung
added a commit
to gfyoung/pandas
that referenced
this issue
Oct 26, 2016
|
|
gfyoung |
523412b
|
gfyoung
added a commit
to gfyoung/pandas
that referenced
this issue
Oct 26, 2016
|
|
gfyoung |
ec9f59a
|
jreback
closed this
in 6130e77
Oct 26, 2016
jorisvandenbossche
added a commit
to jorisvandenbossche/pandas
that referenced
this issue
Nov 2, 2016
|
|
gfyoung + jorisvandenbossche |
6440067
|
amolkahat
added a commit
to amolkahat/pandas
that referenced
this issue
Nov 26, 2016
|
|
gfyoung + amolkahat |
01e2818
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
larssono commentedOct 23, 2016
•
edited by jorisvandenbossche
When upgrading the pandas-0.19 I have several tests failing on a package I maintain. These packages are using several imports from future to work with both py2 and py3. It seems there is an issue with using
from __future__ import unicode_literalsA small, complete example of the issue
The first reading works the second does not and throws the stack trace attached. ("TypeError: "quotechar" must be string, not unicode")
The example file
simple.txt
Expected Output
Output of
pd.show_versions()commit: None
python: 2.7.10.final.0
python-bits: 64
OS: Darwin
OS-release: 15.6.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: None.None
pandas: 0.19.0
nose: 1.3.7
pip: 8.1.2
setuptools: 26.0.0
Cython: None
numpy: 1.11.2
scipy: 0.16.1
statsmodels: 0.6.1
xarray: None
IPython: 5.1.0
sphinx: 1.3.1
patsy: 0.4.1
dateutil: 2.5.3
pytz: 2016.7
blosc: None
bottleneck: None
tables: None
numexpr: 2.4.6
matplotlib: 1.5.1
openpyxl: None
xlrd: 0.9.4
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.4.1
html5lib: 0.9999999
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.42.0
pandas_datareader: None