Selecione o comando que projeta/seleciona apenas as colunas ‘home_team’ e ‘home_goal’ do DataFrame.

Quiz sobre Comandos do Spark

Quiz
•
Education
•
University
•
Medium
Marco Rezende
Used 2+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
df.withColumn(‘home_team’, ‘home_goal’)
df.filter(‘home_team’, ‘home_goal’)
df.select(‘home_team’, ‘home_goal’)
df.join(‘home_team’, ‘home_goal’)
df.project(‘home_team’, ‘home_goal’)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Selecione o comando que filtra apenas as partidas do palmeiras como visitante.
df.filter(df.away_team, ‘Palmeiras-SP’)
df.filter(df.away_team == ‘Palmeiras-SP’)
df.select(‘Palmeiras-SP’)
df.join(away_team, ‘Palmeiras-SP’)
df.filter(df.away_team = ‘Palmeiras-SP’)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Selecione o comando que filtra apenas as partidas do flamengo como mandante no ano de 2015.
df.filter(df.home_team == ‘Flamengo-RJ’ and df.season == 2015)
df.filter(df.home_team == ‘Flamengo-RJ’)
df.filter(‘Flamengo-RJ’, 2015)
df.join(home_team, ‘Flamengo-RJ’)
df.filter((df.home_team == ‘Flamengo-RJ’) & (df.season == 2015))
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Selecione o comando que renomeia a coluna “home_team” para “mandante” no DataFrame.
df.withRename(‘home_team’, ‘mandante’)
df.rename(‘home_team’, “mandante”)
df.withColumnRenamed(‘home_team’, ‘mandante’)
df.withColumnRename(‘home_team’, ‘mandante’)
df.rename(‘home_team’, col(‘mandante’))
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Selecione o comando que remove coluna “round” do DataFrame.
df.withDrop(‘round’)
df.drop(‘round’)
df.withColumn(‘round’)
df.withColumnRename(‘round’)
df.drop(‘home_team’)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Selecione o comando que informa a quantidade de linhas do DataFrame.
df.show()
df.collect()
df.rows()
df.shape()
df.count()
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Qual comando cria uma nova coluna chamada “vencedor” com valor dela sendo o nome do time que ganhou a partida, caso haja empate dê o valor “Empate”?
df.withColumn(‘vencedor’, when(df.home_goals > df.away_goals, df.home_team).when(df.home_goals < df.away_goals, df.away_team).otherwise(‘Empate’))
df.withColumn(‘vencedor’, when(df.home_goals == df.away_goals, ‘Empate’).otherwise(df.home_team))
df.withColumn(‘vencedor’, when(df.home_goals > df.away_goals, df.home_team).otherwise(‘Empate’))
df.withColumn(‘vencedor’, when(df.home_goals < df.away_goals, df.away_team).otherwise(‘Empate’))
df.withColumn(‘vencedor’, when(df.home_goals == df.away_goals, ‘Empate’).when(df.home_goals > df.away_goals, df.home_team).otherwise(df.away_team))
Create a free account and access millions of resources
Similar Resources on Quizizz
14 questions
SHALLOW FOUNDATION

Quiz
•
University
15 questions
Pretest Excel Kelas 9

Quiz
•
9th Grade - University
13 questions
Talent Management Quiz

Quiz
•
University
10 questions
Understanding my Neighbours

Quiz
•
University - Professi...
12 questions
Daylight lighting

Quiz
•
University
10 questions
Pandas Slicing Quiz1

Quiz
•
University
10 questions
Super Mega Baseball: Rules of Baseball Comprehension Questions

Quiz
•
1st Grade - University
15 questions
Past Perfect vs Past Perfect Continuous

Quiz
•
University
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade