Skip to content

CLN: move pandas.indexes -> pandas.core.indexes #16031

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 1 commit into from
Apr 17, 2017
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
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.20.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1344,6 +1344,7 @@ If indicated, a deprecation warning will be issued if you reference theses modul
"pandas.index", "pandas._libs.index", ""
"pandas.algos", "pandas._libs.algos", ""
"pandas.hashtable", "pandas._libs.hashtable", ""
"pandas.indexes", "pandas.core.indexes", ""
"pandas.json", "pandas.io.json.libjson", "X"
"pandas.parser", "pandas.io.libparsers", "X"
"pandas.formats", "pandas.io.formats", ""
Expand Down
16 changes: 13 additions & 3 deletions pandas/compat/pickle_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def load_reduce(self):

# 15477
('pandas.core.base', 'FrozenNDArray'):
('pandas.indexes.frozen', 'FrozenNDArray'),
('pandas.core.indexes.frozen', 'FrozenNDArray'),
('pandas.core.base', 'FrozenList'):
('pandas.indexes.frozen', 'FrozenList'),
('pandas.core.indexes.frozen', 'FrozenList'),

# 10890
('pandas.core.series', 'TimeSeries'):
Expand All @@ -84,7 +84,17 @@ def load_reduce(self):
('pandas.sparse.series', 'SparseSeries'):
('pandas.core.sparse.series', 'SparseSeries'),
('pandas.sparse.frame', 'SparseDataFrame'):
('pandas.core.sparse.frame', 'SparseDataFrame')
('pandas.core.sparse.frame', 'SparseDataFrame'),
('pandas.indexes.base', '_new_Index'):
('pandas.core.indexes.base', '_new_Index'),
('pandas.indexes.base', 'Index'):
('pandas.core.indexes.base', 'Index'),
('pandas.indexes.numeric', 'Int64Index'):
('pandas.core.indexes.numeric', 'Int64Index'),
('pandas.indexes.range', 'RangeIndex'):
('pandas.core.indexes.range', 'RangeIndex'),
('pandas.indexes.multi', 'MultiIndex'):
('pandas.core.indexes.multi', 'MultiIndex')
}


Expand Down
2 changes: 1 addition & 1 deletion pandas/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from pandas.core.index import (Index, CategoricalIndex, Int64Index,
UInt64Index, RangeIndex, Float64Index,
MultiIndex, IntervalIndex)
from pandas.indexes.interval import Interval, interval_range
from pandas.core.indexes.interval import Interval, interval_range

