Data 8R Summer 2017 1

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.

#### Recommend Documents

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 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 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 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 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 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 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 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
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.

Physics-based basis functions - GitHub
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.

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.