Durga Pokharel

Posted on

# Day 73 Of 100DaysOfCode: Data Visualization

This is my 73th day of #100daysofcode and #python learning. Today, I keep learning from Datacamp and also completed some assignments. Also, I am present in one bootcamp from dphi where I did data visualization on data given on assignment, which contained some metropolitan data and publicly available here.

After I got Hawkins Fellowship, I am learning from Datacamp because I have access to most courses there now. Hence my journey of learning Algorithms from Coursera is in pending state. I am going to write some of assignments I completed today.

# dphi Assignment

All the assignments were quizz but I had to write code in order to find the right answer and it was quite fun to try.

I started by reading CSV file using Pandas.

``````import pandas as pd
%matplotlib inline
``````

## Question 1: What is the Mean area of lands?

Not that hard, just take mean.

``````data.land_area.mean()
``````

Output of the code is,

``````2615.7272727272725
``````

## Question 2: What is the crime rate among all Metropolitan Areas?

Again it is the max value of single column.

``````data.crime_rate.max()
``````

Output of the code is,

``````85.62
``````

## Question 3: What is the average crime rate among all metropolitan areas?

Same as previous, find mean of single column.

``````data.crime_rate.mean()
``````

Output of the above code is,

``````55.64303030303031
``````

## Question 4: What is the top 5 data of region 4?

``````data[data.region==4]
``````