pandas Wind TypeError: can only concatenate list (not “float“) to list 报错解决
在对dataframe做整列加减运算时:
from ast import AnnAssign
from WindPy import w
import pandas as pd
import numpy as np
w.start() # 默认命令超时时间为120秒,如需设置超时时间可以加入waitTime参数,例如waitTime=60,即设置命令超时时间为60秒
w.isconnected() # 判断WindPy是否已经登录成功
a=w.wsd("SS2203.SHF", "oi,oiamount,volume,amt,st_stock", "ED0D", "2022-01-20", "unit=1")
arr=np.zeros((6,1))
df=pd.DataFrame(arr,columns=[1],index=['品种','持仓量'
,'持仓保证金','成交量','成交额','注册仓单数'])
name=a.Codes[0][0:2].split('2')[0]
df.loc['品种',1]=name
df.loc['
pandas Wind TypeError: can only concatenate list (not “float“) to list 报错解决最先出现在Python成神之路。
共有 0 条评论