我有一个向量是:
Gender bravo charlie
1 M 1.45811622227195 -0.647499970684844
2 F -0.254538222090381 -0.239702952615991
3 M 0.754671518799496 0.636660794586513
4 M 0.867227804662325 -0.107523939903046
5 F 0.726354342589917 0.398665397744101
6 M -1.2904135038184 0.483559717259751
7 F -0.0982799006827993 -0.900361808856964
8 M -1.36889826752091 -1.31789772901583
9 M -0.941069689516976 -0.119062225146744
10 F -0.224327632607696 -1.3353714767836
(1)想写一个区分M和F的函数。就像我运行它之后,我只得到
Gender bravo charlie
1 M 1.45811622227195 -0.647499970684844
2 M 0.754671518799496 0.636660794586513
3 M 0.867227804662325 -0.107523939903046
...
(2) 想写一个类似的函数,但这次我只想要包含charlie >= 0
.
请帮忙。