我是数据科学新手,需要帮助执行以下操作:
region(I) 在我的例子中,根据列中的唯一组和另一个组分割数据集country
(II) 我想将每个数据帧保存为 .csv 文件 - 像这样regionname_country.csv,例如west_GER.csv,east_POL.csv
(III) 如果可能的话,我想迭代每个 .csv 文件以绘制每个 dffor loop 的散点图。education vs age
(IV) 最后将我的绘图/图形保存在 pdf 文件中(每页 4 个图形)
'df'
Region, country, Age, Education, Income, FICO, Target
1 west, GER, 43, 1, 47510, 710, 1
2 east, POL, 32, 2, 73640, 723, 1
3 east, POL, 22, 2, 88525, 610, 0
4 west, GER, 55, 0, 31008, 592, 0
5 north, USA, 19, 0, 18007, 599, 1
6 south, PER, 27, 2, 68850, 690, 0
7 south, BRZ, 56, 3, 71065, 592, 0
8 north, USA, 39, 1, 98004, 729, 1
9 east, JPN, 36, 2, 51361, 692, 0
10 west, ESP, 59, 1, 98643, 729, 1
期望的结果:
# df_to_csv : 'west_GER.csv'
west, GER, 43, 1, 47510, 710, 1
west, GER, 55, 0, 31008, 592, 0
# west_ESP.csv
west, ESP, 59, 1, 98643, 729, 1
# east_POL.csv
east, POL, 32, 2, 73640, 723, 1
.
.
.
# north_USA.csv
north, USA, 39, 1, 98004, 729, 1
north, USA, 19, 0, 18007, 599, 1
呼如林
慕侠2389804
相关分类