Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

> 建议所有接口中时间的.astype(str)去掉 #4795

Closed
liyqxtu opened this issue Apr 26, 2024 · 0 comments
Closed

> 建议所有接口中时间的.astype(str)去掉 #4795

liyqxtu opened this issue Apr 26, 2024 · 0 comments

Comments

@liyqxtu
Copy link

liyqxtu commented Apr 26, 2024

          > 建议所有接口中的 temp_df["时间"] = pd.to_datetime(temp_df["时间"]).astype(str) 改为 temp_df["时间"] = pd.to_datetime(temp_df["时间"])

astype 主要是为了考虑兼容性

Originally posted by @albertandking in #4792 (comment)
理由是用户通过接口拿到时间后,如果是个字符串的话,无法实现时间的比较之类的,还是需要将其转为datetime,而且通过测试可知,这个转换还是相当耗时的呀

@liyqxtu liyqxtu changed the title > 建议所有接口中的 temp_df["时间"] = pd.to_datetime(temp_df["时间"]).astype(str) 改为 temp_df["时间"] = pd.to_datetime(temp_df["时间"]) > 建议所有接口中时间的.astype(str)去掉 Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants