ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Graph
    Cording/Python 2021. 1. 22. 23:11

    f = open('seoul.csv')

    data = csv.reader(f)

    next(data)

    result = []

     

    for row in data:

    if row[-1] !='' :

    result.append(float(row[-1]))

    # print(result)

    plt.hist(result, bins=100, color = 'r')

    plt.show()

     

    f = open('seoul.csv')

    data = csv.reader(f)

    next(data)

    aug = []

     

    for row in data:

    month = row[0].split('-')[1] :

    if row[-1] !='' :

    if month == '08' :

    aug.append(float(row[-1]))

    # print(aug)

    plt.hist(aug, bins = 100, color = 'r')

    plt.show()

     

    f = open('seoul.csv')

    data = csv.reader(f)

    next(data)

    aug = []

    jan = []

     

    for row in data:

    month = row[0].split('-')[1] :

    if row[-1] !='' :

    if month == '08' :

    aug.append(float(row[-1]))

    if month == '01' :

    jan.append(float(row[-1]))

     

    import matplotlib.pyplot as plt

    plt.hist(aug, bins = 100, color = 'r', label = 'Aug')

    plt.hist(jan, bins = 100, color = 'b', label = 'Jan')

    plt.legend()

    plt.show()

     

    # 인구 구조

    import csv

    import matpltlib.pyplot as plt

    f = open('age.csv')

    data = csv.reader(f)

     

    for row in data :

    if '부산광역시 사상구 주례제2(2653066000)' == row[0] :

    print(row)

     

    print('주례' in '부산광역시 사상구 주례제2~'_)

    print('2653' in '~')

     

    for row in data :

    if '주례제2' in row[0] :

    for i in row[3:] :

    print(i)

     

    result = []

     

    for row in data :

    if '주례제2' in row[0] :

    for i in row[3:] :

    result.append(int(i))

    print(result)

     

    plt.style.use('ggplot')

    plt.plot(result)

    plt.show()

     

    print(plt.style.available)

     

    'Cording > Python' 카테고리의 다른 글

    machine learning  (0) 2021.02.01
    전처리  (0) 2021.01.28
    jupyter-data visualization  (0) 2021.01.21
    Juypter-data2  (0) 2021.01.20
    Juypter-계산  (0) 2021.01.20

    댓글

Designed by Tistory.