일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 오늘도코드잇
- 메소드
- 코드잇
- CSS
- 윈도우함수
- 판다스
- numpy
- 머신러닝
- 로지스틱회귀
- 코딩독학
- matplotlib
- 다항회귀
- 코딩공부
- sql연습문제
- 경사하강법
- for반복문
- 행렬
- 결정트리
- 나혼자코딩
- SQL
- 코딩
- Seaborn
- 코드잇 TIL
- 파이썬
- 데이터분석
- 선형회귀
- HTML
- pandas
- 코드잇TIL
- 서브쿼리
- Today
- Total
목록2024/05/17 (3)
Coding Diary.
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/cMCWwC/btsHsrnOPMm/zVqjbBIFk0uz2exWcOuBC1/img.png)
1. 문제1) total_amt_usd 판매액이 가장 많은 각 region에서 sales_rep의 name을 제공하십시오.sales_rep과 관련된 total_amt_usd 총계, region 나타내기SELECT s.name rep_name, r.name region_name, SUM(o.total_amt_usd) total_amtFROM sales_reps sJOIN accounts aON a.sales_rep_id = s.idJOIN orders oON o.account_id = a.idJOIN region rON r.id = s.region_idGROUP BY 1,2ORDER BY 3 DESC; 각 region에 대한 total_amt_usd 가져오기SELECT region_name, MAX(tot..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bCpmYn/btsHsYrTV5S/B5WQQX5p3FlAewJF2ulHLk/img.png)
import pandas as pdimport numpy as np#read dataframedf = pd.read_csv('assessment.csv')#Drop a rowsdf.head()df.describe()df.info()df.sample(5, random_state = 70)df.loc[df['assessment score 2'].isin(['#'])]df['assessment score 2'] = df['assessment score 2'].replace({'#':np.nan})dfdf.loc[df['assessment score 2'].isin(['#'])]df.isna().sum() Option 1 : drop rowscleaned_df = df.dropna()cleaned_df.desc..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/ofM8w/btsHqvyx6QQ/l76zRWnfURyicNBoEs5DfK/img.png)
#import pandas and numpyimport pandas as pdimport numpy as np#Load small test scores dataframetest_scores = pd.read_csv('test_scores.csv')#Make a copy of the dataframeclean_scores = test_scores.copy()clean_scores.head()if_duplicated = clean_scores.duplicated(['Name', 'Age'])if_duplicated Get duplicated rows#Access the duplicated rows for duplicates in the Name and Age columnduplicate_rows = clea..