在列中具有列表的输出DataFrame [英] Output DataFrame with lists in collumns

查看:354
本文介绍了在列中具有列表的输出DataFrame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Azur ML中处理文本,并且正在使用执行Python脚本"模块.一切正常,但是当我标记文本并尝试在collumn单元格中输出带有列表的DataFrame时,出现错误,因为它不受支持.我尝试了很多 使其无法与.astype()方法一起使用的东西,但没有成功.

I process text in Azur ML and I am using the 'Execute Python Script' modules. Everything works fine, but when I tokenize my text and try to output the DataFrame with Lists in the collumn cells, I get an error because it's not supported. I tried a lot of stuff to get it working with .astype() method but without success.

解决方案是将其保存为cvs,然后再次直接打开cvs:

The sollution was to save it as cvs and directly open the cvs again:

new_data.to_csv('new_data.csv')
dataframe1 = pd.read_csv('new_data.csv')

返回dataframe1,

return dataframe1,

这是您将来要添加的东西吗?还是总是必须将csv保存在tmp目录中?

Is this something you will add in the future or do I alway have to save the csv in tmp directory?

干杯
Nils

Cheers
Nils

推荐答案

感谢您在此处的反馈,我将与产品组联系并转发您的建议.不便之处,敬请原谅.

Thanks for your feedback here, I will check with the product group and forward your suggestion as well. Sorry for all inconveniences.

此致

宇通


这篇关于在列中具有列表的输出DataFrame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