Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一个具有相同 K 和 i 的“设置”列的值的新 df。1-1, 2-2, 3-3,4-4..
K i Settings 0 1 1 234 1 1 2 12423 2 1 3 234234 3 2 1 2231 4 2 2 1123 5 3 2 23 6 3 3 3 7 4 1 17
我需要值 234、1123、3、..
你可以试试
df[df['K'] == df['i']]['Settings']
或更短
df[df.K == df.i].Settings
你的数据框在哪里df。
df