user_id r_score f_score m_score
0 1 5 1 1
1 2 2 1 1
2 5 4 1 1
3 7 2 1 1
4 9 2 1 1
user_id r_score f_score m_score r_height r_height f_height m_height 0 1 5 1 1 高 低 低 1 2 2 1 1 高 低 低 2 5 4 1 1 高 低 低 3 7 2 1 1 低 低 低 4 9 2 1 1 低 低 低
1
Yvette 2018-11-11 18:03:44 +08:00 via iPad
import pandas as pd
pf = pd.DataFrame([[1, 2], [5, 3]]) pf["height"] = pf.iloc[:, 0] > pd.iloc[:, 1] print(pf) |