BDP Week3
BDP Week3
week 3
TA: Changhee Cho
[email protected]
Overview
• numpy array
• matplotlib.pyplot
• read/write files
What is numpy?
• numpy (Numerical Python) is a popular library for scientific
computing
2. Repeat 1 for 2000 times. You will get 2000 standard deviations.
what is the mean value of 2000 standard deviations?
hint: use for loop, and save the data in additional array or list
line plot
plt.plot(x,y) good when x data is sequential
(2d data)
good when we want to see correlation or trend
scatter plot
plt.scatter(x,y,(s),(c)) between 2 variables
(2d, 3d, 4d)
or want to draw 3d, 4d plot (spatial 2d+a)
bar plot
plt.bar(x,height) good when x data is categorical
(2d data)
histogram
plt.hist(x,(bins)) when we want to see the distribution of data
(1d data)
2) Upload
1) Files
Loading files in colab (2)
1) Files
Loading files in colab (2)
2) Go to drive/MyDrive/ …
1) Files
3) Copy path
savetxt, loadtxt
Practice 2
1
1. plot 𝑦 = in range x=[0,10)
1+𝑒 −𝑥
1 𝜋2
2. Check ∞
σ𝑖=1 2 =
𝑖 6
hint: use arange, sum