본문 바로가기
study/python

파이썬 pandas, jupiter - 환경 설치, 설정

by kuah_ 2022. 7. 27.

 

 

 

pip install

- pip 버전 업그레이드 : python.exe -m pip install --upgrade pip

- jupiter IDE 설치 : python.exe -m pip install jupyterlab

- numpy 데이터 구조분석 라이브러리 설치 : python.exe -m pip install numpy

- pandas 데이터분석 라이브러리 설치 : python.exe -m pip install pandas

- matplotlib 그래프 라이브러리 설치 : python.exe -m pip install matplotlib

 

 

 

확장팩 설치 (vscode 기준)

- 아래와 같은 모양 왼쪽 툴바에서 클릭

 

사진 속 Code Runner, Jupyter, Jupyter Keymap, Jupyter Notebook Renderers를 모두 설치한다.

Pylance, Python, Python Extended도 아직 설치하지 않았다면 설치한다.

 

 

vscode 세팅

- 기본설정 - 설정 - json (상단 아이콘) : 아래 '더보기' 클릭

더보기
{
    "editor.fontSize": 15,
    "code-runner.saveFileBeforeRun": true,
    "code-runner.runInTerminal": true,
    "python.linting.enabled": false,
    "python.pythonPath": "C:\\Program Files\\python\\Python38",
    "terminal.integrated.fontSize": 15,
    "code-runner.clearPreviousOutput": true,
    "explorer.confirmDelete": false,
    "explorer.incrementalNaming": "smart",
    "command": "workbench.action.terminal.clear",
    "workbench.startupEditor": "newUntitledFile",
    "jupyter.alwaysTrustNotebooks": true,
    "jupyter.askForKernelRestart": false,
    "liveServer.settings.donotShowInfoMsg": true,
    "workbench.editorAssociations": {
        "*.ipynb": "jupyter-notebook"
    },
    "python.showStartPage": false,
    "python.languageServer": "Pylance",
    "notebook.cellToolbarLocation": {
        "default": "right",
        "jupyter-notebook": "left"
    },
    "python.defaultInterpreterPath": "C:\\Program Files\\python\\Python310",
    "editor.minimap.enabled": false,
    "editor.fontFamily": "D2Coding, Consolas, 'Courier New', monospace",
    "editor.mouseWheelZoom": true,
    "editor.tabSize": 3,
    "files.autoSave": "afterDelay",
    "window.zoomLevel": 1,
    "security.workspace.trust.untrustedFiles": "open",
    "explorer.confirmDelete": false,
    "notebook.lineNumbers": "on"
}

 

 

 

파일 생성

- 새 파일을 생성하여 파일 이름 뒤에 .ipynb 확장자를 붙인다. ex) hello.ipynb

- 다른 파일 복사하여 이름만 변경할 경우 오류 발생할 수 있음

 

 

 

monitor 사용법

- 코드는 코드 셸 생성

- Markdown은 마크다운 셸 생성. #개수가 많을수록 글자가 작아짐

- 모두 실행은 셸 전부 실행

- 아래 이미지에서 체크된 부분 마우스로 클릭한 후 l(소문자 L)을 누르면 라인번호 출력됨

 

 

 

import, option

- 판다스와 주피터를 활용한다면 앞으로 계속 사용될거기 때문에 항상 상단에 선언해두는 것이 좋다.

1
2
3
4
5
6
7
8
9
import time
from datetime import datetime, date
import pandas as pd 
import numpy as np
import matplotlib.pyplot as plt
pd.set_option('display.notebook_repr_html',True)
pd.set_option('display.max_column',7)
pd.set_option('display.max_rows',10)
pd.set_option('display.width',250
cs

 

 

 

 

댓글