Skip to content

Commit

Permalink
Update Annual-Report.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Milvoid authored Dec 23, 2024
1 parent ba94281 commit 21e5886
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Annual-Report.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def load_eat_data(eat_data, time_zone = 8):
entities = data.get("entities", [])
df = pd.DataFrame(entities)

# 取反并乘100取整,修复浮点精度问题
df['amount'] = (df['amount'] * -100).round().astype(int)
df['orderTime'] = df['orderTime'].apply(lambda x: convert_time(x, time_zone))
df['payTime'] = df['payTime'].apply(lambda x: convert_time(x, time_zone))
Expand Down Expand Up @@ -165,4 +166,4 @@ def annual_analysis(df):
input("按回车键退出...")
except Exception:
print("\n发生其他错误")
input("按回车键退出...")
input("按回车键退出...")

0 comments on commit 21e5886

Please sign in to comment.