Q:

Python - Original data matrix gets modified after for i, v in enumerate(): statement

Please see the code snippet below:
import numpy as np

# Load the .txt file in
myData = np.loadtxt('data.txt')

# Extract the time and acceleration columns
time = myData[:,0]

# Extract the linear acceleration columns
xLinearAcc = myData[:,4]
yLinearAcc = myData[:,5]
zLinearAcc = myData[:,6]

# Find the linear accelerations
xLinearAccSqr = myData[:,0]
for i, v in enumerate(xLinearAcc):
    xLinearAccSqr[i] = pow(v,2)

myData is my 2D data matrix.  What I am trying to do is to extract the 4th column into an new array xLinearAcc.  Then I square every single term in xLinearAcc and store them into another new array xLinearAccSqr.  
(The reason why I have xLinearAccSqr = myData[:,0] is that if I do not have that line, the compiler always tells me that my  xLinearAccSqr is undefined.  So I just randomly make it equal to the 1st column, because anyway later all the values get overwritten.  Dunno whether this line causes trouble or not)
Then comes the problem. 
The first column of myData gets strangely modified.  I do not want this. 
Anyone can help?? 
I will really appreciate the help!!~~
==========================UPDATES=======================================
Problem solved. 
Post the solution here may help others. 
Use
xLinearAccSqr = copy(myData[:,0])

Some how I guess Python passes the references instead of the values. 
Thus, just make a copy then. 

A:

NumPy arrays behave differently from regular Python lists.  In NumPy, basic slicing returns a view on the original array.  That's why your original array gets modified when you modify the slice. 
Create a new array using any of the array creation routines.