Table Methods and Functions Discussion 7: July 18, 2017
Selecting Rows from Tables
We have the dataset football, which contains the winning and losing scores of all NFL games in the 2016/2017 season. It’s organized as follows: Date 2016-09-08 2016-09-11 2016-09-12
HomeTeam Carolina Tampa Bay LA Rams
AwayTeam Denver Atlanta San Francisco
HomeScore 20 24 0
AwayScore 21 31 28
Add a new column margin to the table, listing the scoring margin in each game. Don’t worry about which team won.
Make a new table, named blowouts, containing only games that were won by a margin of 30 points or more.
Now make a table, high_scoring, containing only games where both teams scored at least 30.
Now let’s consider the largest margins. Make a new table, largest_margins, containing the top ten margins seen.
There are two teams from New York - the Jets and the Giants - and both contain 'NY' in their name in this table. Did they meet during the 2016/17 season? Write an expression that would help you find out.
2
2
Table Methods and Functions
Defining Functions
Write a function that takes an array and returns its range - the difference between the highest value in the array and the lowest. def range(array):
Write a function that takes two strings and prints a third string, which consists of the first two strings with a comma (,) in between them. def combine_strings(str1, str2):
Write a function that takes an array and returns an array of proportions, where each value represents its proprotion of the original array def proportions(array):
Write a function that takes three positive numbers and returns the sum of the squares of the two largest numbers. def two_of_three(a, b, c):
Write a function that takes a string, and prints it out with any appearance of the string ”trees” replaced by the new string, ”STANFORD SUCKS”. Then, it returns another string, with any appearance of the string ”Berkeley” replaced by the new string, ”GO BEARS”. def cal_string_func(string):
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.
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.
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 ...
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 ) ...
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 ...
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.
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.
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.
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. Discussion 4: July 6, 2017 ... Impress the squirrels with your knowledge of data types! .... 4 Data Manipulation.
Jun 27, 2017 - The chips that are present in your computer contain electrical components called transistors. ... Here's another attempt to improve the plot:.
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.
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 ...
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 ...
expected discounted cumulative reward an agent will receive after ... Domains. Task Descriptors. Figure 3: Task Descriptors. From left to right: Breakout TG, ...
Since the successor function can increment by one, we can easily find primitive ... Here we have used the convention of ending predicate names with â?â; in this .... that is, functions that are undefined, or divergent, at some values in the domai
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
effect of element mutual coupling on both signal and noise response of the .... evlamemo69.pdf ..... {10o, 20o, 30o, 40o, 50o}, which give rise to a rank-five voltage covariance matrix. ... An illustration of two sets of CBFPs for modeling the.
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Wildwood 2017 ...
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.
you screw up, restore it with: $ cd ~/Workshop2007 ... cp -a (/net/birch)/data/oms/Workshop2007/demo.MS . ... thus, âskeletonâ: we ignore the data in the MS.
OI 1.8: Smoking habits of UK Residents: A survey was conducted to study the smoking habits ... create the scatterplot here. You can use ... Go to the Spurious Correlations website: http://tylervigen.com/discover and use the drop down menu to.