1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # LAB 12-2 ÆÇ´Ù½º·Î ¿ï¸ªµµÀÇ ¹Ù¶÷ ¼¼±â ºÐ¼®Çϱâ, 322ÂÊ # import pandas as pd import matplotlib.pyplot as plt weather = pd.read_csv('d:/data/weather.csv', encoding='CP949') monthly = [ None for x in range(12) ] # ´Þº°·Î ±¸ºÐµÈ 12°³ÀÇ µ¥ÀÌÅÍÇÁ·¹ÀÓ monthly_wind = [ 0 for x in range(12) ] # °¢ ´ÞÀÇ Æò±Õ dz¼ÓÀ» ´ãÀ» ¸®½ºÆ® # ¸¶Áö¸·¿¡ ÇØ´ç ÇàÀÇ µ¥ÀÌÅÍ°¡ ÃøÁ¤µÈ ´ÞÀ» ±â·ÏÇÑ ¿À» Ãß°¡ weather['month'] = pd.DatetimeIndex(weather['ÀϽÃ']).month for i in range(12) : monthly[i] = weather[ weather['month'] == i + 1 ] # ´Þº°·Î ºÐ¸® monthly_wind[i] = monthly[i].mean()['Æò±Õdz¼Ó'] # °³º° µ¥ÀÌÅÍ ºÐ¼® plt.plot(monthly_wind, 'red') plt.show() | cs |