-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
API: read_excel signature #11198
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
API: read_excel signature #11198
Conversation
@@ -156,11 +159,18 @@ def get_writer(engine_name): | |||
Acceptable values are None or xlrd""" | |||
|
|||
@Appender(excel_doc_common % read_excel_kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we still need the excel_doc_common?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - ExcelFile.parse
and read_excel
both use it.
Just thinking, maybe the api should be changed to match the to_excel
semantics where an ExcelFile
object could be passed to read_excel
(and deprecate ExcelFile.parse
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, read_excel
should also be able to take an ExcelFile
object. Go ahead and add that on.
Yeah .parse
was existing before read_excel
. go ahead and deprecate that as well (but obviously don't change the use for now). Point people to read_excel
. You'll need to change the docs as well.
a7e0945
to
0170181
Compare
@jreback - alright, I deprecated I also reordered the Excel docs to fit the new note; I think it reads more logically now. |
@@ -989,6 +991,7 @@ Deprecations | |||
- ``Series.is_time_series`` deprecated in favor of ``Series.index.is_all_dates`` (:issue:`11135`) | |||
- Legacy offsets (like ``'A@JAN'``) listed in :ref:`here <timeseries.legacyaliases>` are deprecated (note that this has been alias since 0.8.0), (:issue:`10878`) | |||
- ``WidePanel`` deprecated in favor of ``Panel``, ``LongPanel`` in favor of ``DataFrame`` (note these have been aliases since < 0.11.0), (:issue:`10892`) | |||
- ``ExcelFile.parse`` has deprecated in favor ``read_excel(ExcelFile)`` (:issue:`11198`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is deprecated; in favor of
0170181
to
b16cc4d
Compare
@jreback - made the changes you noted. |
looks good. ping when green. |
Is there a good reason to deprecate |
@jorisvandenbossche - there's no super-compelling reason; the main idea was to match up with api of I did update the docs to cover that specific example. edit: although it may be hard to see in the diff - rendered below. |
OK, I see that you changed that explanation in the docs I was pointing to. But, what is the point of |
I would say there isn't any usecase for exposing So should deprecate this as well. I could see a use as an object holding the iterator if we do support chunksizing (e.g. kind of like the |
What I mean is:
In the above, the One thing that is possible with |
So right now Second, because
|
@chris-b1 oh, that is good 2 know (maybe add a note about that in the docs). Ok, I do see some utility in |
@jreback - expanded the |
``read_excel`` can read more than one sheet, by setting ``sheetname`` to either | ||
a list of sheet names, a list of sheet positions, or ``None`` to read all sheets. | ||
# also can be used as a context manager | ||
with pd.ExcelFile('path_to_file.xls') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing as xlsx:
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, good catch
I am still not fully convinced that deprecating This is more subjective, but, when having such a And for clarity, big +1 on the signature and doc changes! |
ok, @chris-b1 why don't you back out the deprecation of |
01d5513
to
70fb54f
Compare
Sure, not a problem. Latest changes backs out the deprecation - I left the testing changes in (primarily using |
|
||
``read_excel`` can read more than one sheet, by setting ``sheetname`` to either | ||
a list of sheet names, a list of sheet positions, or ``None`` to read all sheets. | ||
# ExcelFile.parse commamnd which is equivalent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would take this out as its duplicative of the above
some minor doc changes |
5f6e934
to
9763cbd
Compare
@jreback - made those doc changes. The travis failure seems to be unrelated? Has to do with HTML formatting |
yeh that failure happens once in a while, no idea why |
@chris-b1 I was just thinking: to make it more clear in the docs that |
9763cbd
to
88708b2
Compare
@jorisvandenbossche - sure makes sense to me, see update. |
merged via 0d39ca1 thanks! |
Replace the
**kwds
inread_excel
with the actual list of supported keyword args. This doesn'tchange any functionality, just nicer for interactive use. Also a bit of clarification on the
thousands
arg in the docstring.
Additionally,
chunksize
was a parameter in theExcelFile.parse
signature, but didn't do anything (xref #8011). I removed this and raiseNotImplementedError
if passed, which is potentially breaking.