일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- index
- GitHub
- E-P1
- dataframe
- Python
- mariadb
- Lotto
- javascript
- Numpy
- mean
- Splunk
- Button
- 삼성소프트웨어멤버십
- SciPy
- DFS
- ipad
- GT-S80
- Series
- keras
- CNN
- pandas
- synology
- pip
- LSTM
- RNN
- 알고리즘
- imread
- SPL
- pycharm
- install
- Today
- Total
목록Python (25)
잠토의 잠망경
http://jakevdp.github.io/blog/2013/12/19/a-d3-viewer-for-matplotlib/ A D3 Viewer for Matplotlib Visualizations | Pythonic Perambulations Conclusion¶ As I mentioned above, there is still a lot to be done to make this a truly useful tool for data exploration: right now, the list of usupported features alone likely dwarfs the size of the current code base! But as a proof-of-concept, I think th jake..
https://github.com/yiwonjae/Project_Book_012/blob/master/sample/sample001.py 불러오는 중입니다... 사전 준비 ① instant-client download ② cx-oracle download [사전 준비] instant-client download https://www.oracle.com/database/technologies/instant-client/downloads.html Oracle Instant Client Downloads No results found Your search did not match any results. We suggest you try the following to help find what you're lo..
np.power() import numpy as np x1 = range(6) print(np.power(x1,3)) #[0,1,8,27,64,125] x2 = [1.0, 2.0, 3.0, 3.0, 2.0,1.0] print(np.power(x1,x2)) #[0., 1., 8., 27., 16., 5] 제곱, a^b
기본 형태 (참인 경우) if(조건) else (거짓인 경우) a=10 b=11 result = (a+b) if(a==b) else (a-b) # result =-1 print(result) # -1
Groupby 사용 하기 csv에서 col1을 기준으로 col3의 평균을 구하자 df.groupby(대상) col1,col2,col3,col4 1,2,1,4 1,1,2,3 1,1,3,4 2,0,4,3 2,2,5,4 3,1,6,3 3,2,7,4 import pandas as pd df = pd.read_csv('input.csv') print(df.groupby('col1')['col3'].mean()) 출력 col1 1 2.0 2 4.5 3 6.5 Name: col3, dtype: float64구조 설명 groupby: DataFrame 1개열 : Series groupbyed = df.groupby('col1') print(type(groupby..
iloc 속성 활용 Data 순서를 의미하는 행 번호를 활용 -1 은 마지막 행을 의미한다. 존재하지 않는 행 번호는 오류 발생함 loc DataFrame의 Index를 활용함 df.iloc[1] df.iloc[99] df.iloc[-1] #미지막 행 데이터를 추출 print(type(df.iloc[-1])) #Series 여러행 추출하기 list의 형태를 통하여 얻을 수 있음 print(df.iloc[[0,0,99]]) # list를 넘겨준다.
index 개념 DataFrame에는 2가지 index 개념이 존재한다. loc, iloc이다. 속성 설명 loc index 기준 iloc 행 번호 기준 index 형태: 숫자, 문자 특징: 추가, 삭제, 변경 가능 행번호 형태: 숫자 loc 활용 인덱스를 전달, Row Data 추출, Series import pandas as pd df = pd.read_csv('mushrooms.csv') print(df.loc[2]) print(df.loc[99]) print(df.loc[-1]) # error 인덱스가 존재하지 않는 영역에 접근했기때문이다. 결과는 다음과 같다 마지막 row를 추출하는 2가지 방법 1. shape 이용 Type: Series number_of_row = df.shap..
한 열 단위 데이터 추출 Series : 1개 열 DataFrame : 2개 열 이상 열단위 Data 얻기 import pandas as pd df = pd.read_csv('input.csv',sep=',') column_df = df['country'] print(type(colum_df)) # Series print(column_df.head()) # 5줄 print(column_df.tail()) # 하위 5줄 2열 이상 데이터 추출 columns_df = df[['country', 'continent', 'year']] # List 전달 print(type(columns_df)) # DataFrame print..