Skip to content

BUG: fix categorical comparison with missing values (#26504 ) #26514

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

Merged
merged 38 commits into from
Jun 1, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e41387d
BUG: None comparison evaluates to True #26504
another-green May 24, 2019
9af03ce
ENH - Index set operation modifications to address issue #23525 (#23538)
ms7463 May 21, 2019
620fa59
DOC/CLN: wil -> will (#26484)
simonjayhawkins May 21, 2019
aad1bf9
Fixed typo mutiplication -> multiplication. (#26489)
javabrett May 22, 2019
ef87d02
DOC: fix SyntaxError in doc build on Windows (#26499)
simonjayhawkins May 23, 2019
89cc7f2
DOC: Highlighted role of index alignment in DataFrame.dot(other) (#26…
matsmaiwald May 23, 2019
babd572
DOC/CLN: Change API reference section title (#26486)
simonjayhawkins May 24, 2019
4c231a7
CLN: Remove StringMixin from PandasObject (#26505)
topper-123 May 24, 2019
cffbaac
Fix type annotations in pandas.core.indexes.datetimes (#26404)
vaibhavhrt May 24, 2019
a8af7a1
Better error message for DataFrame.hist() without numerical columns (…
matsmaiwald May 24, 2019
ac02674
Excel Test Cleanup - ReadWriteClass (#26473)
WillAyd May 24, 2019
9151211
CLN: pd.TimeGrouper (#26477)
mroeschke May 24, 2019
8c8a175
CLN: Remove ExcelWriter.sheetname (#26464)
mroeschke May 25, 2019
9d6d959
CLN: Remove deprecated parse_cols from read_excel (#26522)
mroeschke May 25, 2019
3bb4766
[TEST] Add two more parameters to the test_dti_add_sub_nonzero_mth_of…
makbigc May 25, 2019
014abdc
Remove py.path special handling from io.common (#26458)
nandahkrishna May 26, 2019
420eee5
CLN: remove StringMixin from code base, except core.computation (#26523)
topper-123 May 26, 2019
48a4b8c
MAINT: port numpy#13188 for np_datetime simplification (#26516)
xcz011 May 26, 2019
3e20569
fix categorical comparison with missing values #26504
another-green May 29, 2019
4d92eed
Merge branch 'master' into master
another-green May 29, 2019
7e6662d
Update test_operators.py
another-green May 29, 2019
16dac3a
Update categorical.py
another-green May 29, 2019
9464f72
Update test_operators.py
another-green May 29, 2019
c2b7343
Update test_operators.py
another-green May 29, 2019
65014e7
Update doc/source/whatsnew/v0.25.0.rst
another-green May 29, 2019
8964f0a
Update test_operators.py
another-green May 30, 2019
7f404d2
Update test_operators.py
another-green May 30, 2019
19e3711
Update v0.25.0.rst
another-green May 30, 2019
2fc1d27
Update test_operators.py
another-green May 30, 2019
c80c2dc
Update test_operators.py
another-green May 30, 2019
2e01686
Update test_operators.py
another-green May 30, 2019
924f693
Update test_operators.py
another-green May 30, 2019
3b4a42a
Update categorical.py
another-green May 30, 2019
57480bd
Update test_operators.py
another-green May 30, 2019
99204a4
Merge remote-tracking branch 'upstream/master' into cat
another-green May 31, 2019
045c912
Merge remote-tracking branch 'upstream/master' into cat
another-green May 31, 2019
8bb9bcf
fix categorical comparison with missing values
another-green May 31, 2019
d83c4f4
Merge remote-tracking branch 'upstream/master' into cat
another-green Jun 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CLN: Remove ExcelWriter.sheetname (#26464)
xref gh-6581
  • Loading branch information
mroeschke authored and another-green committed May 29, 2019
commit 8c8a1759a92c87ff3a56f8cef2d6ba2d9d500bc1
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.25.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ Deprecations
Removal of prior version deprecations/changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Removed ``Panel`` (:issue:`25047`, :issue:`25191`, :issue:`25231`)
-
- Removed the previously deprecated ``sheetname`` keyword in :func:`read_excel` (:issue:`16442`, :issue:`20938`)
- Removed previously deprecated ``TimeGrouper`` (:issue:`16942`)
-

Expand Down
24 changes: 4 additions & 20 deletions pandas/io/excel/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import os
from textwrap import fill
from urllib.request import urlopen
import warnings

from pandas._config import config

Expand Down Expand Up @@ -291,15 +290,10 @@ def read_excel(io,
mangle_dupe_cols=True,
**kwds):

# Can't use _deprecate_kwarg since sheetname=None has a special meaning
if is_integer(sheet_name) and sheet_name == 0 and 'sheetname' in kwds:
warnings.warn("The `sheetname` keyword is deprecated, use "
"`sheet_name` instead", FutureWarning, stacklevel=2)
sheet_name = kwds.pop("sheetname")

if 'sheet' in kwds:
raise TypeError("read_excel() got an unexpected keyword argument "
"`sheet`")
for arg in ('sheet', 'sheetname'):
if arg in kwds:
raise TypeError("read_excel() got an unexpected keyword argument "
"`{}`".format(arg))

if not isinstance(io, ExcelFile):
io = ExcelFile(io, engine=engine)
Expand Down Expand Up @@ -833,16 +827,6 @@ def parse(self,
DataFrame or dict of DataFrames
DataFrame from the passed in Excel file.
"""

# Can't use _deprecate_kwarg since sheetname=None has a special meaning
if is_integer(sheet_name) and sheet_name == 0 and 'sheetname' in kwds:
warnings.warn("The `sheetname` keyword is deprecated, use "
"`sheet_name` instead", FutureWarning, stacklevel=2)
sheet_name = kwds.pop("sheetname")
elif 'sheetname' in kwds:
raise TypeError("Cannot specify both `sheet_name` "
"and `sheetname`. Use just `sheet_name`")

if 'chunksize' in kwds:
raise NotImplementedError("chunksize keyword of read_excel "
"is not implemented")
Expand Down
34 changes: 11 additions & 23 deletions pandas/tests/io/test_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,15 @@ def test_excel_passes_na(self, ext):
tm.assert_frame_equal(parsed, expected)

@td.skip_if_no('xlrd', '1.0.1') # GH-22682
def test_deprecated_sheetname(self, ext):
@pytest.mark.parametrize('arg', ['sheet', 'sheetname'])
def test_unexpected_kwargs_raises(self, ext, arg):
# gh-17964
excel = self.get_excelfile('test1', ext)

with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
read_excel(excel, sheetname='Sheet1')

with pytest.raises(TypeError):
read_excel(excel, sheet='Sheet1')
kwarg = {arg: 'Sheet1'}
msg = "unexpected keyword argument `{}`".format(arg)
with pytest.raises(TypeError, match=msg):
read_excel(excel, **kwarg)

@td.skip_if_no('xlrd', '1.0.1') # GH-22682
def test_excel_table_sheet_by_index(self, ext):
Expand Down Expand Up @@ -588,32 +588,20 @@ def test_sheet_name_and_sheetname(self, ext):
df_ref = self.get_csv_refdf(filename)
df1 = self.get_exceldf(filename, ext,
sheet_name=sheet_name, index_col=0) # doc
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
with ignore_xlrd_time_clock_warning():
df2 = self.get_exceldf(filename, ext, index_col=0,
sheetname=sheet_name) # backward compat
with ignore_xlrd_time_clock_warning():
df2 = self.get_exceldf(filename, ext, index_col=0,
sheet_name=sheet_name)

excel = self.get_excelfile(filename, ext)
df1_parse = excel.parse(sheet_name=sheet_name, index_col=0) # doc
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
df2_parse = excel.parse(index_col=0,
sheetname=sheet_name) # backward compat
df2_parse = excel.parse(index_col=0,
sheet_name=sheet_name)

tm.assert_frame_equal(df1, df_ref, check_names=False)
tm.assert_frame_equal(df2, df_ref, check_names=False)
tm.assert_frame_equal(df1_parse, df_ref, check_names=False)
tm.assert_frame_equal(df2_parse, df_ref, check_names=False)

def test_sheet_name_both_raises(self, ext):
with pytest.raises(TypeError, match="Cannot specify both"):
self.get_exceldf('test1', ext, sheetname='Sheet1',
sheet_name='Sheet1')

excel = self.get_excelfile('test1', ext)
with pytest.raises(TypeError, match="Cannot specify both"):
excel.parse(sheetname='Sheet1',
sheet_name='Sheet1')

def test_excel_read_buffer(self, ext):

pth = os.path.join(self.dirpath, 'test1' + ext)
Expand Down