Skip to Content
Python数据科学手册
book

Python数据科学手册

by Jake VanderPlas
January 2018
Intermediate to advanced
470 pages
13h 23m
Chinese
Posts & Telecom Press
Content preview from Python数据科学手册
Pandas
数据处理
|
173
表3-8:带开始索引的频率代码
代码 频率
MS
月初(
month start
)
BMS
月初(
business month start
,仅含工作日)
QS
季初(
quarter start
)
BQS
季初(
business quarter start
,仅含工作日)
AS
年初(
year start
)
BAS
年初(
business year start
,仅含工作日)
另外,你可以在频率代码后面加三位月份缩写字母来改变季、年频率的开始时间。
•
Q-JAN、BQ-FEB、QS-MAR、BQS-APR 等。
•
A-JAN、BA-FEB、AS-MAR、BAS-APR 等。
同理,也可以在后面加三位星期缩写字母来改变一周的开始时间。
•
W-SUN、W-MON、W-TUE、W-WED 等。
在这些代码的基础上,还可以将频率组合起来创建的新的周期。例如,可以用小时(H)
和分钟(T)的组合来实现
2
小时
30
分钟:
In[23]: pd.timedelta_range(0, periods=9, freq="2H30T")
Out[23]:
TimedeltaIndex(['00:00:00', '02:30:00', '05:00:00', '07:30:00', '10:00:00',
'12:30:00', '15:00:00', '17:30:00', '20:00:00'],
dtype='timedelta64[ns]', freq='150T')
所有这些频率代码都对应
Pandas ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

流畅的Python

流畅的Python

Luciano Ramalho
Python数据分析基础

Python数据分析基础

Clinton W. Brownley
Python数据处理

Python数据处理

Jacqueline Kazil, Katharine Jarmul

Publisher Resources

ISBN: 9787115475893