0% found this document useful (0 votes)
22 views2 pages

데이터 과제

Uploaded by

tlskahs1003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views2 pages

데이터 과제

Uploaded by

tlskahs1003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

24. 6. 9.

오후 10:28 Untitled - Colab

import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_csv("/content/drive/MyDrive/moving (1).CSV")

print(df)

year Seoul Busan Daegu Incheon Gwangju Daejeon Ulsan Sejong \


0 2014 -87831 -15092 -15526 9324 -2977 -8838 2786 33456
1 2015 -137256 -13560 -12940 9538 -9272 -20616 -80 53044
2 2016 -140257 -21392 -9260 5777 -7898 -10631 -7622 29816
3 2017 -98486 -28398 -11936 -1670 -8118 -16175 -11917 34690
4 2018 -110230 -26759 -14242 -67 -6216 -14753 -12654 31433
5 2019 -49588 -23354 -23673 -2337 -3875 -16342 -10172 23724
6 2020 -64850 -14347 -16835 -15748 -6083 -11097 -13584 13025
7 2021 -106243 -18903 -24319 11423 -5883 -8931 -13674 14085
8 2022 -35340 -13562 -11519 28101 -7642 -2996 -9536 10128
9 2023 -31250 -11432 -5288 33507 -9017 -2474 -6215 1690

Kyunggi Gangwon Chungbuk Chungnam Jeonbuk JeonNam Kyungbuk Kyungnam \


0 57396 2085 2367 9810 -2563 -596 -988 6075
1 94768 4773 1438 10272 -2830 3936 -577 5105
2 133617 1892 5011 15318 -4419 -3205 -3151 1772
3 116162 2035 2262 19401 -7206 -3047 -5581 3979
4 170094 -3854 5149 10084 -13773 -8030 -9225 -5810
5 134666 1661 2565 -794 -12748 -8788 -4571 -9310
6 168373 5457 3454 741 -8494 -9754 -16978 -16658
7 150517 6681 3462 8522 -5801 -4487 3337 -13703
8 43882 7494 5201 14314 -5115 -345 -7666 -18547
9 44612 -1397 3873 15840 -4457 -1800 -8205 -16300

Jeju
0 11112
1 14257
2 14632
3 14005
4 8853
5 2936
6 3378
7 3917
8 3148
9 -1687

대전평균 = df['Daejeon'].mean()
세종평균 = df['Sejong'].mean()
print("대전의 평균:",대전평균)
print("세종의 평균:",세종평균)

대전의 평균: -11285.3


세종의 평균: 24509.1

추출 = df[['year', 'Daejeon', 'Sejong']]


print(추출)

year Daejeon Sejong


0 2014 -8838 33456
1 2015 -20616 53044
2 2016 -10631 29816
3 2017 -16175 34690
4 2018 -14753 31433
5 2019 -16342 23724
6 2020 -11097 13025
7 2021 -8931 14085
8 2022 -2996 10128
9 2023 -2474 1690

plt.figure(figsize=(10, 6))

plt.plot(추출['year'], 추출['Daejeon'], label='Daejeon', linestyle='-')


plt.plot(추출['year'], 추출['Sejong'], label='Sejong', linestyle='-')
plt.legend()
plt.show()

https://colab.research.google.com/drive/19ai0iGf5_JoRcrO7RDJqynB17WQlqBU6#scrollTo=GU-aOK-0J3WU 1/2
24. 6. 9. 오후 10:28 Untitled - Colab

https://colab.research.google.com/drive/19ai0iGf5_JoRcrO7RDJqynB17WQlqBU6#scrollTo=GU-aOK-0J3WU 2/2

You might also like