我正在尝试读取我的数据集并将其转换为numpy。我发现此错误如何解决。我试图更改数据的属性,但存在相同的问题
def df_to_npy(df, left_context=5, right_context=5):
print 'Converting DataFrame to Numpy...'
cntlab = 0
cntfeat = 0
for idx, row in df.iterrows():
cntlab += row['labs'].shape[0]
cntfeat += row['feats'].shape[0]
if cntfeat == cntlab:
cnt = cntfeat
AttributeError:“浮动”对象没有属性“ shape”