일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- tensorflow
- html
- discrete_scatter
- 대이터
- CES 2O21 참여
- 재귀함수
- pycharm
- inorder
- web 개발
- web
- Keras
- 결합전문기관
- C언어
- classification
- CES 2O21 참가
- java역사
- web 용어
- bccard
- 자료구조
- 데이터전문기관
- web 사진
- postorder
- KNeighborsClassifier
- 머신러닝
- broscoding
- mglearn
- vscode
- 웹 용어
- cudnn
- paragraph
- Today
- Total
목록[IT] (431)
bro's coding
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/clYOVa/btqC4tYV8Uk/9kdcbp4EJMnuSKnzQ4SyBk/img.png)
import matplotlib.pyplot as plt img=plt.imread('제목 없음.png') plt.imshow(img.mean(axis=2),cmap='gray',vmin=0,vmax=1) plt.colorbar()
a = np.ones([4,3]) a ''' array([[1., 1., 1.], [1., 1., 1.], [1., 1., 1.], [1., 1., 1.]]) ''' a+[1,2,3] ''' [2,3,4] [2,3,4] [2,3,4] [2,3,4] ''' https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html Broadcasting — NumPy v1.17 Manual Broadcasting Note See this article for illustrations of broadcasting concepts. The term broadcasting describes how numpy treats arrays with different shapes d..
a = np.arange(12).reshape(4,3) a ''' array([[ 0, 1, 2], [ 3, 4, 5], [ 6, 7, 8], [ 9, 10, 11]]) ''' 1/a ''' array([[ inf, 1. , 0.5 ], [0.33333333, 0.25 , 0.2 ], [0.16666667, 0.14285714, 0.125 ], [0.11111111, 0.1 , 0.09090909]]) '''
import numpy as np a = np.array([1,2,3,4,5]) a+1 [2,3,4,5,6] a*4 [4,8,12,16,20]
import numpy as np iris_labels = ['Iris-setosa', 'Iris-versicolor', 'Iris-virginica'] iris = np.loadtxt('iris.csv', skiprows=1, delimiter=',', converters={4: lambda s: iris_labels.index(s.decode())}) # iris = np.loadtxt('iris.csv', skiprows=1, delimiter=',', # converters={4: lambda s: labels.index(s)}, encoding='utf-8') # latin1, ascii, utf-8, cp949
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/WK3oK/btqCX9Ns6hA/AVE54iv8MJ2qEtxRr9DOC1/img.png)
plt.subplot(2,2,1) plt.title('SepalLength') plt.hist(iris[:,0],bins=30) plt.subplot(2,2,2) plt.title('SepalWidth') plt.hist(iris[:,1], bins=30) plt.subplot(2,2,3) plt.title('PetalLength') plt.hist(iris[:,2],bins=30) plt.subplot(2,2,4) plt.title('PetalWidth') plt.hist(iris[:,3],bins=30)
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cfPWPV/btqCWcjUoHR/echIobuykPZtnk6SubZS6K/img.png)
plt.plot(iris[:50,:4].T,'r-',alpha=0.1) plt.plot(iris[50:100,:4].T,'g-',alpha=0.1) plt.plot(iris[100:150,:4].T,'b-',alpha=0.1) pass plt.plot(iris) plt.legend(iris_pd.columns)
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/3Oq1M/btqCWb6hNrI/A4NfkK9xVqncZzKKULkZe0/img.png)
import matplotlib.pyplot as plt plt.scatter(iris[:,2],iris[:,3],c=iris[:,4],s=iris[:,1]+100,alpha=0.2) #우측에 bar표시 plt.colorbar() plt.title('SepalLength Vs SepalWidth') plt.xlabel('SepalLength') plt.ylabel('SepalWidth')