问题遇到的现象和发生背景
如何将这种转化为秒wow
流下无知的泪水
问题相关代码,请勿粘贴截图
尝试用过替换。。也不好弄
尝试用过替换。。也不好弄
使用pandas读取表格并用正则匹配计算即可,处理代码如下:
import pandas as pd
import re
df=pd.read_csv('tcsv2.csv',header=None,sep='\n')
df=df[df[0]!='Disabled'].reset_index(drop=True)
df[0] = df[0].apply(lambda x: int(re.findall('\d+', x)[0])*3600+int(re.findall('\d+', x)[1])*60)
print(df)
运行结果:
F:\2021\qa\ot2>t9
0
0 43200
1 43200
2 60
3 7200
如果解答对你有帮助,请点击采纳该答案按钮~~