본문 바로가기
IT World/Python

Python Training Day 9. Numpy Arrays

by 닷라인웨이 2022. 12. 20.

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

댓글