首页 >
> 详细

代写数据分析作业的第三部分，根据数据用numpy绘制统计图，供分析使用。

In this section, you’re going to create some plots to visualize the country data. Make sure you’ve read the relevant notes we’ve provided:

- Pie and Scatter
- Line and Bar
- Axes

Be careful about trusting the results of test.py for this part. The tests can only detect whether you produced a plot; they cannot evaluate the contents of the plot. TAs will evaluate the plots manually, deducting points for plots not matching the specifications. For each plot, we give an example of what a solution might look like. Consider these examples minimal acceptable answers (they are sufficient to receive full credit). You are free to improve the aesthetic aspects of the plots (e.g., colors, size, labels, ticks, legend, etc) if you like.

Before you start, make sure you re-download the latest test.py, expected.json, and expected.html files. Remember to download the RAW versions (not the preview pages from GitHub). For example:

Some questions may be nearly identical to ones we’ve already asked you, but now you must answer with a plot instead of with a table.

Answer with a bar plot. Put continents on the x-axis and average populations on the y-axis. The continents should be sorted along the x-axis alphabetically by name, ascending.

Answer with a bar plot. Put continents on the x-axis and number of countries on the y-axis. The continents should be sorted along the x-axis alphabetically by name, ascending.

Answer with a bar plot. Put countries on the x-axis and distance to nearest neighbor on the y-axis. The coutries should be sorted along the x-axis alphabetically by name, ascending.

Use the growth formula we used for predictPopulation back in Project 2.

Answer with a line plot. Show three lines to represent these growth rates: 0.01, 0.05, and 0.1. The x-axis will indicate elapsed years (relative to the time when the data in countries.json was collected). The projection should be over 10 years. The y-axis will indicate the anticipated population.

This is the only one in stage 3 requiring a table instead of a plot.

If you have a DataFrame df, then calling df.corr() will present a table showing the Pearson correlation between every pair of columns in df, so this should be a very easy question (more details here).

We won’t talk about the math behind the Pearson correlation, but spend some time looking at the numbers to gain an intuition for this metric. A correlation of 1 is the max (so, for example, every column is correlated perfectly with itself).

A high correlation between columns X and Y means that large X values tend to coincide with large Y values and small X values tend to coincide with small Y values. In some of the cells, you’ll observe negative correlations (-1 being the smallest). This means that large X values tend to coincide with small Y values and vice versa.

Create a scatter plot with literacy on the x-axis and phones on the y-axis. The Pearson correlation between these two numbers was positive (0.594322). Do you observe a pattern of more phones when literacy is greater?

Create a scatter plot with literacy on the x-axis and birth-rate on the y-axis. The Pearson correlation between these two numbers was negative (-0.792272). Do you observe a pattern of fewer babies when literacy is greater?

Create a scatter plot with literacy on the x-axis and area on the y-axis. Use a log scale for the y-axis by passing logy=True to scatter. The Pearson correlation between these two numbers was close to zero (-0.108139). Is the relationship in this scatter plot less striking than those for phones and birth-rate?

Create a scatter plot with literacy on the x-axis and area on the y-axis. Imagine we wanted to fit a straight line to this data. Even though the two metrics are clearly related, a straight fit line will not work well here, unless we find another way of looking at the data.

This is the same as Q29, with two differences:

- instead of plotting mortality on the y-axis, plot 1/mortality (for infants)
- draw a fit line over the data

For the fit line, first try copy/pasting this code into a notebook cell and running it to see what happens:

1 |
import numpy as np |

Then adapt the above code so that it uses your DataFrame (instead of df) and replaces “x” with GDP-per-capita and “y” with the inverse of infant mortality.

联系我们

- QQ：99515681
- 邮箱：99515681@qq.com
- 工作时间：8:00-23:00
- 微信：codinghelp2

- You Have Implemented A Simple Web Serv... 2020-05-31
- Stat 5511 Homework 4 2020-05-31
- Lab 7 2020-05-31
- 代写cosc 363作业、代做computer Graphics作业、代写c 2020-05-31
- Eie111课程作业代写、C++程序设计作业调试、代做c/C++语言作业、代 2020-05-31
- Math502作业代做、Mathematics课程作业代做、Java，Pyt 2020-05-31
- 代写sit114课程作业、代做data留学生作业、代写r编程设计作业、代做r 2020-05-31
- Envx3002作业代写、R程序语言作业调试、R课程设计作业代做、代写dat 2020-05-31
- Ee6435 Programming Homework 2020-05-30
- Computer Architecture Homework 3 2020-05-30
- Infs7450作业代做、Media Analytics作业代写、Pytho 2020-05-29
- 代写stats 782作业、代做r编程设计作业、代写data留学生作业、R课 2020-05-29
- 代写math223作业、R课程设计作业代做、代写data课程作业、R程序语言 2020-05-28
- 代写kxo151留学生作业、代做programming作业、Java语言作业 2020-05-28
- Math 160作业代做、Data课程作业代写、Matlab程序设计作业调试 2020-05-28
- 代做csci 3120作业、Program课程作业代做、C/C++语言作业代 2020-05-28
- St2020课程作业代做、Statistics作业代做、R程序设计作业调试、 2020-05-28
- Com1005作业代写、Ai Techniques作业代做、Java语言作业 2020-05-28
- 代写sit216留学生作业、Python程序语言作业调试、Java/C++实 2020-05-28
- 代写artificial课程作业、Java，Python程序语言作业调试、C 2020-05-27