diff --git a/pandas/_testing.py b/pandas/_testing.py index 4f957b7a55e3a..21e74dafcc944 100644 --- a/pandas/_testing.py +++ b/pandas/_testing.py @@ -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) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 202cb6488446e..d0276af2e9948 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8218,7 +8218,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 9ef865a964123..a9db60f23f2e2 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -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