- Read in the employee data and set the index equal to the race column:
>>> employee = pd.read_csv('data/employee.csv', index_col='RACE')>>> employee.head()
- Select the BASE_SALARY column as two different Series. Check to see whether this operation actually did create two new objects:
>>> salary1 = employee['BASE_SALARY']>>> salary2 = employee['BASE_SALARY']>>> salary1 is salary2True
- The salary1 and salary2 variables are actually referring to the same object. This means that any change to one will change the other. To ensure that you receive a brand new copy of the data, use the copy method:
>>> salary1 = employee['BASE_SALARY'].copy() ...