[英]How to read time column in pandas and how to convert it into milliseconds
df=pd.read_excel("XYZ.xlsb",engine='pyxlsb',dtype={Time'})
Output
0.2083333333333333333332
I want read this time exactly as in excel.and want to convert into milliseconds,as i want to use time to calculate time difference in percentage for further working我想读这个时间和 excel 完全一样。我想转换成毫秒,因为我想用时间来计算百分比的时间差以便进一步工作
try dividing the microsecond of the datetime by 1000尝试将日期时间的微秒除以 1000
def get_milliseconds(dt):
return dt.microsecond / 1000
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.