I'm trying to plug the holes on the dataset that I currently have. My N_order is the key for grouping. As you can see in below example, I've null values for the column ship_meth, when the status is 'fulfilled'.
I'd love to create a new desired_column that can retrieve the value from any of the other statuses for that N_order (for example, 'new_order') and paste it on the row with the 'fulfilled' status.
I'm not able to provide a solid example of what I've been trying, as is not working anywhere near what I'd like. Just going to point out that it doesnt work with filldown/up function as i've different statuses on the orders, and different ship_meth.
N_order | ship_meth | status | desired_column |
---|---|---|---|
50010000116187 | ENKM | picked | ENKM |
50010000116187 | ENKM | accepted | ENKM |
50010000116187 | null | fulfilled | ENKM |
50010000116325 | null | fulfilled | ENRC |
50010000116325 | ENRC | accepted | ENRC |
50010000116325 | ENRC | rejected | ENRC |
Appreciate your time and effort.
Suk
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.