본문 바로가기

데이터 분석3

랜덤 포레스트(데이터 전처리) 1. hotel 데이터셋 import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt hotel_df = pd.read_csv('/content/drive/MyDrive/KDT/머신러닝과 딥러닝/data/hotel.csv') hotel_df.info() RangeIndex: 119390 entries, 0 to 119389 Data columns (total 32 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 hotel 119390 non-null object 1 is_canceled 11939.. 2023. 12. 28.
상권별 업종 밀집 통계 예제 import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns shop = pd.read_csv('/content/drive/MyDrive/KDT/데이터분석/데이터/shop_201806_01.csv') pd.set_option('display.max_columns', 40) shop.info() RangeIndex: 499328 entries, 0 to 499327 Data columns (total 39 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 상가업소번호 499328 non-null int6.. 2023. 12. 23.
Matplotlib 1. Matplotlib Matplotlib(맷플롯립)은 파이썬에서 2D 그래픽을 생성하는 데 사용되는 시각화 라이브러리로, 과학 및 엔지니어링 분야에서 널리 사용됩니다. 주로 선 그래프, 산점도, 막대 그래프 등을 그릴 수 있으며, 데이터 시각화에 활용됩니다. 한글에 대한 지원이 완벽하지 않지만 pandas와 연동이 용이합니다. 설치 : !pip install matplotlib import matplotlib.pyplot as plt import matplotlib.pyplot as plt는 Matplotlib 라이브러리를 사용할 때 일반적으로 사용되는 명령문입니다. 이 명령문은 Matplotlib의 pyplot 모듈을 plt라는 별칭으로 가져오는 역할을 합니다. Matplotlib은 여러 모듈로 구.. 2023. 12. 10.