with open('表示.txt','a',encoding='utf-8') as f:
with open('a-0.txt','r',encoding='utf-8')as f0:
a=eval(f0.read())
out={}
for keys in a.keys():
s = 0.0
for word in a[keys].keys():
try:
k,f=search(word)
except KeyError:continue
for kk in k:
s+=kk*a[keys][word]
try:
s =s.tolist()
except:continue
print(type(s))
print(str(out))
f.write(str(s))
python报错 AttributeError: 'numpy.ndarray' object has no attribute 'write'
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-