Day38_Python(14)_Pm
dataFramePlotEx1import numpy as npimport pandas as pdimport matplotlib.pyplot as pltnp.random.seed(777)frame = pd.DataFrame(np.random.rand(5,3), index=['customer1','customer2','customer3','customer4','customer5'], columns=['metric1','metric2','metric3'])print(frame)fig, (ax1, ax2) = plt.subplots(1,2, figsize=(10,7))frame.plot(kind='bar', ax=ax1, alpha=0.75..
2025. 10. 2.
Day37_Python(13)_Pm
barEx1import matplotlib.pyplot as pltplt.rc('font', family = 'Malgun Gothic')customer = ['김길동','홍길동','최길동','이길동','오길동']customer_index = range(len(customer))y_data = [120, 90, 200, 110, 230]fig=plt.figure(figsize=(6,4))ax1 = fig.add_subplot((111))ax1.bar(customer_index, y_data, color='darkblue')plt.xticks(customer_index, customer)plt.xlabel('고객 이름')plt.ylabel('수요')plt.show()wonen_pop = [5,39,45,2..
2025. 10. 1.
Day37_Python(13)_Am
scatterEx1import matplotlib.pyplot as pltimport numpy as npdataA = np.random.randn(100,2)#x 포인트, y 포인트 설정print(dataA)dataA += np.array([-1, -1])dataB = np.random.randn(100,2)dataB += np.array([1,1])plt.scatter(dataA[:,0], dataA[:,1], color='0.25') #색을 숫자로도 가능m 0 = 블랙, 1= 흰색plt.scatter(dataB[:,0], dataB[:,1], color='0.75', edgecolors='r') #테두리색 설정가능plt.show() import pandas as pdimport matplo..
2025. 10. 1.
Day36_Python(12)_Am
시각화mplibEx1import matplotlib.pyplot as plt# plt.title('plotEx1')# plt.plot([1,4,8,14])# plt.show()## plt.title('plotEx1')# plt.plot([10,20,30,40], [1,4,8,14])# plt.show()# x = range(100)# y = [x**2 for x in x]# plt.plot(x,y)# plt.show()# import numpy as np# x = np.linspace(0, 2*np.pi, 100)# y = np.sin(x)# plt.plot(x,y)# plt.show()# plt.plot([10,20,30,40], [1,4,9,18], '--sr')# plt.show()plt.plot(..
2025. 9. 30.