当前时间减去30天
import pandas as pd
from datetime import timedelta
min_datetime = pd.to_datetime('2020-07-11')
str_time = (min_datetime + timedelta(days=-30)).strftime("%Y-%m-%d")
print(str_time)
>>>
2020-06-11
当前时间减去30天
import pandas as pd
from datetime import timedelta
min_datetime = pd.to_datetime('2020-07-11')
str_time = (min_datetime + timedelta(days=-30)).strftime("%Y-%m-%d")
print(str_time)
>>>
2020-06-11
本文标题:pandas时间减法
本文链接:https://www.haomeiwen.com/subject/istphktx.html
网友评论