Introduction in Python

  • list = array (ruby)

+ slice

[start:end]

<inclusive:exclusive>


del() : remove item from the list.

x = ['a', 'b', 'c']
del(x[1])
# ['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

np.column_stack