简体   繁体   中英

How to change Pandas.DataFrame.resample default holiday calendar?

I'm reading Wes McKinney's Python for Data Analysis book. On the topic of using DataFrame.resample() or Series.resample() , if I want to resample for Business days, I would use:

df.resample('B')

However, I noticed that the notation of 'B' depends on your computer's region... I'm failing to run the examples on page 344 because my calendar isn't US...

How can I explicitly choose to resample based on a particular country's holiday? Say, US holidays, or European holidays? Struggling to find some documentation on this... The doc for resample() I found here { http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.resample.html } is rather short and doesn't really go into the details of the first parameter rule ...

Many thanks.

Custom Business Days (Experimental)

The CDay or CustomBusinessDay class provides a parametric BusinessDay class which can be used to create customized business day calendars which account for local holidays and local weekend conventions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM