Question: The data for file home.txt is : 100 100 purple data for starbucks.txt is: 58 76 green data for dunks.txt: 97 45 orange please answer


The data for file home.txt is :
100
100
purple
data for starbucks.txt is:
58 76 green
data for dunks.txt:
97 45 orange
please answer it and write a python program.
Problem 3 Same idea as Problem 2, but now we'll use Manhattan distance as our distance measure. Given two points (x1, y1), (x2,y2), Manhattan distance is defined as: manhattan = |x2 x;l + ly2 yil The || signs represent absolute value. Python has a built-in abs function that comes in handy (example: a = abs(-5)). Calculate three things, and print them all out: Manhattan distance between my house and Starbucks, Manhattan distance between my house and Dunkin' Donuts, and The smaller (minimum) of the two distances. (You can use the same min function as last week for the bikes.) . For full credit under the documentation category, figure out and comment with the expected Manhattan distances. Do this before you start coding -- that way you know if your program works! # Test cases # House to Starbucks (Manhattan): # House to Dunkin' (Manhattan): Problem 4 Use matplotlib to plot all three locations (my house, Starbucks, and Dunks) on an x/y plane, using the colors from the files as the colors of the markers. Label your markers; your plot should look something like this: 100 home starbucks dunkin' 90 80 70 60 50 60 70 80 90 100 Problem 1 Open and read in the data from all three files. Read each line into its own variable, with the appropriate data type. Calculate and print the average x- and y-coordinates given by all three files. Problem 2 Now it's time to find out which coffeeshop is closest! We'll use Euclidean distance as our distance measure first, one of many ways that data scientists measure how far apart two data points are. Given two points (X1,91), (x2, y2), Euclidean distance is defined as: euclidean = |(x2 xy)2 + (y2 y)2 You can compute the whole thing using just the mathematical operators we covered last week. A square root is the same as raising to the 1/2 power. Calculate three things, and print them all out: Euclidean distance between my house and Starbucks, Euclidean distance between my house and Dunkin' Donuts, and The smaller (minimum) of the two distances. (You can use the same min function as last week for the bikes.) . . For full credit under the documentation category, figure out and comment with the expected Euclidean distances. Do this before you start coding -- that way you know if your program works! # Test cases # House to Starbucks (Euclidean): # House to Dunkin' (Euclidean)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
