1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
masha68 [24]
3 years ago
6

Write a program that computes the minimum, maximum, average and standard deviation of the population over time for a borough (en

tered by the user). Your program should assume that the NYC historical population data file, nycHistPop.csv is in the same directory.A sample run of your program:
Enter borough: Staten Island
Average population: 139814.23076923078
Maximum population: 474558
and another run:

Enter borough: Brooklyn
Average population: 1252437.5384615385
Maximum population: 2738175
Computers and Technology
1 answer:
IrinaK [193]3 years ago
4 0

Answer:

import pandas as pd #importing pandas library as pd

import matplotlib.pyplot as plt #importing matplotlib.pyplot as plt

pop=pd.read_csv('nycHistPop.csv') #reading the csv file

borough=input('Enter borough name:') #asking the user for borough namme

# image=input('Enter image name:')

# pop['Fraction']=pop[borough]/pop['Total']

# pop.plot(x='Year', y='Fraction')

print("Minimum population",pop[borough].min()) #printing the minimum population of borough

print("Maximum population",pop[borough].max()) #printing the maximum population of borough

print("Average population",pop[borough].mean()) #printing the average population of borough

print("Standard deviation",pop[borough].std()) #printing the standard deviation of borough

# fig=plt.gcf()

# fig.savefig(image)

Explanation:

You might be interested in
Imagine that you need to be late to work next Thursday because of a doctor's appointment. Compose your own e-mail appropriate fo
ratelena [41]
In form your boss a week early
8 0
3 years ago
Why is it not advisable to mark tlc plates with a pen to indicate?
nikitadnepr [17]
The plate can change the function that is in it. If you were to name it wrong, you would have to debug the code and possibly rewrite it.
3 0
3 years ago
What does the windows update feature allow you to do?
Mariulka [41]
The answer is D
Explanation: none
3 0
3 years ago
Read 2 more answers
What do I have to do to get you to cancel this subscription? I have emailed several times and every dang month I get a $10 charg
alexdok [17]
Contact the moderation team’s email
5 0
3 years ago
A cookie is.... a. an illegal use of information about a customer b. a feature of a Web site designed to attract children c. a f
Elodia [21]

Answer:

C. A file that a Web site stores on a visitor's computer

Explanation:

Have a nice day! :)

3 0
2 years ago
Other questions:
  • Which key removes all data from an active cell with one click? A. Esc B. Delete C. Tab D. F2
    9·2 answers
  • What is NOT a good habit when presenting to an audience?
    5·2 answers
  • A site structure that contains multiple links to individual pages, allowing visitors to go through multiple paths to the site is
    9·1 answer
  • A collection of facts can be copyrighted, but only if the collection is ____ in a way that causes the resulting work to rise to
    14·1 answer
  • A modern version of the BIOS firmware is called?
    12·1 answer
  • A(n) ____ consists of a series of related instructions, organized for a common purpose, that tells the computer what tasks to pe
    6·1 answer
  • The ______ printers are the most popular type of printer in small office/home office and large office environments.
    5·1 answer
  • Debug the following program.
    5·1 answer
  • Identify the network and the host address in the ip address of 12.128.120.131 with a subnet mask of 255.128.0.0.
    6·1 answer
  • The function that overloads the ____ operator for a class must be declared as a member of the class.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!