update
This commit is contained in:
parent
0f280508ae
commit
6610457f8b
@ -104,7 +104,7 @@ class AllTickAPI:
|
|||||||
df = pd.DataFrame(kline_data)
|
df = pd.DataFrame(kline_data)
|
||||||
|
|
||||||
# 转换列类型
|
# 转换列类型
|
||||||
df["timestamp"] = pd.to_datetime(df["timestamp"].astype(int), unit="s")
|
df["timestamp"] = df["timestamp"].astype(int)
|
||||||
df["open"] = df["open_price"].astype(float)
|
df["open"] = df["open_price"].astype(float)
|
||||||
df["high"] = df["high_price"].astype(float)
|
df["high"] = df["high_price"].astype(float)
|
||||||
df["low"] = df["low_price"].astype(float)
|
df["low"] = df["low_price"].astype(float)
|
||||||
@ -112,10 +112,10 @@ class AllTickAPI:
|
|||||||
df["volume"] = df["volume"].astype(float)
|
df["volume"] = df["volume"].astype(float)
|
||||||
|
|
||||||
# 设置索引
|
# 设置索引
|
||||||
df.set_index("timestamp", inplace=True)
|
# df.set_index("timestamp", inplace=True)
|
||||||
|
|
||||||
# 选择需要的列
|
# 选择需要的列
|
||||||
df = df[["open", "high", "low", "close", "volume"]]
|
df = df[["open", "high", "low", "close", "volume","timestamp"]]
|
||||||
|
|
||||||
return df
|
return df
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ services:
|
|||||||
cryptoai-api:
|
cryptoai-api:
|
||||||
build: .
|
build: .
|
||||||
container_name: cryptoai-api
|
container_name: cryptoai-api
|
||||||
image: cryptoai-api:0.1.37
|
image: cryptoai-api:0.1.38
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user