Sam
Sam

Reputation: 404

get the particular values in a one column based on the value in other

I have two columns and I would like to get the values of column shipping_req_key based on one `pick_order'. The dataframe looks like this :

shipping_req_key      pick_order

5029338170            480280603713
5029338145            480280712615
5029338145            480280804414  
5029338145            480280807715  
        

I would like to get the shipping_req_key corresponding to the particular pick_order. I would appreciate your feedback.

Upvotes: 0

Views: 34

Answers (1)

Pawan Jain
Pawan Jain

Reputation: 825

If you want to filter for all pick_orders try this. Assuming you should store the corresponding order id.

pick_list = df.pick_order.unique()

for order in pick_list:
    print(order, df[df['pick_order']==order]['shipping_req_key'].to_list())

For particular

df[df['pick_order']=='480280603713']

Upvotes: 1

Related Questions