방법 1
아나콘다 설치 후 아나콘다 커맨드에서 실행
C:\Users\dojang>jupyter notebook
방법 2
vscode에서 파이썬 설치 후
- Python Package 설치
c:\> pip3 install --upgrade pip |
- jupyter 설치
c:\> pip3 install jupyter c:\> pip3 install tensorflow |
- matlotlib 설치
c:\> pip3 install -U pip setuptools c:\> pip3 install matplotlib |
그래프
import matplotlib.pyplot as plt
plt.plot([1,5,7,3,7])
plt.show()
import matplotlib.pyplot as plt
month = ['mar','apr','may','jun','jul']
sales = [1,5,7,3,7]
plt.plot(month, sales)
plt.show()
import matplotlib.pyplot as plt
month = ['mar','apr','may','jun','jul']
sales = [1,5,7,3,7]
plt.rc('font', family='Malgun Gothic')
plt.title('월별 판매 실적')
#plt.plot(month, sales, color='r')
# plt.bar(range(2,11,2),month, sales, color='g')
plt.barh(range(2,11,2),sales, color='g')
plt.xlabel('월')
plt.ylabel('매출')
plt.show()
# 원 그래프
import matplotlib.pyplot as plt
b_type = [25, 19, 37, 11]
plt.rc('font', family='Malgun Gothic')
plt.title('혈액형 비율')
plt.pie(b_type, labels=['A형', 'B형', 'O형', 'AB형'])
plt.show()
# 그래프 2개 표시
import matplotlib.pyplot as plt
singer = ['A', 'B', 'C', 'D', 'E']
week1 = [42, 58, 19, 92, 84]
week2 = [53, 52, 48, 98, 73]
plt.plot(singer, week1, label="첫째 주", color='hotpink')
plt.plot(singer, week2, label="둘째 주", color='royalblue')
plt.legend()
plt.show()
#tkinter
from tkinter import *
root = Tk()
root.title('나의 첫 tkinter')
root.geometry('400x200+300+300')
label1 = Label(root, text="하이?")
label1.pack()
root.mainloop()
# #tkinter 이미지 ( Toplevel() => Tk() 실행 )
import tkinter
root=tkinter.Tk()
# root=tkinter.Toplevel()
root.title("blog")
root.geometry("840x420")
image=tkinter.PhotoImage(file="c:/zzz/1024.png")
label=tkinter.Label(root, image=image)
label.pack()
root.mainloop()
#사용자 정의
def hi123(name, age=12):
print('안녕')
print('My name is', name, ' ', age, '살')
hi123(name='둘리')
hi123(name='둘리', age=23)
def hi123(name, age=12):
print('안녕')
print('My name is', name, ' ', age, '살')
return 'My name is' + name + ' ' + age + '살'
# hi123(name='둘리')
hi123(name='둘리', age=23)
str = hi123(name='둘리', age=23)
print(str)
# 튜플
def hi123(name, age=12, score=0):
print('안녕')
etc = 'My name is' + name
sum = score + 30
return sum, etc, age
str = hi123('둘리', 14, 67)
print(str)
'코드 정리' 카테고리의 다른 글
Vue.js 실전_ 연습 순서 (0) | 2023.11.08 |
---|---|
스프링 시큐리티_구글 소셜로그인_DB연결 (0) | 2023.11.01 |
Vue.js basic (0) | 2023.11.01 |
local=> Git (0) | 2023.11.01 |
파일질라_리눅스_자바서비스_vmware_ftp (1) | 2023.10.06 |