前言
you must begin at this page: 3. An Informal Introduction to Python — Python 3.5.4rc1 documentation
python is a language, like nature language, built by basic elements. English is built by letters, Python is built by letters, numbers and symbols.
type | letter | number | symbol |
---|---|---|---|
Function | replace/refer to | calculation/index | 处理 |
e.g. | variy/def | +/[] | 1/1/[-1] |
mix them to be a word, then to be sentence, and then a paragraph. a single line of code can translate to a pargraph of natule language.
数字和符号放一起, 是计算
e.g.
|
|
2
|
|
128
字母词 = 数字 是变量
e.g.1
|
|
30
e.g.2
变量赋值任何数字后, 之后继续使用这个变量.1234line_n = 0 limit > 10000lm = Counter() line_n += 1
引号里面有文字, 整个是字符串
e.g.
|
|
hello world
|
|
1
|
|
*
string is like word, same as number , it can be deal with.
‘字母词 后面跟的[ ]表示位置索引 : - ‘ ‘number’
e.g.
|
|
'p'
|
|
'py'
|
|
'n'
|
|
'pyth'
‘字母词做容器( list/counter/dict)时 后面跟的[ ]表示其中的元素( elements)
|
|
The built-in function len() returns the length of a string:
e.g.
|
|
14
s = [ , ] is list
e.g.
|
|
[1, 2, 3, 4]
|
|
1
|
|
3
|
|
[3, 4]
begin programing
|
|
1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,
print ()
- writes the value of the argument(s) it is given.
- multiple arguments, floating point quantities, strings
|
|
the value of i is 65536
xx.xx() is module.function for (content)
数据科学最小工具链
python | numpy | pandas | Matplotlib | machine learning? |
---|---|---|---|---|
list | array | matrix | plot | |
. | . | index,column,column,column | . | |
l=[,,] | a=[[,,] | index,,, | ||
. | [,,]] | index,,, | ||
l | np.xxx | pd.dataframe(np.xxx) | plot.xxx.(pd.dataframe(np.xxx),x,x) | |
NumPy’s Structured Arrays | Pandas df operates like a tructured array | Visualization with Matplotlib |