m0_61104322
2022-04-24 06:03
采纳率: 88.2%
浏览 34

如何把dataframe里的表格读取成csv文件


import pandas as pd
train_df = pd.DataFrame(train_samples)
train_df.head(14)

target    text    line_number    total_lines
0    OBJECTIVE    to investigate the efficacy of @ weeks of dail...    0    11
1    METHODS    a total of @ patients with primary knee oa wer...    1    11
2    METHODS    outcome measures included pain reduction and i...    2    11
3    METHODS    pain was assessed using the visual analog pain...    3    11
4    METHODS    secondary outcome measures included the wester...    4    11
5    METHODS    serum levels of interleukin @ ( il-@ ) , il-@ ...    5    11
6    RESULTS    there was a clinically relevant reduction in t...    6    11
7    RESULTS    the mean difference between treatment arms ( @...    7    11
8    RESULTS    further , there was a clinically relevant redu...    8    11
9    RESULTS    these differences remained significant at @ we...    9    11
10    RESULTS    the outcome measures in rheumatology clinical ...    10    11
11    CONCLUSIONS    low-dose oral prednisolone had both a short-te...    11    11
12    BACKGROUND    emotional eating is associated with overeating...    0    10
13    BACKGROUND    yet , empirical evidence for individual ( trai...    1    10


用dataframe打开以后,是以下这样的表格,想提取为csv文件,用了一些dataframe转csv的代码,出现了错误:


TypeError: argument of type 'method' is not iterable

请教大家该如何解决?

4条回答 默认 最新

相关推荐 更多相似问题