Spaces:
Sleeping
Sleeping
Commit ·
3dbc374
1
Parent(s): fe14e96
fix : label error
Browse files
app.py
CHANGED
|
@@ -60,7 +60,8 @@ async def cryptohistory():
|
|
| 60 |
df.columns = df.columns.str.lower()
|
| 61 |
|
| 62 |
# 轉換日期格式
|
| 63 |
-
df["date"] = pd.to_datetime(df["date"]).dt.strftime("%Y-%m-%d")
|
|
|
|
| 64 |
|
| 65 |
# 建立回傳資料
|
| 66 |
results = []
|
|
@@ -68,7 +69,7 @@ async def cryptohistory():
|
|
| 68 |
results.append({
|
| 69 |
"id": idx + 1,
|
| 70 |
"date": row["date"],
|
| 71 |
-
"price": float(row["
|
| 72 |
"volume": float(row["volume"])
|
| 73 |
})
|
| 74 |
|
|
|
|
| 60 |
df.columns = df.columns.str.lower()
|
| 61 |
|
| 62 |
# 轉換日期格式
|
| 63 |
+
#df["date"] = pd.to_datetime(df["date"]).dt.strftime("%Y-%m-%d")
|
| 64 |
+
df["date"] = df["date"].astype(str)
|
| 65 |
|
| 66 |
# 建立回傳資料
|
| 67 |
results = []
|
|
|
|
| 69 |
results.append({
|
| 70 |
"id": idx + 1,
|
| 71 |
"date": row["date"],
|
| 72 |
+
"price": float(row["close"]),
|
| 73 |
"volume": float(row["volume"])
|
| 74 |
})
|
| 75 |
|