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.

84KB Sizes 7 Downloads 316 Views

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

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

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

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

Perceptual Reward Functions - GitHub
expected discounted cumulative reward an agent will receive after ... Domains. Task Descriptors. Figure 3: Task Descriptors. From left to right: Breakout TG, ...

Recursive Functions - GitHub
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

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

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
6, 2006. © 2006 by the American College of Cardiology Foundation ... City, California). ..... correlates of serum aldosterone in the community: the Framingham.

Wildwood 2017 Summer (1).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. Wildwood 2017 ...

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.

1 Visibility Data & AIPS++ Measurement Sets - GitHub
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.

HW 2: Chapter 1. Data Exploration - GitHub
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.