Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Saving and loading NumPy arrays is easy! 💾
Play lesson

NumPy tutorial for beginners 🔢 - Saving and loading NumPy arrays is easy! 💾

5.0 (0)
5 learners

What you'll learn

This course includes

  • 1.3 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

#python #coding #numpy 00:00:00 save NumPy array 00:01:53 load NumPy array 00:02:30 save multiple arrays 00:04:29 savez_compressed() 00:05:01 load multiple arrays import numpy as np # -------------------------------------------- # Save a NumPy array # -------------------------------------------- array = np.array([[1, 2, 3], [4, 5, 6]]) np.save("data", array) print("File saved!") # -------------------------------------------- # Load a single NumPy array # -------------------------------------------- array = np.load("data.npy") print(array) # -------------------------------------------- # Save multiple NumPy arrays # -------------------------------------------- array1 = np.array([[1, 2, 3], [4, 5, 6]]) array2 = np.array([2022, 2023, 2024, 2025]) array3 = np.array([1.1, 2.2, 3.3, 4.4, 5.5]) np.savez("data", array1, array2, array3) print("NumPy data was saved!") # -------------------------------------------- # Load multiple NumPy arrays # -------------------------------------------- arrays = np.load("data.npz") print(arrays["arr_0"]) print(arrays["arr_1"]) print(arrays["arr_2"])

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere