Files
v2realbot/testy/numpylistmutability.py
David Brazda dc4c10a4a3 other changes
2023-11-15 09:02:15 +01:00

14 lines
298 B
Python

import numpy as np
from array import array
# Original list
puvodni = array('i', [1, 2, 3, 4])
# Create a NumPy array using the original list
numpied = np.array(puvodni)
# Now, if puvodni changes, numpied will be updated as well
puvodni.append(5)
# Check the updated numpied array
print(numpied)