-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
EnhancementError ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasIndexRelated to the Index class or subclassesRelated to the Index class or subclassesIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvesgood first issue
Description
Following slices basically result in the same Index
.
import pandas as pd
pd.Index([1, 2, 3])[:, None]
# Int64Index([[1], [2], [3]], dtype='int64')
pd.MultiIndex.from_tuples([('a', 1), ('b', 2)])[:, None]
# MultiIndex(levels=[[u'a', u'b'], [1, 2]],
# labels=[[[0], [1]], [[0], [1]]])
pd.period_range('2011-01-01', freq='M', periods=3)[:, None]
# PeriodIndex(['2011-01', '2011-02', '2011-03'], dtype='int64', freq='M')
But DatetimeIndex
and TimedeltaIndex
doesn't because of following line.
pd.date_range('2011-01-01', freq='M', periods=3)[:, None]
# array([['2011-01-31T09:00:00.000000000+0900'],
# ['2011-02-28T09:00:00.000000000+0900'],
# ['2011-03-31T09:00:00.000000000+0900']], dtype='datetime64[ns]')
pd.timedelta_range('1 days', freq='D', periods=3)[:, None]
# array([[ 86400000000000],
# [172800000000000],
# [259200000000000]], dtype='timedelta64[ns]')
I understand these must be Index
also, or any reason for this?
Metadata
Metadata
Assignees
Labels
EnhancementError ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasIndexRelated to the Index class or subclassesRelated to the Index class or subclassesIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvesgood first issue