[三] 2 数据分析工具:Pandas -- 时间序列

一、Python时间模块 datetime

廖雪峰的官方网站>Python教程>常用内建模块>datetime

1、datetime.date

import datetime

today = datetime.date.today()

today # 2021-01-24
type(today) # <class 'datetime.date'>

str(today) # 2021-01-24
type(str(today)) # <class 'str'>

datetime.date(2020, 11, 19) # 2020-11-19

2、datetime.datetime

import datetime

now = datetime.datetime.now()

now # 2021-01-24 16:29:45.176417
type(now) # <class 'datetime.datetime'>
str(now) # 2021-01-24 16:29:45.176417

# (年,月,日,时,分,秒),至少输入年月日
datetime.datetime(2020, 11, 19) # 2020-11-19 00:00:00
datetime.datetime(2020, 11, 19, 15, 30) # 2020-11-19 15:30:00

3、datetime.timedelta

import datetime

t1 = datetime.datetime(2020, 11, 19) # 2020-11-19 00:00:00
t2 = datetime.datetime(2020, 11, 19, 15, 30) # 2020-11-19 15:30:00
t2 - t1 # 15:30:00
type(t2 - t1) # <class 'datetime.timedelta'>

today = datetime.datetime.today()
# 2021-01-24 16:43:12.537074
yesterday = today - datetime.timedelta(1)
# 2021-01-23 16:43:12.537074

4、dateutil.parser.parse

直接将str转化成datetime.datetime。各种格式可以解析,但无法支持中文。

from dateutil.parser import parse

type(parse('2000-1-1')) # <class 'datetime.datetime'>

parse('2000-1-1') # 2000-01-01 00:00:00
parse('5/1/2014') # 2014-05-01 00:00:00
parse('5/1/2014', dayfirst = True)  # 2014-01-05 00:00:00 国际通用格式中,日在月之前,可以通过dayfirst来设置
parse('22/1/2014') # 2014-01-22 00:00:00
parse('Jan 31, 1997 10:45 PM') # 1997-01-31 22:45:00

二、时间戳Timestamp和时间戳序列DatetimeIndex

1、pd.Timestamp

支持str、datetime.datetime等。

pd.Timestamp("12/1/2021")
# 2021-12-01 11:00:00
# <class 'pandas.tslib.Timestamp'>

pd.Timestamp(datetime(2021, 2, 12, 15, 30))
# 2021-02-12 15:30:00
# <class 'pandas.tslib.Timestamp'>

2、pd.DatetimeIndex

list()将DatetimeIndex转为多个Timestamp。

t = pd.DatetimeIndex(["2021-2-14", "2021-2-15", "2021-2-16", "2021-2-17"])
# DatetimeIndex(['2021-02-14', '2021-02-15', '2021-02-16', '2021-02-17'], dtype='datetime64[ns]', freq=None)
# <class 'pandas.tseries.index.DatetimeIndex'>

t[0]
# 2021-02-14 00:00:00
# <class 'pandas.tslib.Timestamp'>

list(t)
# [Timestamp('2021-02-14 00:00:00'), Timestamp('2021-02-15 00:00:00'), Timestamp('2021-02-16 00:00:00'), Timestamp('2021-02-17 00:00:00')]

3、pd.to_datetime 转换时间戳

如果是单个时间数据,转换为Timestamp。

pd.to_datetime("12/1/2021")
# 2021-12-01 00:00:00
# <class 'pandas.tslib.Timestamp'>

pd.to_datetime(datetime(2021, 2, 12, 15, 30))
# 2021-02-12 15:30:00
# <class 'pandas.tslib.Timestamp'>

如果是多个时间数据,转换为DatetimeIndex。
???to_datetime方法可以把DatetimeIndex转换为Python原生datetime.datetime对象数组。

pd.to_datetime(["2020-12-20", "2020-12-21", "2020-12-22"])
# DatetimeIndex(['2020-12-20', '2020-12-21', '2020-12-22'], dtype='datetime64[ns]', freq=None)
# <class 'pandas.tseries.index.DatetimeIndex'>

pd.to_datetime([datetime(2021, 2, 12, 15, 30), datetime(2021, 2, 12, 16, 30), datetime(2021, 2, 12, 17, 30)])
# DatetimeIndex(['2021-02-12 15:30:00', '2021-02-12 16:30:00', '2021-02-12 17:30:00'], dtype='datetime64[ns]', freq=None)
# <class 'pandas.tseries.index.DatetimeIndex'>

包含无效数据时,默认值errors='raise’会触发错误;
errors='ignore’返回原始输入;
errors='coerce’把无法解析的数据转换为NaT,即Not a Time。

date_lst = ["2020-12-20 11:30", "abc", "2020-12-22 12:00"]

# pd.to_datetime(date_lst) 报错

pd.to_datetime(date_lst, errors="ignore")
# ['2020-12-20 11:30' 'abc' '2020-12-22 12:00']
# <class 'numpy.ndarray'>

pd.to_datetime(date_lst, errors="coerce")
# DatetimeIndex(['2020-12-20 11:30:00', 'NaT', '2020-12-22 12:00:00'], dtype='datetime64[ns]', freq=None)
# <class 'pandas.tseries.index.DatetimeIndex'>

4、pd.date_range和pd.bdate_range 生成时间戳范围

pd.date_range(start=None, end=None, periods=None, freq=‘D’, tz=None, normalize=False, name=None, closed=None, **kwargs)
生成DatetimeIndex

  • start:开始日期
  • end:结束日期
  • periods:元素个数
  • freq:频率,默认天,pd.date_range()默认频率为日历日,pd.bdate_range()默认频率为工作日
  • tz:时区
  • normalize:若为True,表示将时间重置为午夜零点
  • name:生成DatetimeIndex的名称
  • closed:"left"表示左闭右开,"right"表示左开右闭
pd.date_range("2021-2-14", "2021-2-17")
# DatetimeIndex(['2021-02-14', '2021-02-15', '2021-02-16', '2021-02-17'], dtype='datetime64[ns]', freq='D')
# <class 'pandas.tseries.index.DatetimeIndex'>
list(pd.date_range("2021-2-14", "2021-2-17"))
# [Timestamp('2021-02-14 00:00:00', offset='D'), Timestamp('2021-02-15 00:00:00', offset='D'), Timestamp('2021-02-16 00:00:00', offset='D'), Timestamp('2021-02-17 00:00:00', offset='D')]

pd.date_range(start = "20210214", periods = 4)
# DatetimeIndex(['2021-02-14', '2021-02-15', '2021-02-16', '2021-02-17'], dtype='datetime64[ns]', freq='D')

pd.date_range(end = "2021-02-14 12:20", periods = 4)
# DatetimeIndex(['2021-02-11 12:20:00', '2021-02-12 12:20:00', '2021-02-13 12:20:00', '2021-02-14 12:20:00'], dtype='datetime64[ns]', freq='D')
pd.date_range(start = "2021-02-14 12:20", periods = 4, normalize = True, name = 'test')
# DatetimeIndex(['2021-02-14', '2021-02-15', '2021-02-16', '2021-02-17'], dtype='datetime64[ns]', name='test', freq='D')

pd.date_range("2021-2-14", "2021-2-17", closed = "left")
# DatetimeIndex(['2021-02-14', '2021-02-15', '2021-02-16'], dtype='datetime64[ns]', freq='D')
pd.date_range("2021-2-14", "2021-2-17", closed = "right")
# DatetimeIndex(['2021-02-15', '2021-02-16', '2021-02-17'], dtype='datetime64[ns]', freq='D')

pd.bdate_range()默认频率为工作日,即去除周六日,但识别不了法定节假日。

pd.bdate_range("2021-1-1", "2021-1-5")
# DatetimeIndex(['2021-01-01', '2021-01-04', '2021-01-05'], dtype='datetime64[ns]', freq='B')
# <class 'pandas.tseries.index.DatetimeIndex'>

5、freq 频率

以下别名可以用作date_range、bdate_range、DatetimeIndex及其它时间序列函数的参数。

默认freq = ‘D’:每日历日
B:每工作日
H:每小时
T/MIN:每分
S:每秒
L:每毫秒(千分之一秒)
U:每微秒(百万分之一秒)

星期几缩写:MON、TUE、WED、THU、FRI、SAT、SUN

W-MON:每周的星期几
WOM-2MON:每月的第几个星期几,例:每月第二个星期一

pd.date_range('2021/2/1', '2021/2/28', freq = 'W-MON')
# DatetimeIndex(['2021-02-01', '2021-02-08', '2021-02-15', '2021-02-22'], dtype='datetime64[ns]', freq='W-MON')

pd.date_range('2021/2/1', '2021/5/1', freq = 'WOM-2MON')
# DatetimeIndex(['2021-02-08', '2021-03-08', '2021-04-12'], dtype='datetime64[ns]', freq='WOM-2MON')

月缩写:JAN、FEB、MAR、APR、MAY、JUN、JUL、AUG、SEP、OCT、NOV、DEC

M:每月最后一个日历日
Q-月:指定月为季度末,每个季度末最后一月的最后一个日历日;Q-月只有三种情况,1-4-7-10、2-5-8-11、3-6-9-12
A-月:每年指定月份的最后一个日历日

BM:每月最后一个工作日
BQ-月:指定月为季度末,每个季度末最后一月的最后一个工作日
BA-月:每年指定月份的最后一个工作日

MS:每月第一个日历日
QS-月:指定月为季度末,每个季度末最后一月的第一个日历日
AS-月:每年指定月份的第一个日历日

BMS:每月第一个工作日
BQS-月:指定月为季度末,每个季度末最后一月的第一个工作日
BAS-月:每年指定月份的第一个工作日

pd.date_range('2021-1', '2021-4', freq = 'M')
# DatetimeIndex(['2021-01-31', '2021-02-28', '2021-03-31'], dtype='datetime64[ns]', freq='M')

pd.date_range('2021', '2022', freq = 'Q-FEB')
# DatetimeIndex(['2021-02-28', '2021-05-31', '2021-08-31', '2021-11-30'], dtype='datetime64[ns]', freq='Q-FEB')

pd.date_range('2021', '2024', freq = 'A-DEC')
# DatetimeIndex(['2021-12-31', '2022-12-31', '2023-12-31'], dtype='datetime64[ns]', freq='A-DEC')

复合频率:

pd.date_range('2021/1/1', '2021/2/1', freq = '9D') # 9天

# DatetimeIndex(['2021-01-01', '2021-01-10', '2021-01-19', '2021-01-28'], dtype='datetime64[ns]', freq='9D')
pd.date_range('2021/1/1','2021/1/2', freq = '6h30min') # 6小时30分钟
'''
DatetimeIndex(['2021-01-01 00:00:00', '2021-01-01 06:30:00',
               '2021-01-01 13:00:00', '2021-01-01 19:30:00'],
              dtype='datetime64[ns]', freq='390T')
'''

pd.date_range('2021','2023', freq = '5M') # 每5个月最后一个日历日
'''
DatetimeIndex(['2021-01-31', '2021-06-30', '2021-11-30', '2022-04-30',
               '2022-09-30'],
              dtype='datetime64[ns]', freq='5M')
'''

三、时期Period和时期序列PeriodIndex

1、pd.Period

pd.Period("2021-3")
# 2021-03
# <class 'pandas._period.Period'>

pd.Period("2021", freq = "A-DEC")
# 2021
# <class 'pandas._period.Period'>
pd.Period("2021", freq = "A-DEC") - 2
# 2019

2、pd.PeriodIndex

list()将PeriodIndex转为多个Period。

p = pd.PeriodIndex(["2021-01", "2021-02", "2021-03"], freq = "M")
# PeriodIndex(['2021-01', '2021-02', '2021-03'], dtype='int64', freq='M')
# <class 'pandas.tseries.period.PeriodIndex'>

p[0]
# 2021-01
# <class 'pandas._period.Period'>

list(p)
# [Period('2021-01', 'M'), Period('2021-02', 'M'), Period('2021-03', 'M')]

3、pd.period_range

pd.period_range("1/1/2021", "1/1/2022", freq = "4M")
# PeriodIndex(['2021-01', '2021-05', '2021-09', '2022-01'], dtype='int64', freq='4M')
# <class 'pandas.tseries.period.PeriodIndex'>

pd.period_range("2021-01", periods = 4)
# PeriodIndex(['2021-01-01', '2021-01-02', '2021-01-03', '2021-01-04'], dtype='int64', freq='D')

4、.asfrep() 频率转换

Period与PeriodIndex的频率可以用asfreq转换。

p = pd.period_range("2020", "2023", freq = "A-DEC")
# PeriodIndex(['2020', '2021', '2022', '2023'], dtype='int64', freq='A-DEC')

p.asfreq("M", how = "start") # 简写 how = 's'
# PeriodIndex(['2020-01', '2021-01', '2022-01', '2023-01'], dtype='int64', freq='M')

p.asfreq("D", how = "end") # 简写 how = 'e'
# PeriodIndex(['2020-12-31', '2021-12-31', '2022-12-31', '2023-12-31'], dtype='int64', freq='D')

5、pd.to_period()和pd.to_timestamp() 时间戳和时期之间的转换

d = pd.date_range("2021", periods = 4, freq = "M")
# DatetimeIndex(['2021-01-31', '2021-02-28', '2021-03-31', '2021-04-30'], dtype='datetime64[ns]', freq='M')
d.to_period()
# PeriodIndex(['2021-01', '2021-02', '2021-03', '2021-04'], dtype='int64', freq='M')
# 每月最后一日,转化为每月

p = pd.period_range("2021", periods = 4, freq = "M")
# PeriodIndex(['2021-01', '2021-02', '2021-03', '2021-04'], dtype='int64', freq='M')
p.to_timestamp()
# DatetimeIndex(['2021-01-01', '2021-02-01', '2021-03-01', '2021-04-01'], dtype='datetime64[ns]', freq='MS')
# 每月,转化为每月第一天

四、时间序列

rng = pd.date_range("2021-01", "2021-04", freq = "BM")
ts1 = pd.Series(np.random.rand(len(rng)), index = rng)
'''
2021-01-29    0.266615
2021-02-26    0.946905
2021-03-31    0.924140
Freq: BM, dtype: float64 
'''
# <class 'pandas.core.series.Series'>
ts1.index
# DatetimeIndex(['2021-01-29', '2021-02-26', '2021-03-31'], dtype='datetime64[ns]', freq='BM')

prng = pd.period_range("2021-01", "2021-04", freq = "M")
ts2 = pd.Series(np.random.rand(len(prng)), index = prng)
'''
2021-01    0.405164
2021-02    0.968344
2021-03    0.242727
2021-04    0.613194
Freq: M, dtype: float64
'''
# <class 'pandas.core.series.Series'>
ts2.index
# PeriodIndex(['2021-01', '2021-02', '2021-03', '2021-04'], dtype='int64', freq='M')

1、时间序列的实例方法

1) asfreq 频率转换

改变频率。method指插值模式,None不插值,ffill用之前值填充,bfill用之后值填充。

ts = pd.Series(np.random.rand(4),
              index = pd.date_range("20210101", "20210104"))
'''
2021-01-01    0.672873
2021-01-02    0.295992
2021-01-03    0.256053
2021-01-04    0.426101
Freq: D, dtype: float64
'''
ts.asfreq('12H')
'''
2021-01-01 00:00:00    0.672873
2021-01-01 12:00:00         NaN
2021-01-02 00:00:00    0.295992
2021-01-02 12:00:00         NaN
2021-01-03 00:00:00    0.256053
2021-01-03 12:00:00         NaN
2021-01-04 00:00:00    0.426101
Freq: 12H, dtype: float64
'''
ts.asfreq('8H', method = 'ffill')
'''
2021-01-01 00:00:00    0.672873
2021-01-01 08:00:00    0.672873
2021-01-01 16:00:00    0.672873
2021-01-02 00:00:00    0.295992
2021-01-02 08:00:00    0.295992
2021-01-02 16:00:00    0.295992
2021-01-03 00:00:00    0.256053
2021-01-03 08:00:00    0.256053
2021-01-03 16:00:00    0.256053
2021-01-04 00:00:00    0.426101
Freq: 8H, dtype: float64
'''

2) shift 移位

正数,数值后移;负数,数值前移。

ts = pd.Series(np.random.rand(4),
              index = pd.date_range("20210101", "20210104"))
'''
2021-01-01    0.726666
2021-01-02    0.373497
2021-01-03    0.581532
2021-01-04    0.269216
Freq: D, dtype: float64
'''
ts.shift(-2)
'''
2021-01-01    0.581532
2021-01-02    0.269216
2021-01-03         NaN
2021-01-04         NaN
Freq: D, dtype: float64
'''
ts.shift(1)
'''
2021-01-01         NaN
2021-01-02    0.726666
2021-01-03    0.373497
2021-01-04    0.581532
Freq: D, dtype: float64
'''
# 计算变化百分比,例:该时间戳与上一个时间戳相比,变化百分比
ts/ts.shift(1) - 1
'''
2021-01-01         NaN
2021-01-02   -0.486013
2021-01-03    0.556994
2021-01-04   -0.537058
Freq: D, dtype: float64
'''

加上freq参数,对时间戳索引进行位移,而不是对数值进行位移。

ts.shift(2, freq = "D")
'''
2021-01-03    0.726666
2021-01-04    0.373497
2021-01-05    0.581532
2021-01-06    0.269216
Freq: D, dtype: float64
'''
ts.shift(2, freq = "H")
'''
2021-01-01 02:00:00    0.726666
2021-01-02 02:00:00    0.373497
2021-01-03 02:00:00    0.581532
2021-01-04 02:00:00    0.269216
Freq: D, dtype: float64
'''

2、索引及切片

rng = pd.date_range("2021-01", "2022-01", freq = "M")
ts = pd.Series(np.random.rand(len(rng)), index = rng)

# 下标及切片索引,前闭后开
ts[0] # 0.691734402431
ts[0::3]
'''
2021-01-31    0.691734
2021-04-30    0.477347
2021-07-31    0.906069
2021-10-31    0.561499
Freq: 3M, dtype: float64
'''

# 标签及切片索引,前闭后闭

# 1.支持时间字符串
ts["2021-4-30"] # 0.477346567735
ts.loc["4/30/2021"] # 0.477346567735
ts["20210430"] # 0.477346567735

# 2.支持datetime
ts[datetime(2021, 4, 30)] # 0.477346567735

# 3.切片
ts["2021-02":"2021-06":2]
'''
2021-02-28    0.878228
2021-04-30    0.477347
2021-06-30    0.753716
Freq: 2M, dtype: float64
'''

# 4.为访问较长的时间序列提供了便捷方法,年、年月字符串均可
ts["2021-11"]
'''
2021-11-30    0.777184
Freq: M, dtype: float64
'''
ts["2021"]
'''
2021-01-31    0.691734
2021-02-28    0.878228
2021-03-31    0.973356
2021-04-30    0.477347
2021-05-31    0.735141
2021-06-30    0.753716
2021-07-31    0.906069
2021-08-31    0.496587
2021-09-30    0.127564
2021-10-31    0.561499
2021-11-30    0.777184
2021-12-31    0.589458
Freq: M, dtype: float64
'''

重复索引:

t = pd.DatetimeIndex(['1/1/2021', '1/2/2021', '1/3/2021', '1/4/2021', '1/1/2021', '1/2/2021'])
ts = pd.Series(np.random.rand(len(t)), index = t)
'''
2021-01-01    0.731328
2021-01-02    0.169167
2021-01-03    0.473075
2021-01-04    0.035301
2021-01-01    0.291358
2021-01-02    0.834894
dtype: float64
'''

ts.is_unique # True,values唯一
ts.index.is_unique # False,index不唯一


ts['20210101']
'''
2021-01-01    0.731328
2021-01-01    0.291358
dtype: float64 <class 'pandas.core.series.Series'>
'''
ts['20210104']
'''
2021-01-04    0.035301
dtype: float64 <class 'pandas.core.series.Series'>
'''

ts.groupby(level = 0).mean() # 通过groupby做分组,重复的值用平均值处理
'''
2021-01-01    0.511343
2021-01-02    0.502031
2021-01-03    0.473075
2021-01-04    0.035301
dtype: float64
'''

3、重采样

将时间序列进行频率转换,会有数据的结合或拆分等。
时间戳重采样:

rng = pd.date_range("20210301", periods = 10)
ts = pd.Series(np.random.randint(0, 10, size = len(rng)), index = rng)
'''
2021-03-01    3
2021-03-02    1
2021-03-03    3
2021-03-04    7
2021-03-05    5
2021-03-06    3
2021-03-07    2
2021-03-08    3
2021-03-09    1
2021-03-10    8
Freq: D, dtype: int32
'''

ts.resample('4D')
# DatetimeIndexResampler [freq=<4 * Days>, axis=0, closed=left, label=left, convention=start, base=0]
# <class 'pandas.tseries.resample.DatetimeIndexResampler'>
# 重采样构建器
ts.resample('4D').sum()
'''
2021-03-01    14
2021-03-05    13
2021-03-09     9
Freq: 4D, dtype: int32
'''
# <class 'pandas.core.series.Series'>

时期重采样:

prng = pd.period_range("2021-3-21", "2021-3-24")
pts = pd.Series(np.random.rand(len(prng)), index = prng)
'''
2021-03-21    0.043378
2021-03-22    0.013906
2021-03-23    0.557832
2021-03-24    0.204095
Freq: D, dtype: float64
'''
pts.resample("2D").mean()
'''
2021-03-21    0.028642
2021-03-23    0.380963
Freq: 2D, dtype: float64
'''
pts.resample("12H").ffill()
'''
2021-03-21 00:00:00    0.043378
2021-03-21 12:00:00    0.043378
2021-03-22 00:00:00    0.013906
2021-03-22 12:00:00    0.013906
2021-03-23 00:00:00    0.557832
2021-03-23 12:00:00    0.557832
2021-03-24 00:00:00    0.204095
Freq: 12H, dtype: float64
'''

1) 降采样 / 下采样:降低频率

任何支持dispatch的函数都可用于resample返回对象,包括sum、mean、std、sem、max、min、mid、median、first、last、ohlc。

  • OHLC:金融领域的时间序列聚合方式,open开盘、high最大值、low最小值、close收盘。
ts.resample('4D').sum() # 求和
ts.resample('4D').mean()# 求平均值
'''
2021-03-01    3.50
2021-03-05    3.25
2021-03-09    4.50
Freq: 4D, dtype: float64
'''
ts.resample('4D').max() # 求最大值
ts.resample('4D').min() # 求最小值
'''
2021-03-01    1
2021-03-05    2
2021-03-09    1
Freq: 4D, dtype: int32
'''
ts.resample('4D').median() # 求中值
'''
2021-03-01    3.0
2021-03-05    3.0
2021-03-09    4.5
Freq: 4D, dtype: float64
'''
ts.resample('4D').first() # 返回第一个值
ts.resample('4D').last() # 返回最后一个值
'''
2021-03-01    7
2021-03-05    3
2021-03-09    8
Freq: 4D, dtype: int32
'''
ts.resample('4D').ohlc() # OHLC重采样
'''
            open  high  low  close
2021-03-01     3     7    1      7
2021-03-05     5     5    2      3
2021-03-09     1     8    1      8
'''

label

ts.resample('4D', label = "left").sum() # 默认
'''
2021-03-01    14
2021-03-05    13
2021-03-09     9
Freq: 4D, dtype: int32
'''
ts.resample('4D', label = "right").sum()
'''
2021-03-05    14
2021-03-09    13
2021-03-13     9
Freq: 4D, dtype: int32
'''

closed

ts.resample('4D', closed = "left").sum() # 默认
'''
2021-03-01    14
2021-03-05    13
2021-03-09     9
Freq: 4D, dtype: int32
'''
ts.resample('4D', closed = "right").sum()
'''
2021-02-25     3
2021-03-01    16
2021-03-05     9
2021-03-09     8
Freq: 4D, dtype: int32
'''

2) 升采样 / 上采样:提升频率

提升频率后,如何插值?

  • asfreq():不做填充,返回NaN
  • ffill():用前面的值填充
  • bfill():用后面的值填充
ts.resample('12h').asfreq().head(6)
'''
2021-03-01 00:00:00    3.0
2021-03-01 12:00:00    NaN
2021-03-02 00:00:00    1.0
2021-03-02 12:00:00    NaN
2021-03-03 00:00:00    3.0
2021-03-03 12:00:00    NaN
Freq: 12H, dtype: float64
'''
ts.resample('12h').ffill().head(6)
'''
2021-03-01 00:00:00    3
2021-03-01 12:00:00    3
2021-03-02 00:00:00    1
2021-03-02 12:00:00    1
2021-03-03 00:00:00    3
2021-03-03 12:00:00    3
Freq: 12H, dtype: int32
'''
ts.resample('12h').bfill().head(6)
'''
2021-03-01 00:00:00    3
2021-03-01 12:00:00    1
2021-03-02 00:00:00    1
2021-03-02 12:00:00    3
2021-03-03 00:00:00    3
2021-03-03 12:00:00    7
Freq: 12H, dtype: int32
'''
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值