from pandas.core.series import Series
from pandas.core.frame import DataFrame
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,7 @@ def _factorize_from_iterable(values):
If `values` has a categorical dtype, then `categories` is
a CategoricalIndex keeping the categories and order of `values`.
"""
from pandas.indexes.category import CategoricalIndex
from pandas.core.indexes.category import CategoricalIndex

if not is_list_like(values):
raise TypeError("Input must be list-like")
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/index.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# flake8: noqa
from pandas.indexes.api import *
from pandas.indexes.multi import _sparsify
from pandas.core.indexes.api import *
from pandas.core.indexes.multi import _sparsify
File renamed without changes.
12 changes: 6 additions & 6 deletions pandas/indexes/api.py → pandas/core/indexes/api.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from pandas.indexes.base import (Index, _new_Index, # noqa
from pandas.core.indexes.base import (Index, _new_Index, # noqa
_ensure_index, _get_na_value,
InvalidIndexError)
from pandas.indexes.category import CategoricalIndex # noqa
from pandas.indexes.multi import MultiIndex # noqa
from pandas.indexes.interval import IntervalIndex # noqa
from pandas.indexes.numeric import (NumericIndex, Float64Index, # noqa
from pandas.core.indexes.category import CategoricalIndex # noqa
from pandas.core.indexes.multi import MultiIndex # noqa
from pandas.core.indexes.interval import IntervalIndex # noqa
from pandas.core.indexes.numeric import (NumericIndex, Float64Index, # noqa
Int64Index, UInt64Index)
from pandas.indexes.range import RangeIndex # noqa
from pandas.core.indexes.range import RangeIndex # noqa

import pandas.core.common as com
import pandas._libs.lib as lib
Expand Down
4 changes: 2 additions & 2 deletions pandas/indexes/base.py → pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import pandas.core.base as base
from pandas.util.decorators import (Appender, Substitution, cache_readonly,
deprecate, deprecate_kwarg)
from pandas.indexes.frozen import FrozenList
from pandas.core.indexes.frozen import FrozenList
import pandas.core.common as com
import pandas.core.dtypes.concat as _concat
import pandas.core.missing as missing
Expand Down Expand Up @@ -1675,7 +1675,7 @@ def append(self, other):

if self.is_categorical():
# if calling index is category, don't check dtype of others
from pandas.indexes.category import CategoricalIndex
from pandas.core.indexes.category import CategoricalIndex
return CategoricalIndex._append_same_dtype(self, to_concat, name)

typs = _concat.get_dtype_kinds(to_concat)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

from pandas.util.decorators import Appender, cache_readonly
from pandas.core.config import get_option
from pandas.indexes.base import Index, _index_shared_docs
from pandas.core.indexes.base import Index, _index_shared_docs
import pandas.core.base as base
import pandas.core.missing as missing
import pandas.indexes.base as ibase
import pandas.core.indexes.base as ibase

_index_doc_kwargs = dict(ibase._index_doc_kwargs)
_index_doc_kwargs.update(dict(target_klass='CategoricalIndex'))
Expand Down
File renamed without changes.
14 changes: 8 additions & 6 deletions pandas/indexes/interval.py → pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,22 @@
is_interval_dtype,
is_scalar,
is_integer)
from pandas.indexes.base import (Index, _ensure_index,
default_pprint, _index_shared_docs)
from pandas.core.indexes.base import (
Index, _ensure_index,
default_pprint, _index_shared_docs)

from pandas._libs import Timestamp, Timedelta
from pandas._libs.interval import (Interval, IntervalMixin, IntervalTree,
intervals_to_interval_bounds)
from pandas._libs.interval import (
Interval, IntervalMixin, IntervalTree,
intervals_to_interval_bounds)

from pandas.indexes.multi import MultiIndex
from pandas.core.indexes.multi import MultiIndex
from pandas.compat.numpy import function as nv
from pandas.core import common as com
from pandas.util.decorators import cache_readonly, Appender
from pandas.core.config import get_option

import pandas.indexes.base as ibase
import pandas.core.indexes.base as ibase
_index_doc_kwargs = dict(ibase._index_doc_kwargs)
_index_doc_kwargs.update(
dict(klass='IntervalIndex',
Expand Down
12 changes: 7 additions & 5 deletions pandas/indexes/multi.py → pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@

from pandas.core.config import get_option

from pandas.indexes.base import (Index, _ensure_index,
_get_na_value, InvalidIndexError,
_index_shared_docs)
from pandas.indexes.frozen import FrozenNDArray, FrozenList, _ensure_frozen
import pandas.indexes.base as ibase
from pandas.core.indexes.base import (
Index, _ensure_index,
_get_na_value, InvalidIndexError,
_index_shared_docs)
from pandas.core.indexes.frozen import (
FrozenNDArray, FrozenList, _ensure_frozen)
import pandas.core.indexes.base as ibase
_index_doc_kwargs = dict(ibase._index_doc_kwargs)
_index_doc_kwargs.update(
dict(klass='MultiIndex',
Expand Down
5 changes: 3 additions & 2 deletions pandas/indexes/numeric.py → pandas/core/indexes/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

from pandas import compat
from pandas.core import algorithms
from pandas.indexes.base import Index, InvalidIndexError, _index_shared_docs
from pandas.core.indexes.base import (
Index, InvalidIndexError, _index_shared_docs)
from pandas.util.decorators import Appender, cache_readonly
import pandas.indexes.base as ibase
import pandas.core.indexes.base as ibase


_num_index_shared_docs = dict()
Expand Down
6 changes: 3 additions & 3 deletions pandas/indexes/range.py → pandas/core/indexes/range.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
from pandas import compat
from pandas.compat import lrange, range
from pandas.compat.numpy import function as nv
from pandas.indexes.base import Index, _index_shared_docs
from pandas.core.indexes.base import Index, _index_shared_docs
from pandas.util.decorators import Appender, cache_readonly
import pandas.indexes.base as ibase
import pandas.core.indexes.base as ibase

from pandas.indexes.numeric import Int64Index
from pandas.core.indexes.numeric import Int64Index


class RangeIndex(Int64Index):
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/sparse/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import pandas.core.ops as ops
import pandas.io.formats.printing as printing
from pandas.util.decorators import Appender
from pandas.indexes.base import _index_shared_docs
from pandas.core.indexes.base import _index_shared_docs


_sparray_doc_kwargs = dict(klass='SparseArray')
Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ class TestPDApi(Base, tm.TestCase):
ignored = ['tests', 'locale', 'conftest']

# top-level sub-packages
lib = ['api', 'compat', 'core',
'indexes', 'errors', 'pandas',
lib = ['api', 'compat', 'core', 'errors', 'pandas',
'plotting', 'test', 'testing', 'tools', 'tseries',
'util', 'options', 'io']

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def test_numpy_argsort(self):
# pandas compatibility input validation - the
# rest already perform separate (or no) such
# validation via their 'values' attribute as
# defined in pandas.indexes/base.py - they
# defined in pandas.core.indexes/base.py - they
# cannot be changed at the moment due to
# backwards compatibility concerns
if isinstance(type(ind), (CategoricalIndex, RangeIndex)):
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import datetime, timedelta

import pandas.util.testing as tm
from pandas.indexes.api import Index, MultiIndex
from pandas.core.indexes.api import Index, MultiIndex
from pandas.tests.indexes.common import Base

from pandas.compat import (range, lrange, lzip, u,
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/test_category.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

import pandas.util.testing as tm
from pandas.indexes.api import Index, CategoricalIndex
from pandas.core.indexes.api import Index, CategoricalIndex
from .common import Base

from pandas.compat import range, PY3
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/test_frozen.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
from pandas.util import testing as tm
from pandas.tests.test_base import CheckImmutable, CheckStringMixin
from pandas.indexes.frozen import FrozenList, FrozenNDArray
from pandas.core.indexes.frozen import FrozenList, FrozenNDArray
from pandas.compat import u


Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/test_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
compat, date_range, period_range)
from pandas.compat import PY3, long, lrange, lzip, range, u
from pandas.errors import PerformanceWarning, UnsortedIndexError
from pandas.indexes.base import InvalidIndexError
from pandas.core.indexes.base import InvalidIndexError
from pandas._libs import lib
from pandas._libs.lib import Timestamp

Expand Down
4 changes: 2 additions & 2 deletions pandas/tseries/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
from pandas._libs.period import Period

from pandas.core.index import Index
from pandas.indexes.base import _index_shared_docs
from pandas.core.indexes.base import _index_shared_docs
from pandas.util.decorators import Appender, cache_readonly
import pandas.core.dtypes.concat as _concat
import pandas.tseries.frequencies as frequencies

import pandas.indexes.base as ibase
import pandas.core.indexes.base as ibase
_index_doc_kwargs = dict(ibase._index_doc_kwargs)


Expand Down
2 changes: 1 addition & 1 deletion pandas/tseries/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from pandas.core.common import _values_from_object, _maybe_box

from pandas.core.index import Index, Int64Index, Float64Index
from pandas.indexes.base import _index_shared_docs
from pandas.core.indexes.base import _index_shared_docs
import pandas.compat as compat
from pandas.tseries.frequencies import (
to_offset, get_period_alias,
Expand Down
4 changes: 2 additions & 2 deletions pandas/tseries/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
_quarter_to_myear)

from pandas.core.base import _shared_docs
from pandas.indexes.base import _index_shared_docs, _ensure_index
from pandas.core.indexes.base import _index_shared_docs, _ensure_index

from pandas import compat
from pandas.util.decorators import (Appender, Substitution, cache_readonly,
deprecate_kwarg)
from pandas.compat import zip, u

import pandas.indexes.base as ibase
import pandas.core.indexes.base as ibase
_index_doc_kwargs = dict(ibase._index_doc_kwargs)
_index_doc_kwargs.update(
dict(target_klass='PeriodIndex or list of Periods'))
Expand Down
2 changes: 1 addition & 1 deletion pandas/tseries/tdi.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from pandas.tseries.frequencies import to_offset
from pandas.core.algorithms import checked_add_with_arr
from pandas.core.base import _shared_docs
from pandas.indexes.base import _index_shared_docs
from pandas.core.indexes.base import _index_shared_docs
import pandas.core.common as com
import pandas.core.dtypes.concat as _concat
from pandas.util.decorators import Appender, Substitution, deprecate_kwarg
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,9 @@ def pxd(name):
'pandas.compat.numpy',
'pandas.core',
'pandas.core.dtypes',
'pandas.core.indexes',
'pandas.core.computation',
'pandas.core.sparse',
'pandas.indexes',
'pandas.errors',
'pandas.io',
'pandas.io.json',
Expand Down