Skip to content

CLN: misc cleanups from LGTM.com #33724

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 2 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 0 additions & 6 deletions pandas/_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,16 +279,10 @@ def write_to_compressed(compression, path, data, dest="test"):
ValueError : An invalid compression value was passed in.
"""
if compression == "zip":
import zipfile

compress_method = zipfile.ZipFile
elif compression == "gzip":
import gzip

compress_method = gzip.GzipFile
elif compression == "bz2":
import bz2

compress_method = bz2.BZ2File
elif compression == "xz":
compress_method = _get_lzma_file(lzma)
Expand Down
1 change: 0 additions & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -8218,7 +8218,6 @@ def blk_func(values):
result = result.iloc[0].rename(None)
return result

data = self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The data = self at line 8247 could be collapsed together with the line below, so we get values = self.values.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data is used further down on L8263

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, missed that. LGTM.

if numeric_only is None:
data = self
values = data.values
Expand Down
1 change: 0 additions & 1 deletion pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ def __init__(
"Cannot construct a Series from an ndarray with "
"compound dtype. Use DataFrame instead."
)
pass
elif isinstance(data, ABCSeries):
if index is None:
index = data.index
Expand Down