Á¤¼ºÈÆ
    lab_12_1.py (±³Àç)
  http://itsys.hansung.ac.kr/cgi-bin/onlineTest/viewpy4AI/onlinePy4AI.cgi?source=src/py/Ch12/lab_12_1.py



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
#
# µû¶óÇϸ砹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020)
# LAB 12-1 ¿ï¸ªµµ´Â ¸î ¿ù¿¡ ¹Ù¶÷ÀÌ °¡Àå °­ÇÒ±î?, 311ÂÊ
#
import csv
import matplotlib.pyplot as plt 
 
= open('d:/data/weather.csv')            # CSV ÆÄÀÏ ¿­¾î f¿¡ ÀúÀå 
data = csv.reader(f)                       # reader() ÇÔ¼ö·Î Àбâ
header = next(data)                        # Çì´õ¸¦ Á¦°Å
 
monthly_wind = [ 0 for x in range(12) ]    # ¸Å´Þ Ç³¼ÓÀ» ´ãÀ» ¸®½ºÆ®
days_counted = [ 0 for x in range(12) ]    # °¢ ´Þ¸¶´Ù ÃøÁ¤µÈ Àϼö
 
for row in data: 
    month = int(row[0][5:7])               # 0¹ø ¿­¿¡¼­ ´Þ Á¤º¸ ÃßÃâ
    if row[3!=  '' :                     # Ç³¼Ó µ¥ÀÌÅÍ Á¸ÀçÇÏ´ÂÁö È®ÀÎ
        wind = float(row[3])               # Ç³¼ÓÀ» ¾ò¾î ¿Â´Ù.
        monthly_wind[month-1+= wind      # ÇØ´ç ´Þ¿¡ Ç³¼Ó µ¥ÀÌÅÍ Ãß°¡
        days_counted[month-1+= 1         # ÇØ´ç ´ÞÀÇ Àϼö¸¦ Áõ°¡
 
for i in range(12) :
    monthly_wind[i] /= days_counted[i]   # Àϼö·Î ³ª´©¾î ¿ùÆò±Õ ±¸Çϱâ
      
print(monthly_wind)
plt.plot(monthly_wind, 'blue'
plt.show()
 
f.close()                                  # ÆÄÀÏÀ» ´Ý´Â´Ù.
cs

  µî·ÏÀÏ : 2022-02-21 [16:04] Á¶È¸ : 438 ´Ù¿î : 0   
 
¡â ÀÌÀü±Ûcode_12_8.py (±³Àç)
¡ä ´ÙÀ½±Ûcode_12_5_2.py (±³Àç)
Python for AI ½Ç½À°Ô½ÃÆÇ
¹øÈ£ ¨Ï Á¦ ¸ñ Á¶È¸ µî·ÏÀÏ
lAnaconda3 ¼³Ä¡
lColabTurtlePlus
l½Ç½À ¸ñ·Ï
lColab ½Ç½À
l½Ç½À ½Ã ÇлýµéÀÌ ÀÚÁÖÇÏ´Â ½Ç¼ö ¿¹µé
321 ¦¦❶ lcode_12_12.py (±³Àç) 480 02-21
320 ¦¦❶ lcode_12_10_2.py (±³Àç) 420 02-21
319 ¦¦❶ lcode_12_10_1.py (±³Àç) 422 02-21
318 ¦¦❶ lcode_12_9_2.py (±³Àç) 362 02-21
317 ¦¦❶ lcode_12_9_1.py (±³Àç) 390 02-21
316 ¦¦❶ lcode_12_8.py (±³Àç) 450 02-21
315 ¦¦❶ llab_12_1.py (±³Àç) 438 02-21
314 ¦¦❶ lcode_12_5_2.py (±³Àç) 468 02-21
313 ¦¦❶ lcode_12_5_1.py (±³Àç) 379 02-21
312 ¦¦❶ lcode_12_4_2.py (±³Àç) 396 02-21
311 ¦¦❶ lcode_12_4_1.py (±³Àç) 412 02-21
310    ¦¦❷ code_12_4_1.py (±³Àç) ÆÄÀÏ ¿ÀÇ¿¡¼­ ¿À·ù ½Ã 79 06-12
309 (11Àå) Â÷Æ®¸¦ ¸ÚÁö°Ô ±×·Áº¸ÀÚ 495 02-19
308 ¦¦❶ µµÀü¹®Á¦ 11.6 665 05-31
307    ¦¦❷ µµÀü¹®Á¦ 11.6 (¸ð¹ü ´ä¾È) ºñ°ø°³ 4 05-31
306 ¦¦❶ µµÀü¹®Á¦ 11.5 429 05-31
305    ¦¦❷ µµÀü¹®Á¦ 11.5 ºñ°ø°³ 1 05-31
304 ¦¦❶ µµÀü¹®Á¦ 11.4 423 05-31
303    ¦¦❷ µµÀü¹®Á¦ 11.4 (¸ð¹ü ´ä¾È) ºñ°ø°³ 1 05-31
302 ¦¦❶ µµÀü¹®Á¦ 11.3 603 05-31

[1][2][3][4][5][6][7][8][9][10]-[Next][20]