A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/3070 below:

Allow Timeseries-like shortcuts in dataframes __getitem__ · Issue #3070 · pandas-dev/pandas · GitHub

Skip to content Navigation Menu

Saved searches Use saved searches to filter your results more quickly

Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert Additional navigation options

Allow Timeseries-like shortcuts in dataframes __getitem__ #3070

Description
In [17]: s=pd.date_range("2001-1-1", periods=12)
In [20]: ts['2001']
Out[20]: 
2001-01-01     0
2001-01-02     1
2001-01-03     2
2001-01-04     3
2001-01-05     4
2001-01-06     5
2001-01-07     6
2001-01-08     7
2001-01-09     8
2001-01-10     9
2001-01-11    10
2001-01-12    11
Freq: D, dtype: int64

In [24]: df=pd.DataFrame(range(len(s)),index=s)
In [25]: df['2001']
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
KeyError: u'no item named 2001'

In [27]: df.index is ts.index
Out[27]: True

related #2091

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4