Question

how to compute the average speed for each location?

for example the pair is the location. how can I get all the locations of 1,2,3,4,5,6,7,8,9,10,11,12,13,14 and the speed for each of them to find the mean.

I tried doing this

df4=df [df [ ['pair', 'speed']]==1].mean() #To get all the pairs with 1's and it's speeds and getting the mean

df4=df [df [['pair','speed']]==2].mean() #To get all the pairs with 2's and it's speeds and getting the mean

.Unnamed: 0 speed period warning pair 26 2 26 3 26 26 5 27 28 7 28 28 28 29 29 12 29 13 29 29 29 29 29 30 30 10 10 12 13 14 15

0 0
Add a comment Improve this question Transcribed image text
Answer #1

To get the mean of speeds where pair is 1, enter following command

df.loc[df['pair']==1,'speed'].mean()

assuming df is the name of dataframe

to get the mean where pair =2, command is

df.loc[df['pair']==2,'speed'].mean().

and so on

Add a comment
Know the answer?
Add Answer to:
How to compute the average speed for each location? for example the pair is the location. how can...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A soft drink manufacturer uses fire agents to handle premium distribution for is various products. The marketing director desired to study the timeliness with which the premiums are distributed. Twent...

    A soft drink manufacturer uses fire agents to handle premium distribution for is various products. The marketing director desired to study the timeliness with which the premiums are distributed. Twenty transactions for each agent were selected at random and the time lapse (in days) for handling each transaction was determined. The results follow: Agent 1 Agent 2 Agent 3 Agent 4 Agent 5 24 18 10 15 33 24 20 11 13 22 29 20 8 18 28 20 24...

  • Assembly Language Programming Assignment program must be in: MASM assembly language / x86 architecture / irvine...

    Assembly Language Programming Assignment program must be in: MASM assembly language / x86 architecture / irvine library procedures Objectives: 1. using register indirect addressing 2. passing parameters 3. generating “random” numbers 4. working with arrays Description: Write and test a MASM program to perform the following tasks: 1. Introduce the program. 2. Generate ARRAYSIZE random integers in the range [LO = 10 .. HI = 29], storing them in consecutive elements of an array. ARRAYSIZE should be set to 200....

  • Therefore, for this program you will read the data in the file named weatherdata_2.txt into arrays...

    Therefore, for this program you will read the data in the file named weatherdata_2.txt into arrays for the wind speed and for the temperature. You will then use the stored data to calculate and output the average wind speed and the average temperature. Create a constant with a value of 30 and use that to declare and loop through your arrays and as a divisor to produce your averages. Here is the data file (below). 1. 14 25 2. 12...

  • For each variable of interest, do the following: 1. Find the mean, five-number summary, range, variance,...

    For each variable of interest, do the following: 1. Find the mean, five-number summary, range, variance, and standard deviation. Display these numbers in a format that is easy to understand. 2. For each variable of interest, use its five-number summary to construct a boxplot. Each boxplot must be constructed horizontally, and must be accompanied by a brief descriptive paragraph that assesses whether the data appear to be symmetrical, left-skewed, or right-skewed. Construct a 95% confidence interval for the mean μ...

  • Game   Point_Differential   Assists   Rebounds   Turnovers   Personal_Fouls 1   15   15   38   11   9 2   36   20   43 &

    Game   Point_Differential   Assists   Rebounds   Turnovers   Personal_Fouls 1   15   15   38   11   9 2   36   20   43   8   13 3   16   21   29   7   13 4   45   22   46   11   11 5   12   11   40   7   22 6   -10   10   31   13   26 7   11   19   45   11   7 8   12   16   32   16   14 9   3   16   27   18   15 10   19   9   34   17   17 11   40   16   41   9   17 12   44   12   29   9   22 13   16  ...

  • 1. You are the new data scientist for Fitbit. When viewing the Google Analytics account associate...

    1. You are the new data scientist for Fitbit. When viewing the Google Analytics account associated with the Fitbit website., you notice that the Average Time on Site is 82 seconds. - Describe 4 different ways you can provide context for this metric. - For the sub-activity, refer to the attachment below entitled, "Image_Module_11.jpg" (the image is also embedded within the text below). Imagine that you have created an email campaign designed to drive users to your site. The email...

  • Determine how many CH2 and CH3, CH and C (no hydrogen) groups are in the molecule....

    Determine how many CH2 and CH3, CH and C (no hydrogen) groups are in the molecule. and how many proton groups are there. Does the spectra agree with this? Cholesterol in CDC13 Proton spectrum AAA M. T T 40 0.5 5 5,0 4.5 3.5 3.0 25 2.0 1,5 14 0 f1 (ppm) Cholesterol in CDC13 Carbon Spectrum ..demel. 135 130 80 10 50 145 140 125 120 115 110 105 100 95 90 85 70 75 f1 (ppm) 65 60...

  • Travel Data 10. Using your travel data: a. Develop a 95% confidence interval for your mean...

    Travel Data 10. Using your travel data: a. Develop a 95% confidence interval for your mean time to work (lunch) using time in minutes. b. What assumption is necessary for you to complete part (a)? Do you feel this assumption is valid? 119 B C A 1 TO WORK Time in Day of Week Minutes 2 Date Ce 2-Sep Monday 3-Sep Tuesday 4-Sep Wednesday 5-Sep Thursday 6-Sep Friday 9-Sep Monday 10-Sep Tuesday 11-Sep Wednesday 12-Sep Thursday 13-Sep Friday 16-Sep Monday...

  • Will give positive rating! AM/PM Method Assignment # 03: Calculate the early and late dates for the following activiti...

    Will give positive rating! AM/PM Method Assignment # 03: Calculate the early and late dates for the following activities, and create a bar chart. Assuming a Monday to Friday working week and the first activity starting on Dec 01 20XX. 1-Dec Activity A Activity B Activi Activity F Activity G 2 days da 3 da da 2 da Activity C Activity E 3 da 3 da SUNDAY MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY SATURDAY 2 4 Fulil Mocn NW 10 12...

  • For each variable of interest – Percent Time Asleep and Longevity – create a grouped frequency...

    For each variable of interest – Percent Time Asleep and Longevity – create a grouped frequency histogram. For each histogram, use a class width of 10; use a lower limit of 0 for Percent Time Asleep and 15 for Longevity. Each histogram must include an informative title, along with correct labels for both axes. For each histogram, include a paragraph that answers each of the following questions: Is the histogram symmetric, skewed to the left, or skewed to the right?...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT