Data 8R Summer 2017

Review of Table Methods Discussion 8: July 18, 2017

We have the dataset trips, which contains data on trips taken as part ofa Bay Area bikesharing program. The first few rows of the table are shown below:

We want to know how many trips were long trips, for various values of length. Write a function num_long_trips that, given a particular duration, finds the number of trips above that duration.

Now write a function, percent_long_trips, that, given a particular duration, finds the percentage of trips above that duration.

We find that most trips have smaller length, but a few are very long. We want to see what the distribution of commute lengths looks like, and reason that commuters will tend of have trips of smaller length. We also figure that commuters will be subscribers to the program, not one-time users. Write a function, commuter_distribution, that, given a particular duration, creates a histogram of trip lengths for trips below that duration, where each trip was taken by someone with a Subscriber Type of Subscriber. Have the function return the average trip length for trips in the histogram.

2

Review of Table Methods

Now let’s consider the locations of the trip. Create a new table station_data, with two columns: station and number_of_trips. Which station had the most departures? Save the name of this station as busiest_station.

Now, write a function that calculates the average trip duration for trips leaving from a given station. Name it avg_trip_length.

Add a new column, trip_length to the station_data table, consisting of the average trip length for the station in question.

Now add a fourth column, total_trip_time to the station_data table, consisting of the total duration of all trips that started at that station.

Finally, let’s consider the ridership of each station. First, write a function that takes in an array of strings, where each string is either "Subscriber" or "Customer", and returns the percentage of values that are the string "Subscriber".

Now, using that function, find the percentage of riders that are subscribers, for each station. Name the station that has the highest percentage of subscribers high_commute_station. Consider how you could do this with either group or apply. What extra step would be needed to use apply?

Data 8R Review of Table Methods Summer 2017 - GitHub

Jul 18, 2017 - We find that most trips have smaller length, but a few are very long. We want to see what the distribution of commute lengths looks like, and ...

151KB Sizes 0 Downloads 289 Views

Recommend Documents

Data 8R Review of Table Methods Summer 2017 - GitHub
Jul 18, 2017 - We also figure that commuters will be subscribers to the program, not one-time users. ... return np.mean(short_commute.column( Duration ) ...

Data 8R Table Methods and Functions Summer 2017 1 ... - GitHub
Jul 18, 2017 - We have the dataset trips, which contains data on trips taken as part ofa ... def num_long_trips(cutoff): ... We want to see what the distribution of.

Data 8R Table Methods and Functions Summer 2017 1 ... - GitHub
Jul 18, 2017 - Data 8R. Table Methods and Functions. Summer 2017. Discussion 7: ... its range - the difference between the highest value in the array and.

Data 8R Plotting Functions Summer 2017 1 Midterm Review ... - GitHub
Data 8R. Plotting Functions. Summer 2017. Discussion 7: July 20, 2017. 1 Midterm Review. Question 4 ... function onto the table: Hint: Velocity = distance / time.

Data 8R Plotting Functions Summer 2017 1 Midterm Review ... - GitHub
Jul 20, 2017 - In physics calculations, we often want to have the data in terms of centimeters. Create a table called cm table that has the original data and a ...

Data 8R Hypothesis Testing Summer 2017 1 Terminology 2 ... - GitHub
Jul 27, 2017 - simulated on a computer. ... From the histogram, it looks like the higher mean from gambling was not at all that unusual - it certainly could have.

Data 8R Tables and more Visualizations Summer 2017 1 ... - GitHub
Jul 11, 2017 - At the same time, the researcher also records the number of ... A business has graphed the proportion of outputs in each year as a bar chart.

Data 8R Tables and more Visualizations Summer 2017 1 ... - GitHub
number of colds each volunteer gets. Is this an observational ... questions about it. A business has graphed the proportion of outputs in each year as a bar chart.

Data 8R Data Types and Arrays Summer 2017 1 A Test of Skill - GitHub
1 A Test of Skill ... errors) of the following lines of Python code! >>> 6 / 3 ... Luckily, they've supplied a function named bar(labelArray, dataArray) to do.

Data 8R Data Types and Arrays Summer 2017 1 A Test of Skill - GitHub
Data 8R. Data Types and Arrays. Summer 2017. Discussion 4: July 6, 2017 ... Impress the squirrels with your knowledge of data types! .... 4 Data Manipulation.

Data 8R Intro to Python Summer 2017 1 Express Yourself! 2 ... - GitHub
Mike had a tremendous growth spurt over the past year. Find his growth rate over this 1 year. (Hint: The Growth Rate is the absolute difference between the final.

Data 8R Intro to Visualizations Summer 2017 1 Similarity and ... - GitHub
Jun 27, 2017 - The chips that are present in your computer contain electrical components called transistors. ... Here's another attempt to improve the plot:.

Data 8R Intro to Python Summer 2017 1 Express Yourself! 2 ... - GitHub
An expression describes to the computer how to combine pieces of data. ... inputs to a call expression are expressions themselves, you can have another call ...

Table of Contents - GitHub
random to receive a new welfare program called PROGRESA. The program gave money to poor families if their children went to school regularly and the family used preventive health care. More money was given if the children were in secondary school than

Table of contents - GitHub
promotion about guide login_id login ID login_password login password email_generate_key generated key for certificating email email_certified_at timestamp ...

Innovative Projects Summer 2017 - GitHub
Jan 31, 2017 - 10. Page 2 http://nokiawroclaw.pl/ https://github.com/nokia-wroclaw/ .... Develop a tool that will notify person via android app that some system ...

Innovative Projects Summer 2018 - GitHub
Jan 31, 2018 - information is sent to administrator who will be ensure all requirements are met. • which can be integrated with 3rd party access control system. – send to system information about bookings. – get from the system information abou

summer math review packet 2017.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. summer math ...

2017 Summer Camp RegFormAndProjectReleaseForm_secured.pdf
Page 1 of 1. 2017 Summer Camp RegFormAndProjectReleaseForm_secured.pdf. 2017 Summer Camp RegFormAndProjectReleaseForm_secured.pdf. Open.

lecture 15: fourier methods - GitHub
LECTURE 15: FOURIER METHODS. • We discussed different bases for regression in lecture. 13: polynomial, rational, spline/gaussian… • One of the most important basis expansions is ... dome partial differential equations. (PDE) into ordinary diffe

Table 1: Demonstration of a simple table. Right Left Center ... - GitHub
Page 1. Table 1: Demonstration of a simple table. Right Left Center Default. 12 12. 12. 12. 123 123. 123. 123. 1 1. 1. 1. Table 1 is from the Pandoc User's Guide. A simpler table is given by table 2: Table 2: Even simpler. A B. 0. 1. 1.

SIMS Review Process - GitHub
Analytics. Trello analytics. Sketches. Review of storage. Lookbook. Example: If you ... The learning phase is the analysis of all the monitoring information after the ...