Uploaded October 2019 | Updated November 2026, 17 hours ago
A line race chart showing worldwide web search traffic (Google search) for major U.S. sports leagues over time.
All major U.S. sports leagues show a general upward trend in worldwide search interest over time. The NFL and NBA have had similar web interest during the peaks of their seasons over time until 2018 and 2019 where search volume for the NBA reached new heights during the NBA Playoffs.
Note that this graph shows worldwide web search volume. If restricted to U.S. web searches, interest in the NFL dominates for most years since 2004, although interest in the NBA is getting closer to that of the NFL in recent years.
Tools:
R, Flourish, OBS Studio, Move Maker
Sources:
Data:
Google Trends: trends.google.com/trends/explore?date=all&q=NFL,NBA,MLB,NHL
Music:
––––––––––––––––––––––––––––––
Buddha by Kontekst soundcloud.com/kontekstmusic
Creative Commons — Attribution-ShareAlike 3.0 Unported — CC BY-SA 3.0
Free Download / Stream: bit.ly/2Pe7mBN
Music promoted by Audio Library youtu.be/b6jK2t3lcRs
––––––––––––––––––––––––––––––
A line race chart showing worldwide web search traffic (Google search) for major U.S. sports leagues over time.
All major U.S. sports leagues show a general upward trend in worldwide search interest over time. The NFL and NBA have had similar web interest during the peaks of their seasons over time until 2018 and 2019 where search volume for the NBA reached new heights during the NBA Playoffs.
Note that this graph shows worldwide web search volume. If restricted to U.S. web searches, interest in the NFL dominates for most years since 2004, although interest in the NBA is getting closer to that of the NFL in recent years.
Tools:
R, Flourish, OBS Studio, Move Maker
Sources:
Data:
Google Trends: trends.google.com/trends/explore?date=all&q=NFL,NBA,MLB,NHL
Music:
––––––––––––––––––––––––––––––
Buddha by Kontekst soundcloud.com/kontekstmusic
Creative Commons — Attribution-ShareAlike 3.0 Unported — CC BY-SA 3.0
Free Download / Stream: bit.ly/2Pe7mBN
Music promoted by Audio Library youtu.be/b6jK2t3lcRs
––––––––––––––––––––––––––––––
![How To Add a Column to a Data Frame in Pandas (Python)
This video shows 3 ways to add new columns to Pandas Data Frames in Python. Adding new columns is a basic data manipulation task that is a common part of the data cleaning and wrangling process.
If you find this video useful, like, share and subscribe to support the channel!
► Subscribe: https://www.youtube.com/c/DataDaft?sub_confirmation=1
Code used in this Python Code Clip:
import pandas as pd
import statsmodels.api as sm #(To access mtcars dataset)
mtcars = sm.datasets.get_rdataset(mtcars, datasets, cache=True).data
mtcars.head()
# Method #1: Direct Column Assignment
mtcars[new_1] = mtcars.mpg > 20
mtcars.head()
# Method #2: Use .insert()
mtcars.insert(2, # Where to insert
new_2, # Name of new column
mtcars.mpg > 25) # What to insert
mtcars.head()
# Method #3: Use .assign()
mtcars = mtcars.assign(new_3 = mtcars.mpg > 15, # New column
new_4 = mtcars.mpg > 30) # Another new column
mtcars.head()
* Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! I will use Unicode large < and > symbols in place of the standard sized ones. .
⭐ Kite is a free AI-powered coding assistant that integrates with popular editors and IDEs to give you smart code completions and docs while you’re typing. It is a cool application of machine learning that can also help you code faster! Check it out here: https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=datadaft&utm_content=description-only How To Add a Column to a Data Frame in Pandas (Python)](https://i.ytimg.com/vi/6WmNmAdX5wU/mqdefault.jpg)


![How To Generate Random Numbers in R
This video shows how to reverse vectors, strings and data frames by both columns and rows in R.
Code used in this clip:
# Initialize random number generator
set.seed(12)
# Generate data uniformly within a given range
runif(100, min = 0, max = 10)
# Generate normally distributed data
random_normal <- rnorm(10000, mean = 10, sd = 1)
plot(density(random_normal))
# Generate data by sampling from a vector
die <- c(1,2,3,4,5,6)
# Simulate rolling tow dice and adding the result
two_dice <- sample(die, size = 10000, replace = TRUE) +
sample(die, size = 10000, replace = TRUE)
table(two_dice)
# Sample rows from a data frame
data <- mtcars
index <- sample(1:nrow(data),
size = 10,
replace = FALSE)
data[index,]
Code Clips are basic code explanations in 3 minutes or less. They are intended to be short reference guides that provide quick breakdowns and copy/paste access to code needed to accomplish common data science tasks. Think Stack Overflow with a video explanation.
* Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! For R that means I may use = for assignment and the special Unicode large < and > symbols in place of the standard sized ones for dplyr pipes and comparisons. These special symbols should work as expected for R code on Windows, but may need to be replaced with standard greater than and less than symbols for other operating systems. How To Generate Random Numbers in R](https://i.ytimg.com/vi/8UyfDajCt4U/mqdefault.jpg)






![How to Join Data Frames in Pandas (Python)
↓ Code Available Below! ↓
This video shows how to join pandas data frames using the merge function. Joining data that resides in different tables is a common data preparation task when creating an analytical data set from multiple sources. The merge function allows you to perform inner, outer, left and right joins by changing the how argument.
If you find this video useful, like, share and subscribe to support the channel!
► Subscribe: https://www.youtube.com/c/DataDaft?sub_confirmation=1
Code used in this Python Code Clip:
import pandas as pd
data1 = pd.DataFrame({character: [Goku,Vegeta, Nappa,Gohan,Piccolo],
power level: [12000, 16000, 4000, 1500, 3000],
uniform color: [orange, blue, black, orange, purple]})
data2 = pd.DataFrame({character: [Gohan,Goku, Tien,Krillin,Yamcha],
power level: [1500, 12000, 2000, 2000, 1500],
unif_color: [purple, orange, green, orange, orange]})
data1
data2
# Use df.merge() to join data frames
data1.merge(data2,
how = outer, # join type
on=character) # key column to join on
# Join on multiple key columns
data1.merge(data2,
how = outer, # join type
on = [character, power level]) # join on multiple cols
# Join columns with different names
# Rename columns so that they match
data2.rename(columns={unif_color:uniform color}, inplace=True)
# Then join the data
data1.merge(data2,
how = outer,
on = [character, power level, uniform color])
* Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! I will use Unicode large < and > symbols in place of the standard sized ones. .
⭐ Kite is a free AI-powered coding assistant that integrates with popular editors and IDEs to give you smart code completions and docs while you’re typing. It is a cool application of machine learning that can also help you code faster! Check it out here: https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=datadaft&utm_content=description-only How to Join Data Frames in Pandas (Python)](https://i.ytimg.com/vi/9uc0f5s0ioc/mqdefault.jpg)