Skip to content

Commit 89b8b81

Browse files
committed
Merge pull request #10130 from mortada/cleanup_imports
CLN: clean up unused imports
2 parents b32f218 + 22da88b commit 89b8b81

13 files changed

+12
-25
lines changed

pandas/core/base.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
"""
22
Base and utility classes for pandas objects.
33
"""
4-
import datetime
5-
64
from pandas import compat
75
import numpy as np
86
from pandas.core import common as com
97
import pandas.core.nanops as nanops
10-
import pandas.tslib as tslib
118
import pandas.lib as lib
129
from pandas.util.decorators import Appender, cache_readonly
1310
from pandas.core.strings import StringMethods

pandas/core/categorical.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
_possibly_infer_to_datetimelike, get_dtype_kinds,
1919
is_list_like, is_sequence, is_null_slice, is_bool,
2020
_ensure_platform_int, _ensure_object, _ensure_int64,
21-
_coerce_indexer_dtype, _values_from_object, take_1d)
21+
_coerce_indexer_dtype, take_1d)
2222
from pandas.util.terminal import get_terminal_size
2323
from pandas.core.config import get_option
2424

pandas/core/frame.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
from pandas.core.common import (isnull, notnull, PandasError, _try_sort,
2727
_default_index, _maybe_upcast, is_sequence,
2828
_infer_dtype_from_scalar, _values_from_object,
29-
is_list_like, _get_dtype, _maybe_box_datetimelike,
30-
is_categorical_dtype, is_object_dtype, _possibly_infer_to_datetimelike)
29+
is_list_like, _maybe_box_datetimelike,
30+
is_categorical_dtype, is_object_dtype,
31+
_possibly_infer_to_datetimelike)
3132
from pandas.core.generic import NDFrame, _shared_docs
3233
from pandas.core.index import Index, MultiIndex, _ensure_index
3334
from pandas.core.indexing import (maybe_droplevels,

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pandas.core.common as com
1818
import pandas.core.datetools as datetools
1919
from pandas import compat
20-
from pandas.compat import map, zip, lrange, string_types, isidentifier, lmap
20+
from pandas.compat import map, zip, lrange, string_types, isidentifier
2121
from pandas.core.common import (isnull, notnull, is_list_like,
2222
_values_from_object, _maybe_promote,
2323
_maybe_box_datetimelike, ABCSeries,

pandas/core/groupby.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from pandas.core.categorical import Categorical
1515
from pandas.core.frame import DataFrame
1616
from pandas.core.generic import NDFrame
17-
from pandas.core.index import Index, MultiIndex, CategoricalIndex, _ensure_index, _union_indexes
17+
from pandas.core.index import Index, MultiIndex, CategoricalIndex, _ensure_index
1818
from pandas.core.internals import BlockManager, make_block
1919
from pandas.core.series import Series
2020
from pandas.core.panel import Panel

pandas/core/index.py

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from pandas import compat
99
import numpy as np
1010

11-
from math import ceil
1211
from sys import getsizeof
1312
import pandas.tslib as tslib
1413
import pandas.lib as lib

pandas/core/indexing.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# pylint: disable=W0223
22

3-
from datetime import datetime
4-
from pandas.core.index import Index, MultiIndex, _ensure_index
3+
from pandas.core.index import Index, MultiIndex
54
from pandas.compat import range, zip
65
import pandas.compat as compat
76
import pandas.core.common as com
@@ -10,8 +9,6 @@
109
is_null_slice,
1110
ABCSeries, ABCDataFrame, ABCPanel, is_float,
1211
_values_from_object, _infer_fill_value, is_integer)
13-
import pandas.lib as lib
14-
1512
import numpy as np
1613

1714
# the supported indexers

pandas/core/nanops.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import sys
21
import itertools
32
import functools
4-
53
import numpy as np
64

75
try:
@@ -10,7 +8,6 @@
108
except ImportError: # pragma: no cover
119
_USE_BOTTLENECK = False
1210

13-
import pandas.core.common as com
1411
import pandas.hashtable as _hash
1512
from pandas import compat, lib, algos, tslib
1613
from pandas.compat import builtins

pandas/core/panel.py

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from pandas.compat import (map, zip, range, lrange, lmap, u, OrderedDict,
77
OrderedDefaultdict)
88
from pandas import compat
9-
import sys
109
import warnings
1110
import numpy as np
1211
from pandas.core.common import (PandasError, _try_sort, _default_index,
@@ -27,7 +26,6 @@
2726
deprecate_kwarg)
2827
import pandas.core.common as com
2928
import pandas.core.ops as ops
30-
import pandas.core.nanops as nanops
3129
import pandas.computation.expressions as expressions
3230
from pandas import lib
3331

pandas/core/panelnd.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
""" Factory methods to create N-D panels """
22

3-
import pandas.lib as lib
43
from pandas.compat import zip
54
import pandas.compat as compat
65

pandas/core/reshape.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
from pandas._sparse import IntIndex
1515

1616
from pandas.core.categorical import Categorical
17-
from pandas.core.common import (notnull, _ensure_platform_int, _maybe_promote,
18-
isnull)
17+
from pandas.core.common import notnull, _ensure_platform_int, _maybe_promote
1918
from pandas.core.groupby import get_group_index, _compress_group_index
2019

2120
import pandas.core.common as com

pandas/core/series.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
is_list_like, _values_from_object,
2020
_possibly_cast_to_datetime, _possibly_castable,
2121
_possibly_convert_platform, _try_sort,
22-
ABCSparseArray, _maybe_match_name, _coerce_to_dtype,
23-
_ensure_object, SettingWithCopyError,
22+
ABCSparseArray, _maybe_match_name,
23+
_coerce_to_dtype, SettingWithCopyError,
2424
_maybe_box_datetimelike, ABCDataFrame)
2525
from pandas.core.index import (Index, MultiIndex, InvalidIndexError,
2626
_ensure_index)

pandas/util/decorators.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def deprecate_kwarg(old_arg_name, new_arg_name, mapping=None):
2626
Name of prefered argument in function
2727
mapping : dict or callable
2828
If mapping is present, use it to translate old arguments to
29-
new arguments. A callable must do its own value checking;
29+
new arguments. A callable must do its own value checking;
3030
values not found in a dict will be forwarded unchanged.
3131
3232
Examples
@@ -45,7 +45,7 @@ def deprecate_kwarg(old_arg_name, new_arg_name, mapping=None):
4545
should raise warning
4646
>>> f(cols='should error', columns="can't pass do both")
4747
TypeError: Can only specify 'cols' or 'columns', not both
48-
>>> @deprecate_kwarg('old', 'new', {'yes': True, 'no', False})
48+
>>> @deprecate_kwarg('old', 'new', {'yes': True, 'no': False})
4949
... def f(new=False):
5050
... print('yes!' if new else 'no!')
5151
...

0 commit comments

Comments
 (0)