Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Note: Please only use python standard libraries (i.e. json, csv etc). Numpy and pandas are allowed in this assignment.

1 answer below »
Note: Please only use python standard li
aries (i.e. json, csv etc). Numpy and pandas are allowed in this assignment.
Answered Same Day Apr 29, 2021

Solution

Harsimran answered on Apr 30 2021
147 Votes
import csv
import numpy as np
from operator import itemgetter

a1 =[]
cities = []
elevation_list =[]
population_list =[]
with open('./cities.csv') as csv_file:
csv_reader = csv.reader(csv_file)
line_count = 0
water_area = 0
maximum_area= 0
minimum_area = 5000
total_area = 0
land_area = 0
for row in csv_reader:
if line_count == 0:
line_count += 1
else:
line_count += 1
if(len(row[9]) != 0):
try:
area = int(row[9])
except ValueE
or:
area = float(row[9])
if(minimum_area > area):
minimum_area = area
name_min = row[0]
if(maximum_area < area):
maximum_area = area
name_max = row[0]
total_area += area



if(len(row[11]) != 0):
try:
water_area = int(row[11])
except ValueE
or:
water_area= float(row[11])
water_area +=...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here