Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created January 6, 2024 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephengruppetta/6dedf82f25da7e282da06a661cd744bb to your computer and use it in GitHub Desktop.
Save stephengruppetta/6dedf82f25da7e282da06a661cd744bb to your computer and use it in GitHub Desktop.
import numpy as np
from array import array
# Let's create a list first
some_numbers = [1, 2, 3, 5, 8, 13]
# And now we can create the 'ndarray' from this list
some_numbers_np = np.array(some_numbers)
some_numbers_np
# array([ 1, 2, 3, 5, 8, 13])
type(some_numbers_np)
# <class 'numpy.ndarray'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment