Access and Modify DataFrames Values
Let's find out how to access and modify pandas DataFrame values.
We'll cover the following...
We'll cover the following...
Try it yourself
Try executing the code below to see the result.
Press + to interact
Python 3.8
import pandas as pddf = pd.DataFrame([['Bugs', True, 72.3],['Daffy', False, 30.7],['Tweety', True, 23.5],['Elmer', False, 103.9],], columns=['Customer', 'Member', 'Amount'])df[df['Member']]['Amount'] *= 0.9print(df)
Explanation
The change is not reflected in df
. The reason is ...