this is a rather similar question to this question but with one key difference: I\'m selecting the data I want to change not by its index but by some criteria.
If th
Old question, but I'm surprised nobody mentioned numpy's .where()
functionality (which can be called directly from the pandas module).
In this case the code would be:
d.sales = pd.np.where(d.sales == 24, 100, d.sales)
To my knowledge, this is one of the fastest ways to conditionally change data across a series.