ich hab folgendes Problem. Hier ist noch alles in Ordnung:
Code: Alles auswählen
def test(oink):
blub = oink
blub = 8
return blub
oink = 2
flup = test(oink)
print oink
print flup
>>> Ausgabe
2
8
Code: Alles auswählen
from numpy import array, ones
def arraytest(matrix1):
matrix2 = matrix1
matrix2[:,0] = 20
return matrix2
test_matrix = ones([4,2])
erg_matrix = arraytest(test_matrix)
print test_matrix
print erg_matrix
>>Ausgabe
[[ 20. 1.]
[ 20. 1.]
[ 20. 1.]
[ 20. 1.]]
[[ 20. 1.]
[ 20. 1.]
[ 20. 1.]
[ 20. 1.]]