sort_values 4

[빅데이터분석기사] 실기 3회 1유형 풀이(Python)

문제1 - 2022년 데이터 중 2022년 중앙값보다 큰 값의 데이터 수 - data : t1-data2.csv import pandas as pd df = pd.read_csv("../input/big-data-analytics-certification/t1-data2.csv", index_col='year') m = df.loc["2022년"].median() print(sum(df.loc["2022년", :] > m)) 문제2 - 결측치 데이터(행)을 제거하고, 앞에서부터 60% 데이터만 활용해, 'f1' 컬럼 3사분위 값을 구하시오. - 60%가 소수점일 경우 절사(예 : 36.6 일 때 36으로 계산) import pandas as pd df = pd.read_csv("../input/big-d..

[빅데이터분석기사] 실기 2회 1유형 풀이(Python)

문제 1 - 데이터셋(basic1.csv)의 'f5' 컬럼을 기준으로 상위 10개의 데이터를 구하고, - 'f5' 컬럼 10개 중 최소값으로 데이터를 대체한 후, - 'age' 컬럼에서 80 이상인 데이터의 'f5' 컬럼 평균값 구하기 # 라이브러리 및 데이터 불러오기 import pandas as pd df = pd.read_csv('../input/bigdatacertificationkr/basic1.csv') df.head() # f5 컬럼을 기준으로 내림차순 정렬 df = df.sort_value('f5' ascending = False) df.head(10) # 최소값 찾기 min = df['f5'][:10].min() min df.iloc[:10, -1] = min df.head(10) # 8..

[빅데이터분석기사] 작업형 1유형 연습문제 #3

데이터 출처(월드컵 출전선수 골기록 데이터) : https://www.kaggle.com/darinhawley/fifa-world-cup-goalscorers-19302018 FIFA World Cup Goalscorers 1930-2018 List of all FIFA World Cup goalscoreres 1930-2018 www.kaggle.com 데이터 URL : https://raw.githubusercontent.com/Datamanim/datarepo/main/worldcup/worldcupgoals.csv import pandas as pd df = pd.read_csv('https://raw.githubusercontent.com/Datamanim/datarepo/main/worldcu..

[빅데이터분석기사] 작업형 1유형 연습문제 #1

데이터 출처(유튜브 데일리 인기동영상) : https://www.kaggle.com/rsrishav/youtube-trending-video-dataset?select=KR_youtube_trending_data.csv YouTube Trending Video Dataset (updated daily) YouTube Trending Video data-set which gets updated daily. www.kaggle.com 데이터 URL : https://raw.githubusercontent.com/Datamanim/datarepo/main/youtube/youtube.csv import pandas as pd df = pd.read_csv("https://raw.githubusercontent..