From a5719e80961f58cf2edb369c08f0c1864b99872d Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Tue, 14 Apr 2020 20:28:52 +0100 Subject: [PATCH] CLN: misc cleanups from LGTM --- pandas/_testing.py | 6 ------ pandas/core/frame.py | 1 - pandas/core/series.py | 1 - 3 files changed, 8 deletions(-) diff --git a/pandas/_testing.py b/pandas/_testing.py index 1f6b645c821c8..e02188f4fb9b1 100644 --- a/pandas/_testing.py +++ b/pandas/_testing.py @@ -248,16 +248,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) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index d19f1a263f71a..dd1aabaa342ff 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8216,7 +8216,6 @@ def blk_func(values): result = result.iloc[0].rename(None) return result - data = self if numeric_only is None: data = self values = data.values diff --git a/pandas/core/series.py b/pandas/core/series.py index 3f5927828e541..66bccb8840cd2 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -276,7 +276,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