Meteo @ WUR
  • Publications
  • SLOCS
  • MicroHH
  • CLASS
  • Thesis
  • About
Subscribe
Tagged

Python

Interesting coding problems in Python

How (not) to copy a NumPy array
Coding

How (not) to copy a NumPy array

The Python code below has puzzled me for a while. It shows the initialization of NumPy array a and three examples of copy assignment stored in b, c, and d. import numpy as np a = np.arange(3,5) #a = [3, 4] b = a c = a[:] d = a.copy() print(

  • Chiel van Heerwaarden
Chiel van Heerwaarden Feb 3, 2017 • 1 min read
Meteo @ WUR © 2022
Powered by Ghost