# python pandas 满足一定条件设置另一个值

By [KeepLearning](https://paragraph.com/@keeplearning-2) · 2023-12-29

---

df.loc\[(df.candle\_begin\_time == timetime) & (df.symbol == 'ETHUSDT'), '因子'\] = 2

---

*Originally published on [KeepLearning](https://paragraph.com/@keeplearning-2/python-pandas)*
