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

Coding

Interesting coding problems

The beauty of containers in C++11
Coding

The beauty of containers in C++11

Containers for storing data are one of many great features of the C++ Standard Library. Despite their advantages, to initialize them, and to loop over them was not always easy. Fortunately, the C++11 standard has made life easier, as I will explain below with examples. Disclaimer: this information has

  • Chiel van Heerwaarden
Chiel van Heerwaarden Jun 26, 2017 • 2 min read
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