-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
read_excel does not work on excel file binary text or buffered binary text object #15914
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
Labels
Milestone
Comments
I don't think that's expected to work, from the doctoring:
We could have a better error message though, similar to In [9]: pd.read_csv(b"abc,123", encoding='utf-8') Traceback (most recent call last):
File "<ipython-input-9-d793693413f5>", line 1, in <module>
pd.read_csv(b"abc,123", encoding='utf-8')
File "/Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas-0.19.0+733.gca8ef494d-py3.6-macosx-10.12-x86_64.egg/pandas/io/parsers.py", line 656, in parser_f
return _read(filepath_or_buffer, kwds)
File "/Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas-0.19.0+733.gca8ef494d-py3.6-macosx-10.12-x86_64.egg/pandas/io/parsers.py", line 404, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File "/Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas-0.19.0+733.gca8ef494d-py3.6-macosx-10.12-x86_64.egg/pandas/io/parsers.py", line 763, in __init__
self._make_engine(self.engine)
File "/Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas-0.19.0+733.gca8ef494d-py3.6-macosx-10.12-x86_64.egg/pandas/io/parsers.py", line 967, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File "/Users/taugspurger/Envs/pandas-dev/lib/python3.6/site-packages/pandas-0.19.0+733.gca8ef494d-py3.6-macosx-10.12-x86_64.egg/pandas/io/parsers.py", line 1552, in __init__
self._reader = libparsers.TextReader(src, **kwds)
File "as/pandas/io/parsers.pyx", line 393, in pandas.io.libparsers.TextReader.__cinit__ (pandas/io/parsers.c:4209)
File "as/pandas/io/parsers.pyx", line 727, in pandas.io.libparsers.TextReader._setup_parser_source (pandas/io/parsers.c:9050)
OSError: Expected file path name or file-like object, got <class 'bytes'> type @alexanderwhatley interested in submitting a fix? |
#Read and write to excel |
5 tasks
gfyoung
pushed a commit
that referenced
this issue
Jan 3, 2020
Omegastick
pushed a commit
to Omegastick/energy_efficiency_api
that referenced
this issue
Mar 13, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Python 3.5, Pandas 0.19.2
I have the following excel file, and I am trying to read its binary content, and then have read_excel read the binary content in, except this is not working, and there may be a bug somewhere, as I have specified the engine for reading.
The text was updated successfully, but these errors were encountered: