Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/347.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python-熊猫-如何创建增量为0.01秒的日期时间序列?_Python_Pandas - Fatal编程技术网

Python-熊猫-如何创建增量为0.01秒的日期时间序列?

Python-熊猫-如何创建增量为0.01秒的日期时间序列?,python,pandas,Python,Pandas,我正在尝试使用熊猫创建一个0.01秒递增的日期范围 例如,我有以下信息 date = 2017/01/01 start_hour = 0 start_minute = 0 start_second = 0.006392 dt = 0.01 我试过使用 date = pd.date_range('1/1/2011 00:00:00.006392', periods=5, freq='s') 结果是 2011-01-01 00:00:00.006392 2011-01-01 00:0

我正在尝试使用熊猫创建一个0.01秒递增的日期范围

例如,我有以下信息

date = 2017/01/01
start_hour = 0
start_minute = 0
start_second = 0.006392
dt = 0.01
我试过使用

date = pd.date_range('1/1/2011 00:00:00.006392', periods=5, freq='s')
结果是

   2011-01-01 00:00:00.006392
   2011-01-01 00:00:01.006392
   2011-01-01 00:00:02.006392
   2011-01-01 00:00:03.006392
   2011-01-01 00:00:04.006392
从上面的示例可以看出,时间增量为1秒。 我想将时间增量更改为0.01秒

请帮忙


谢谢你

你可以用毫秒作为单位,所以0.01秒是10毫秒,或10L/10ms;有关详细信息,请参见:

import pandas as pd

# use L
pd.date_range('1/1/2011 00:00:00.006392', periods=5, freq='10L')
# DatetimeIndex(['2011-01-01 00:00:00.006392', '2011-01-01 00:00:00.016392',
#                '2011-01-01 00:00:00.026392', '2011-01-01 00:00:00.036392',
#                '2011-01-01 00:00:00.046392'],
#               dtype='datetime64[ns]', freq='10L')

# use ms
pd.date_range('1/1/2011 00:00:00.006392', periods=5, freq='10ms')
# DatetimeIndex(['2011-01-01 00:00:00.006392', '2011-01-01 00:00:00.016392',
#                '2011-01-01 00:00:00.026392', '2011-01-01 00:00:00.036392',
#                '2011-01-01 00:00:00.046392'],
#               dtype='datetime64[ns]', freq='10L')