Introduction in Python

  • list = array (ruby)

+ slice



del() : remove item from the list.

x = ['a', 'b', 'c']
# ['a', 'c']

= copy by reference

list() , [:] copy by value

import numpy;

import numpy as np; # recommended, it's clearly define what array belong to np

from numpy import array;

np array ស្រដៀងនឹង python list ដែរ

np array ធ្វើការលើធាតុមួយៗរបស់ array,

only contains single type

np[rows, columns]

np[:,1:3] => select both :height and :weight but only 2nd and 3rd members

help() : man

np.random.normal(a, b, c) : េលខ a, គំលាត b, ចំនួន c