Session Ready
Exercise

NumPy arrays

Vectors and matrices are not available in core Python. In order to use them, you will have to import the NumPy library. Just as how you used dot notation to access methods of an object, you can use the dot notation to access functions from a library. Recall that you can import a library using an alias. For example, to import package as pk, you can use:

import package as pk

Within the numpy library, you can use the loadtxt() function to import files. For example, you can load a file named data.csv using numpy with numpy.loadtxt('data.csv'). The loadtxt() function has a delimiter parameter which lets you specify that your data is separated by commas.

Instructions 1/4
undefined XP
  • 1
  • 2
  • 3
  • 4

Import numpy using the np alias.