题解 | #统一最后刷题日期的格式#
统一最后刷题日期的格式
https://www.nowcoder.com/practice/348b2f28a75f4ef2ac86db771c2563d3
import pandas as pd # 从 CSV 文件中读取数据并设置索引 df = pd.read_csv("Nowcoder.csv",dtype=object) # 替换 Last_submission_time 列中的前两个斜杠 df["Last_submission_time"] = df["Last_submission_time"].str.replace("/","-",n=2) print(df[["Nowcoder_ID", "Level", "Last_submission_time"]])
字符串替换