Python pandas,我想在我的产品表中按产品名称和供应商进行过滤,然后根据该过滤器更改价格

问题描述 投票:0回答:0

我是 pandas-python 的新用户,

我想按照sku名称列出来,并相应地处理新列。

比如sku名称以BA开头的,在瓶价栏上做如下操作(bottlePrice1.30),如果是BF开头的,则做以下操作(bottlePrice1.10)

我尝试了一些东西但不能。

提前致谢。

enter image description here

x["bottlePrice"]=x["kdvDahilFiyat"].apply(lambda x: x*3)

#x["NewColumn"]=x[x["SKU"].str.startswith('BA')].apply(lambda x:x*1.20)
python pandas filter
© www.soinside.com 2019 - 2024. All rights reserved.