In some instances, you'll want to see the effect that your changes have on the DataFrame. For example, you might want to verify that you are dropping the right columns from your DataFrame before actually dropping them, or that the values you're updating are correct. In this recipe, you'll learn to ensure that the changes to your DataFrame stick, or don't.
Import Pandas, and create a new DataFrame to work with:
import pandas as pd import numpy as np lc = pd.DataFrame({ 'people' : ["cole o'brien", "lise heidenreich", "zilpha skiles", "damion wisozk"], 'age' : [24, 35, 46, 57], 'ssn': ['6439', '689 24 9939', '306-05-2792', '992245832'], 'birth_date': ['2/15/54', '05/07/1958', '19XX-10-23', '01/26/0056'], 'customer_loyalty_level' : ['not at all', 'moderate', 'moderate', 'highly loyal']})