我有一个字典,其中有8列,我需要写到CSV,它的工作非常完美,但我只想我的字典的特定列转换成CSV。怎么做
{'data': [{'channel_id': 'UCqTFe5Dz3mpixUrLfMmY6dw', 'title': 'Manoyek', 'channel_img': 'https://yt3.ggpht.com/a-/AN66SAx-JBOt1_NI6nXTBL2R95kDBaR6Spy9i4_q-g=s240-mo-c-c0xffffffff-rj-k-no', 'desc': 'Jestem Adrian' , 'subscriberCount_gained': 587372, 'subscriberCount_lost': 0}]}
from pandas import DataFrame
data = DataFrame.from_dict(diction)
print(data)
data_to_write = data[["channel_id", "channel_img", "desc"]]
使用熊猫!你知道吗
相关问题 更多 >
编程相关推荐