일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 머신러닝
- level 1
- 코딩테스트
- pandas
- 데이터 분석
- seaborn
- Numpy
- 튜닝
- Kaggle
- 빅분기
- python3
- matplotlib
- 파이썬
- 실습
- 오라클
- 카카오
- level 2
- R
- sklearn
- Oracel
- 실기
- 프로그래머스
- 알고리즘
- SQL
- 빅데이터 분석 기사
- oracle
- Python
- Today
- Total
목록Python (164)
라일락 꽃이 피는 날
seaborn에서 제공하는 샘플 데이터 https://github.com/mwaskom/seaborn-data mwaskom/seaborn-data Data repository for seaborn examples. Contribute to mwaskom/seaborn-data development by creating an account on GitHub. github.com titanic = sns.load_dataset('titanic') tips = sns.load_dataset('tips') iris = sns.load_dataset('iris') 1. Countplot countplot은 항목별 개수를 세어준다. 해당 column을 구성하고 있는 value들을 알아서 구분하여 보여준다. 가로로..
seaborn matplotlib을 기반으로 다양한 색상과 차트를 지원하는 라이브러리 컬러 팔레트를 이용한 아름다운 디자인과 쉬운 사용성 보유 seaborn에서만 제공되는 통계 기능 기반의 plot pandas, matplotlib와 호환 가능 https://seaborn.pydata.org/ seaborn: statistical data visualization — seaborn 0.11.1 documentation Seaborn is a Python data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics..
6. Pie Chart explode: 파이에서 툭 튀어져 나온 비율 autopct: 퍼센트 자동으로 표기 shadow: 그림자 표시 startangle: 파이를 그리기 시작할 각도 texts, autotexts 인자를 활용하여 텍스트 스타일링을 적용 texts는 label에 대한 텍스트 효과, autotexts는 파이 위에 그려지는 텍스트 효과를 다룬다. labels = ['Samsung', 'Huawei', 'Apple', 'Xiaomi', 'Oppo', 'Etc'] sizes = [20.4, 15.8, 10.5, 9, 7.6, 36.7] explode = (0.3, 0, 0, 0, 0, 0) 7. Box Plot spread = np.random.rand(50) * 100 center = np.on..
1. Scatterplot x = np.random.rand(50) y = np.random.rand(50) colors = np.arange(50) area = x * y * 1000 s: 점의 넓이 / c: 점의 색상 / cmap: 모두 같은 점의 색상 / alpha: 점의 투명도 2. Barplot, Barhplot x = ['Math', 'Programming', 'Data Science', 'Art', 'English', 'Physics'] y = [66, 80, 60, 50, 80, 10] barh 함수에서는 xticks로 설정했던 부분을 yticks로 변경 Batplot에서 비교 그래프 그리기 x_label = ['Math', 'Programming', 'Data Science', 'Art'..

1. 타이틀 plt.title('이것은 타이틀 입니다') plt.title('이것은 타이틀 입니다', fontsize=20) 2. X, Y축 Label 설정 plt.xlabel('X축', fontsize=20) plt.ylabel('Y축', fontsize=20) 3. X, Y 축 Tick 설정 (rotation) plt.xticks(rotation=90) plt.yticks(rotation=30) 4. 범례(Legend) 설정 plt.legend(['10 * 2', '10 ** 2', 'log'], fontsize=15) 5. X와 Y의 한계점(Limit) 설정 plt.xlim(0, 5) plt.ylim(0.5, 10) 6. 스타일 세부 설정 1) marker . point marker s square..
1. 단일 그래프 plot에 data를 넣으면 리스트의 값들을 y값이라고 가정하고 x값[0, 1, 2, ...]을 생성 2. 다중 그래프 (multiple graphs) 1) 1개의 canvas 안에 그리기 2) 새로운 canvas를 생성하여 그리기 figure() 함수를 이용하면 새로운 canvas를 생성할 수 있다. 3. 여러 개의 plot 그리기 (subplot) plt.subplot(row, column, index) row, column, index 사이의 콤마를 생략하고 작성 가능하다. ex) plt.subplot(2, 1, 1) → plt.subplot(211) 4. 여러 개의 plot 그리기 (subplots) plt.subplots(행의 개수, 열의 개수)
matplotlib : 파이썬 기반 시각화 라이브러리 세부 옵션을 통하여 아름다운 스타일링과 다양한 그래프 그리기 가능 pandas도 matplotlib을 내장하기 때문에 연동이 용이 단, colab에서 한글 사용 시 추가 설정 필요 https://matplotlib.org/ Matplotlib: Python plotting — Matplotlib 3.4.2 documentation matplotlib.org matplotlib.pyplot as plt colab에서 한글 깨짐 현상 해결 방법 1. 코드 실행 !sudo apt-get install -y fonts-nanum !sudo fc-cache -fv !rm ~/.cache/matplotlib –rf 2. 상단 메뉴 - 런타임 - 런타임 다시 시작..
1. np.random.rand 0~1 사이의 임의의 균일 분포 값을 반환한다. np.random.rand() # 0.5644040985351038 np.random.rand(3) # array([0.15907147, 0.56814351, 0.65641927]) np.random.rand(3,2) # array([[0.1728781 , 0.41835388], # [0.39280028, 0.09229667], # [0.0272809 , 0.02512556]]) 2. np.random.randn n : normal distribution (정규 분포) -1~1 사이의 임의의 정규 분포 값을 반환한다. np.random.randn() # -0.6184246409845511 np.random.randn(3) #..