Skip to content

Commit c63e110

Browse files
committed
NEW
GJ
1 parent 2340e16 commit c63e110

9 files changed

+77
-0
lines changed
921 KB
Binary file not shown.

第一周/1.1 走近Python.pdf

2.82 MB
Binary file not shown.
Binary file not shown.

第一周/code/chapter1-1.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Sat Feb 9 16:33:46 2019
4+
5+
@author: js
6+
"""
7+
import numpy as np
8+
import matplotlib.pyplot as plt
9+
t = np.arange(0,4,0.1)
10+
plt.plot(t,t,t,t+2,t,t,t**2)

第一周/code/chapter1-2.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Thu Mar 14 02:02:38 2019
4+
5+
@author: js
6+
"""
7+
8+
9+
import numpy as np
10+
from scipy.cluster.vq import vq, kmeans, whiten
11+
list1 = [88.0, 74.0, 96.0, 85.0]
12+
list2 = [92.0, 99.0, 95.0, 94.0]
13+
list3 = [91.0, 87.0, 99.0, 95.0]
14+
list4 = [78.0, 99.0, 97.0, 81.0]
15+
list5 = [88.0, 78.0, 98.0, 84.0]
16+
list6 = [100.0, 95.0, 100.0, 92.0]
17+
data = np.array([list1,list2,list3,list4,list5,list6])
18+
whiten = whiten(data)
19+
centroids,_ = kmeans(whiten, 2)
20+
result,_= vq(whiten, centroids)
21+
print(result)

第一周/code/chapter1-3.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Thu Mar 14 02:04:47 2019
4+
5+
@author: js
6+
"""
7+
# this is a comment
8+
price = input("please enter the price:")
9+
print(type(price)) # this is also a comment
10+
print(price)
11+
pri=eval(price)
12+
print(type(pri))

第一周/code/chapter1.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Created on Sat Feb 9 16:33:46 2019
4+
5+
@author: js
6+
"""
7+
import numpy as np
8+
import matplotlib.pyplot as plt
9+
t = np.arange(0,4,0.1)
10+
plt.plot(t,t,t,t+2,t,t,t**2)

第一周/note-1-1.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Python IDE下载(建议):
2+
3+
Anaconda (支持多种操作系统,集成了主流的科学计算包)
4+
5+
清华大学镜像(推荐,下载Python 3版本):<https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/>
6+
7+
官网: <https://www.continuum.io/downloads>
8+
9+
或PyCharm等其他Python IDE
10+
11+
# Python参考教程和网站
12+
13+
(1) Python编程从入门到实践, Eric Mathes著, 人民邮电出版社
14+
15+
(2) SciPy科学计算生态圈:<https://www.scipy.org/>
16+
17+
(3) Wes McKinney, Python for Data Analysis. 东南大学出版社(英文影印本,中译版名为《利用Python进行数据分析》)

第一周/note-1-2.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
1. macos和linux用python打开python2,python3打开python3
2+
2. pypi是python包的索引,推荐使用官网的.py文件安装
3+
3. IDE Spyder较为方便
4+
4. eval是个有用的函数
5+
5. #注释 /换行 括号内可多行,三引号下可多行
6+
;可需要让多行语句同一行 主意缩进23333333333333333333333
7+
6.

0 commit comments

Comments
 (0)