본문 바로가기

전체 글264

[백준 10950] A+B - 3 (java) 문제 링크 https://www.acmicpc.net/problem/10950 10950번: A+B - 3 두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오. www.acmicpc.net 나의 코드 (java) import java.util.Scanner; public class Main { public static void main(String[]args) { Scanner sc = new Scanner(System.in); int n, A, B; // 입력 개수 받기 n = sc.nextInt(); // 입력 값을 저장할 배열 생성 int arr[] = new int[n]; for (int i=0; i 2021. 7. 1.
[데이터 분석] sales 데이터 전처리하기 데이터 전처리 이상치 삭제하기 년,월,일로 date 분리하기 수입, 연월, 월일 데이터 만들기 데이터 불러오기 import pandas as pd sales = pd.read_csv('data/sales.csv') sales.head() date shop_id item_id item_price item_cnt_day 0 02.01.2013 59 22154 999.00 1.0 1 03.01.2013 25 2552 899.00 1.0 2 05.01.2013 25 2552 899.00 -1.0 3 06.01.2013 25 2554 1709.05 1.0 4 15.01.2013 25 2555 1099.00 1.0 len(sales) 2935849이상치(item_price, item_cnt_day) .. 2021. 6. 30.
[데이터 분석] sales 데이터 분석 데이터 파악(EDA) 데이터의 전반적인 파악 컬럼별 값 파악 이상치, 결측치 등 파악 데이터 불러오기 import pandas as pd sales = pd.read_csv('data/sales.csv') 데이터 전체적인 정보 확인 sales.info() RangeIndex: 2935849 entries, 0 to 2935848 Data columns (total 5 columns): # Column Dtype --- ------ ----- 0 date object 1 shop_id int64 2 item_id int64 3 item_price float64 4 item_cnt_day float64 dtypes: float64(2), int64(2), object(1) memory usage: 112.0.. 2021. 6. 30.
[데이터 분석] 오픈 API를 통한 데이터 수집 : 행정안전부_소방서위치조회서비스 [오픈 API를 통한 데이터 수집] 서울시 지역구 별 소방서 개수 구하기 소방서 위치 조회서비스 이용하기 https://www.data.go.kr/dataset/15000933/openapi.do (1) 필요 라이브러리 불러오기 from bs4 import BeautifulSoup from urllib.request import Request, urlopen import pandas as pd (2) open_api 요청 테스트 serviceKey = '일반 인증키(Encoding)' url = 'http://openapi.safekorea.go.kr/openapi/service/firestation/item?' api_url = url + 'serviceKey=' + serviceKey + '&fire.. 2021. 6. 30.