What is the average size of each color diamond

Assignment Help Python Programming
Reference no: EM131860675

Homework - Homework is to be completed in Python 3.

1. Using pandas and the diamonds data set from class

a. Create a new column price_01 that for each observation (row) applies a linear scaling of the price where 0 corresponds to the minimum price in the data set and 1 corresponds to the maximum price

b. Create a new column size that contains 'small', 'medium', or 'large' depending if it is in the bottom quartile, one of the two middle quartiles, or the largest quartile respectively

c. Create a new data frame exp_diamonds that only includes prices >1000 and ideal or premium cuts

d. What is the average size of each color diamond? (add an inline comment, #1d, to the line of code that creates the table)

2. Using pandas and the diamonds data set from class

a. Plot the density of the prices

b. Log10 transform the prices and plot the density

c. Make a scatter plot of transformed prices vs carat for diamonds with ideal cut and E color

d. Groupy all diamonds less than 1 carat by cut and make a boxplot of their log transformed prices

3. Graphs like the one above can be coded as a dictionary in python. Each node is a key and values consist of all nodes that are connected to the key node. {1:[2,3,4],2:[1,5,6],3:[1,7,8],4:[1,9],5:[2],6: [2],7:[3],8:[3],9:[4]} would represent the above graph. Write a function called shortest_path(start_node, end_node, graph) that accepts a starting node, ending node, and a graph dictionary as input and returns a list of nodes (including starting and ending node) of the shortest path between the two.

1481_figure.png

4. A cycle in a graph theory is a path of vertices connected by edges that forms a closed loop without repeating any edges or vertices. Using the same concept of graph dictionary from the previous problem write a function called cycle(node, graph) that accepts a starting node and a graph dictionary. The function prints no cycle and returns an empty list if there does not exist a cycle that begins and ends at that node, otherwise it prints cycle exists and returns a list that contains a cycle with the starting node in the first and last position. Note that the cycle does not have to contain every vertex (which would be a Hamiltonian cycle).

Attachment:- Assignment Files.rar

Reference no: EM131860675

Questions Cloud

How organization benefiting from sustainability initiatives : Explain and analyze how one organization/company in the Kingdom of Saudi Arabia is benefiting from the sustainability initiatives - Sustainability can enhance
Construct a project charter to revamp benefits package : You have recently been appointed head of human resources and are now in charge of managing a small team. Your next project is to revamp the compensation.
How do you feel about the ending : How do you feel about the ending? Do you think it works?How does this ending change your understanding of the first portion of the story?
What is the upper bound for the confidence interval : For the 58 cases that were rejected at intake, the mean processing time was 11.3 days with a standard deviation of 21.02.
What is the average size of each color diamond : Using pandas and the diamonds data set from class - What is the average size of each color diamond. Plot the density of the prices
What annual yield to maturity do the bonds promise : Vino de Luche has outstanding bonds that currently sell for $950, have a par value of $1,000, what annual yield to maturity do the bonds promise,
What is the probability that both are smokers : A male student and a female student from the college are randomly selected for a survey. What is the probability that both are smokers?
Determine three characteristics of an effective team : Determine three (3) characteristics of an effective team and three (3) characteristics of an effective team leader.
Net profit from a certain investment : The net profit from a certain investment is normally distributed with a mean of $10,000 and a standard deviation of $5,000.

Reviews

len1860675

2/12/2018 4:39:00 AM

This homework is to be completed in Python 3. Please use basic code for code beginner!(I attached the class note, please depend on it to write code.) Add comments to your file (using #'s) and explain the output you get. Pay attention if the specification asks for a return or a print. Remember to document your code (purpose, input, output). Give me step by step comments for my homework.

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd