코딩 도와주세요...뭐가 문젤까요..
upload = files.upload()
import csv
file=open('2023final.csv',encoding='cp949')
age = csv.reader(file)
size=[]
name=input('인구 구조를 알고 싶은 행정구역 이름')
for row in age:
if name in row[0]:
m=0
f=0
for i in range(22):
m+=int(row[i+5].replace(',',''))
f+=int(row[i+16].replace(',',''))
size.append(from google.colab import files
upload = files.upload()
import csv
file=open('2023final.csv',encoding='cp949')
age = csv.reader(file)
size=[]
name=input('인구 구조를 알고 싶은 행정구역 이름')
for row in age:
if name in row[0]:
m=0
f=0
for i in range(22):
m+=int(row[i+5].replace(',',''))
f+=int(row[i+16].replace(',',''))
size.append(m)
size.append(f)
print(size)
import matplotlib.pyplot as plt
plt.rc('font',family='NanumBarunGothic')
plt.title(name+'지역의 남여 성별 인구분포')
plt.pie(size,labels=['남','여'], colors=['pink','red'],autopct='%.2f%%',startangle=90)
plt.legend()
size.append(f)
print(size)
import matplotlib.pyplot as plt
plt.rc('font',family='NanumBarunGothic')
plt.title(name+'지역의 남여 성별 인구분포')
plt.pie(size,labels=['남','여'], colors=['pink','red'],autopct='%.2f%%',startangle=90)
plt.legend()
f+=int(row[i+16].replace(',',''))
size.append(m)
여기 두 줄에서 계속 오류가 나는데 뭐가 문젤까요....