hw04

pdf

School

Skyline College *

*We aren’t endorsed by this school

Course

MISC

Subject

Industrial Engineering

Date

Feb 20, 2024

Type

pdf

Pages

10

Uploaded by MasterBuffalo3986

Report
Question 2. Let’s look at how the Yelp scores compare to the Google scores in the burritos table. First, assign yelp_google_tbl to a table only containing the columns Yelp and Google . Then, make a scatter plot with Yelp scores on the x-axis and the Google scores on the y-axis. (8 Points) In [121]: yelp_google_tbl = burritos . select( "Yelp" , "Google" ) yelp_google_tbl . scatter( "Yelp" , "Google" ) # Don't change/edit/remove the following line. # To help you make conclusions, we have plotted a straight line on the graph (y=x). plt . plot(np . arange( 2.5 , 5 , .5 ), np . arange( 2.5 , 5 , .5 )); 1
2
Question 3. Looking at the scatter plot you just made in Question 1.2, do you notice any pattern(s) or relationships between Yelp and Google ratings (i.e. is one of the two types of scores consistently higher than the other one)? If so, describe them briefly in the cell below. (8 Points) The plot shows that both Google and Yelp have a correlating relationship with each other in which the plot shows a positive increase in scores. But it seems like Google has a slightly better ratings than Yelp. 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
4
Question 6. Edwin thinks that burritos in San Diego are cheaper (and taste better) than the burritos in Berkeley. Plot a histogram that visualizes that distribution of the costs of the burritos from San Diego in the burritos table. Also use the provided cost_bins variable when making your histogram, so that the histogram is more visually informative. (8 Points) In [127]: cost_bins = np . arange( 0 , 15 , 1 ) # Do not change this line # Please also use the provided bins burritos . hist( "Cost" ) 5
6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 2. At the moment, the Job column of the sf table is not sorted (no particular order). Would the arrays you generated in the Jobs column of the previous question be the same if we had sorted alphabetically instead before generating them? Explain your answer. To receive full credit, your answer should reference how the .group method works, and how sorting the Jobs column would affect this. (8 Points) Note: Two arrays are the same if they contain the same number of elements and the elements located at corresponding indexes in the two arrays are identical. An example of arrays that are NOT the same: array([1,2]) != array([2,1]) . When we use the method .group, we are grouping values with a specific type of uniqueness. Both of the orga- nizations ahve the same values so when we apply the .sort function, python can’t distinguish the differences. 7
8
Question 4. Why might some of the row values be 0 in the department_ranges table from the previous question. (8 Points) _Because some of the jobs in that department had no compensation. There are probably no job positions in that department so no one was getting paid. 9
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
10