Chapter 12. Numpy Arrays (learnpython)
Numpy arrays are great alternatives to Python Lists.
Fast, easy to work with, and give users the opportunity to perform calculations across entire arrays.
# Create 2 new lists height and weight
height = [1.87, 1.87, 1.82, 1.91, 1.90, 1.85]
weight = [81.65, 97.52, 95.25, 92.98, 86.18, 88.45]
import numpy as np
# Create 2 numpy arrays from height and weight
np_height = np.array(height)
np_weight = np.array(weight)
Exercise
'IT World > Python' 카테고리의 다른 글
Python Training Day 12. List Comprehensions (0) | 2022.12.25 |
---|---|
Python Training Day 10 & 11. Pandas Basics, Generators (0) | 2022.12.23 |
Python Training Day 8. Modules and Packages (0) | 2022.12.19 |
Python Training Day 7. Dictionaries (0) | 2022.12.18 |
Python Training Day 6. Classes and Objects (0) | 2022.12.17 |
댓글