|
@@ -0,0 +1,33 @@
|
|
|
+
|
|
|
+
|
|
|
+'''
|
|
|
+@Author : liuyuqi
|
|
|
+@Contact : liuyuqi.gov@msn.cn
|
|
|
+@Time : 2020/02/23 20:21:23
|
|
|
+@Version : 1.0
|
|
|
+@License : Copyright © 2017-2020 liuyuqi. All Rights Reserved.
|
|
|
+@Desc :
|
|
|
+'''
|
|
|
+
|
|
|
+import pandas as pd
|
|
|
+import datetime
|
|
|
+
|
|
|
+
|
|
|
+def run():
|
|
|
+
|
|
|
+ df = pd.read_csv("disk_sample_smart_log_test_a.csv")
|
|
|
+ print(df.iloc[[1]])
|
|
|
+ res = df[["manufacturer", "model", "serial_number", "dt"]]
|
|
|
+ res["dt"] = res['dt'].apply(
|
|
|
+ lambda x: datetime.datetime.strptime(str(x), '%Y%m%d'))
|
|
|
+ res["dt"] = res['dt'].apply(lambda x: x + datetime.timedelta(10))
|
|
|
+
|
|
|
+ save(res)
|
|
|
+
|
|
|
+
|
|
|
+def save(df: pd.DataFrame):
|
|
|
+ df.to_csv("result.csv", header=None, encoding="utf8", index=False)
|
|
|
+
|
|
|
+
|
|
|
+if __name__ == "__main__":
|
|
|
+ run()
|