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/16071 below:

.loc slice with datetime string with DataFrame of length 1 gives an empty DataFrame · Issue #16071 · pandas-dev/pandas · GitHub

I've already raised the problem at #13929 (comment) but it turned out to be a different issue.

The following test code illustrates the problem
import pandas as pd
from pandas.util import testing as tm

from datetime import datetime
df = pd.DataFrame(columns=['1'],
                  index=pd.date_range('2016-10-01T00:00:00',
                                      '2016-10-01T23:59:59'))
df_sliced_dt = df.loc[datetime(2016,10,1):]
tm.assert_frame_equal(df, df_sliced_dt)

df = pd.DataFrame(columns=['1'],
                  index=pd.date_range('2016-10-01T00:00:00',
                                      '2016-10-01T23:59:59'))
df_sliced_str = df.loc['2016-10-01T00:00:00':]
tm.assert_frame_equal(df, df_sliced_str)

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