From 22da88b83751abb928313425032bae386601d347 Mon Sep 17 00:00:00 2001 From: Mortada Mehyar Date: Sat, 9 May 2015 17:48:32 -0700 Subject: [PATCH] CLN: clean up unused imports --- pandas/core/base.py | 3 --- pandas/core/categorical.py | 2 +- pandas/core/frame.py | 5 +++-- pandas/core/generic.py | 2 +- pandas/core/groupby.py | 2 +- pandas/core/index.py | 1 - pandas/core/indexing.py | 5 +---- pandas/core/nanops.py | 3 --- pandas/core/panel.py | 2 -- pandas/core/panelnd.py | 1 - pandas/core/reshape.py | 3 +-- pandas/core/series.py | 4 ++-- pandas/util/decorators.py | 4 ++-- 13 files changed, 12 insertions(+), 25 deletions(-) diff --git a/pandas/core/base.py b/pandas/core/base.py index 2f171cdd6adf3..540b900844a9e 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -1,13 +1,10 @@ """ Base and utility classes for pandas objects. """ -import datetime - from pandas import compat import numpy as np from pandas.core import common as com import pandas.core.nanops as nanops -import pandas.tslib as tslib import pandas.lib as lib from pandas.util.decorators import Appender, cache_readonly from pandas.core.strings import StringMethods diff --git a/pandas/core/categorical.py b/pandas/core/categorical.py index 97368baffd40b..b0fbce55bbf34 100644 --- a/pandas/core/categorical.py +++ b/pandas/core/categorical.py @@ -18,7 +18,7 @@ _possibly_infer_to_datetimelike, get_dtype_kinds, is_list_like, is_sequence, is_null_slice, is_bool, _ensure_platform_int, _ensure_object, _ensure_int64, - _coerce_indexer_dtype, _values_from_object, take_1d) + _coerce_indexer_dtype, take_1d) from pandas.util.terminal import get_terminal_size from pandas.core.config import get_option diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 7cce560baa1fc..21cabdbe03951 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -26,8 +26,9 @@ from pandas.core.common import (isnull, notnull, PandasError, _try_sort, _default_index, _maybe_upcast, is_sequence, _infer_dtype_from_scalar, _values_from_object, - is_list_like, _get_dtype, _maybe_box_datetimelike, - is_categorical_dtype, is_object_dtype, _possibly_infer_to_datetimelike) + is_list_like, _maybe_box_datetimelike, + is_categorical_dtype, is_object_dtype, + _possibly_infer_to_datetimelike) from pandas.core.generic import NDFrame, _shared_docs from pandas.core.index import Index, MultiIndex, _ensure_index from pandas.core.indexing import (maybe_droplevels, diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 4fb08a7b7e107..a560dd4c00be7 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -17,7 +17,7 @@ import pandas.core.common as com import pandas.core.datetools as datetools from pandas import compat -from pandas.compat import map, zip, lrange, string_types, isidentifier, lmap +from pandas.compat import map, zip, lrange, string_types, isidentifier from pandas.core.common import (isnull, notnull, is_list_like, _values_from_object, _maybe_promote, _maybe_box_datetimelike, ABCSeries, diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py index 1f76d80c34a90..ac2d4d57cd2b2 100644 --- a/pandas/core/groupby.py +++ b/pandas/core/groupby.py @@ -14,7 +14,7 @@ from pandas.core.categorical import Categorical from pandas.core.frame import DataFrame from pandas.core.generic import NDFrame -from pandas.core.index import Index, MultiIndex, CategoricalIndex, _ensure_index, _union_indexes +from pandas.core.index import Index, MultiIndex, CategoricalIndex, _ensure_index from pandas.core.internals import BlockManager, make_block from pandas.core.series import Series from pandas.core.panel import Panel diff --git a/pandas/core/index.py b/pandas/core/index.py index 21f1fed2cd6da..de30fee4009f4 100644 --- a/pandas/core/index.py +++ b/pandas/core/index.py @@ -8,7 +8,6 @@ from pandas import compat import numpy as np -from math import ceil from sys import getsizeof import pandas.tslib as tslib import pandas.lib as lib diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py index 7c373b0a2b01d..e0f06e22c431b 100644 --- a/pandas/core/indexing.py +++ b/pandas/core/indexing.py @@ -1,7 +1,6 @@ # pylint: disable=W0223 -from datetime import datetime -from pandas.core.index import Index, MultiIndex, _ensure_index +from pandas.core.index import Index, MultiIndex from pandas.compat import range, zip import pandas.compat as compat import pandas.core.common as com @@ -10,8 +9,6 @@ is_null_slice, ABCSeries, ABCDataFrame, ABCPanel, is_float, _values_from_object, _infer_fill_value, is_integer) -import pandas.lib as lib - import numpy as np # the supported indexers diff --git a/pandas/core/nanops.py b/pandas/core/nanops.py index 4121dd8e89bee..e921a9d562bc1 100644 --- a/pandas/core/nanops.py +++ b/pandas/core/nanops.py @@ -1,7 +1,5 @@ -import sys import itertools import functools - import numpy as np try: @@ -10,7 +8,6 @@ except ImportError: # pragma: no cover _USE_BOTTLENECK = False -import pandas.core.common as com import pandas.hashtable as _hash from pandas import compat, lib, algos, tslib from pandas.compat import builtins diff --git a/pandas/core/panel.py b/pandas/core/panel.py index 2cd2412cfac66..1215efe3a4db6 100644 --- a/pandas/core/panel.py +++ b/pandas/core/panel.py @@ -6,7 +6,6 @@ from pandas.compat import (map, zip, range, lrange, lmap, u, OrderedDict, OrderedDefaultdict) from pandas import compat -import sys import warnings import numpy as np from pandas.core.common import (PandasError, _try_sort, _default_index, @@ -27,7 +26,6 @@ deprecate_kwarg) import pandas.core.common as com import pandas.core.ops as ops -import pandas.core.nanops as nanops import pandas.computation.expressions as expressions from pandas import lib diff --git a/pandas/core/panelnd.py b/pandas/core/panelnd.py index d021cb2d59ecf..35e6412efc760 100644 --- a/pandas/core/panelnd.py +++ b/pandas/core/panelnd.py @@ -1,6 +1,5 @@ """ Factory methods to create N-D panels """ -import pandas.lib as lib from pandas.compat import zip import pandas.compat as compat diff --git a/pandas/core/reshape.py b/pandas/core/reshape.py index 9a812ec71b9a2..3225b4aa33ac2 100644 --- a/pandas/core/reshape.py +++ b/pandas/core/reshape.py @@ -14,8 +14,7 @@ from pandas._sparse import IntIndex from pandas.core.categorical import Categorical -from pandas.core.common import (notnull, _ensure_platform_int, _maybe_promote, - isnull) +from pandas.core.common import notnull, _ensure_platform_int, _maybe_promote from pandas.core.groupby import get_group_index, _compress_group_index import pandas.core.common as com diff --git a/pandas/core/series.py b/pandas/core/series.py index 95b6a6aa1e7dd..8ef9adb1d24a4 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -19,8 +19,8 @@ is_list_like, _values_from_object, _possibly_cast_to_datetime, _possibly_castable, _possibly_convert_platform, _try_sort, - ABCSparseArray, _maybe_match_name, _coerce_to_dtype, - _ensure_object, SettingWithCopyError, + ABCSparseArray, _maybe_match_name, + _coerce_to_dtype, SettingWithCopyError, _maybe_box_datetimelike, ABCDataFrame) from pandas.core.index import (Index, MultiIndex, InvalidIndexError, _ensure_index) diff --git a/pandas/util/decorators.py b/pandas/util/decorators.py index d839437a6fe33..9cd538511e946 100644 --- a/pandas/util/decorators.py +++ b/pandas/util/decorators.py @@ -26,7 +26,7 @@ def deprecate_kwarg(old_arg_name, new_arg_name, mapping=None): Name of prefered argument in function mapping : dict or callable If mapping is present, use it to translate old arguments to - new arguments. A callable must do its own value checking; + new arguments. A callable must do its own value checking; values not found in a dict will be forwarded unchanged. Examples @@ -45,7 +45,7 @@ def deprecate_kwarg(old_arg_name, new_arg_name, mapping=None): should raise warning >>> f(cols='should error', columns="can't pass do both") TypeError: Can only specify 'cols' or 'columns', not both - >>> @deprecate_kwarg('old', 'new', {'yes': True, 'no', False}) + >>> @deprecate_kwarg('old', 'new', {'yes': True, 'no': False}) ... def f(new=False): ... print('yes!' if new else 'no!') ...