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

master issue for resample on DST days · Issue #5172 · pandas-dev/pandas · GitHub

df = pd.DataFrame([0], index=[datetime(2012, 11, 4, 23, 0, 0)])
df = df.tz_localize('America/New_York')
df.resample(rule='D', how='sum')

raises a AmbiguousTimeError even though datetime(2012, 11, 4, 23, 0, 0) is not ambiguous.

idx = date_range('2014-10-08 00:00','2014-10-09 00:00', freq='D', tz='Europe/Berlin')
pd.Series(5, idx).resample('MS')
index = pd.to_datetime(pd.Series([
'2014-10-26 07:35:49',
'2014-10-26 07:45:08',
'2014-10-26 08:04:58'
]))

df = pd.DataFrame(np.arange(len(index)), index=index)
df = df.tz_localize('Asia/Krasnoyarsk', ambiguous='NaT')
df.resample('D')

AmbiguousTimeError: Cannot infer dst time from Timestamp('2014-10-26 01:00:00'), try using the 'ambiguous' argument
import datetime
import pytz as tz
import pandas as pd

rome = tz.timezone('Europe/Rome')

dr = []
for i in range(2):
    dp = datetime.datetime(2014, 10, 25) + datetime.timedelta(days=i)
    dr.append(rome.localize(dp))

series = {}
for i, ddr in enumerate(dr):
    series[ddr] = i * 10

s1 = pd.Series(series)
s1 = s1.resample('D', how='mean')

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