일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
- pandas
- expect
- conda
- FIND
- mysql
- List
- with
- Shader
- boost
- sql
- SSH
- postgresql
- python
- 배열
- awk
- ngui
- Unity
- null
- dataframe
- Eclipse
- autovacuum
- DROP
- ubuntu
- 쉘
- C++
- if
- SVN
- c++11
- sqlite
- pi
- Today
- Total
목록dataframe (12)
その先にあるもの…
DataFrame.droplevel(self, level, axis=0) Return DataFrame with requested index / column level(s) removed. >>> df = pd.DataFrame([ ... [1, 2, 3, 4], ... [5, 6, 7, 8], ... [9, 10, 11, 12] ... ]).set_index([0, 1]).rename_axis(['a', 'b']) >>> df.columns = pd.MultiIndex.from_tuples([ ... ('c', 'e'), ('d', 'f') ... ], names=['level_1', 'level_2']) level_1 c d level_2 e f a b 1 2 3 4 5 6 7 8 9 10 11 12..
dataframe.merge( table1, table2 ) - inner join dataframe.merge( table1, table2, how='outer' ) - outer join1(키 값이 한쪽에만 있어도 데이터를 보여준다) dataframe.merge( table1, table2, how='left' ) dataframe.merge( table1, table2, how='right' ) dataframe.merge( table1, table2, on='column' ) //기준열의 이름이 두 테이블에서 다르다면 기준열을 명시한다. dataframe.merge( table1, table2, left_on='column', right_on='column' ) //데이터 열이 아닌 인덱스를 기준..
주식이 불고 있는 2020년 naver에서 재무재표를 스크롤링 해서 정보를 얻오 올까 했다가 뭔가 아닌것 같다는 생각에 접어두고 있었는데 동장군님 블로그에서 DART API를 이용하여 재무재표를 얻어오는 것을 보고 이마를 탁! 사용 언어는 PYTHON 3.6 opendart.fss.or.kr/ 에 가서 api key를 신청하자~. 가입하고 신청하면 바로 키가 나온다. dart api를 사용하기 편하게 파이썬 라이브러리로 만들어 주신분이 계신다. pypi.org/project/dart-fss/ dart-fss Web-scraping http://dart.fss.or.kr pypi.org 라이브러리를 설치 import dart_fss as dart # Open DART API KEY 설정 api_key='x..
dataframe을 출력할 때 행이나 열이 많으면 ... 으로 생략되는데 출력을 조정하는 옵션이 있다. import pandas as pd pd.set_option('display.max_row', 500) pd.set_option('display.max_columns', 100) pandas.pydata.org/pandas-docs/version/0.23/generated/pandas.set_option.html
col1 col2 col3 col4 col5 0 1 2 3 4 5 1 1 2 3 4 5 2 1 2 4 5 6 3 7 8 9 10 11 4 12 13 14 15 16 del df['col1'] col2 col3 col4 col5 0 2 3 4 5 1 2 3 4 5 2 2 4 5 6 3 8 9 10 11 4 13 14 15 16 df.drop( ['col2', 'col3'], axis = 1('columns'), inplace=True ) col4 col5 0 4 5 1 4 5 2 5 6 3 10 11 4 15 16 df.drop( df.columns[ [1,3] ], axis = 'columns', inplace=True ) col1 col3 col5 0 1 3 5 1 1 3 5 2 1 4 6 3 7 9 ..
df = [[1 ,2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 4, 5, 6], [7, 8, 9, 10, 11], [12, 13, 14, 15, 16]] #중복된 행 확인 ( 동일한 데이터 체크 ) data.duplicated() 0 False 1 True 2 False 3 False 4 False dtype: bool #특정 열을 선택하여 중복된 행 확인 data.duplicated( ['col1', 'col2'] ) 0 False 1 True 2 True 3 False 4 False dtype: bool #중복된 행만 출력 data[data.duplicated()] col1 col2 col3 col4 col5 1 1 2 3 4 5 #중복된 행은 하나만 남기고 제거하기 data.d..