Quiz sobre Comandos do Spark

Quiz sobre Comandos do Spark

University

10 Qs

quiz-placeholder

Similar activities

Present simple or continuous?

Present simple or continuous?

KG - University

10 Qs

Condições de elegibilidade e inelegibilidades

Condições de elegibilidade e inelegibilidades

University

10 Qs

Lebron James

Lebron James

3rd Grade - Professional Development

10 Qs

BCS Systems & Architecture Raymond's Quiz

BCS Systems & Architecture Raymond's Quiz

University - Professional Development

15 Qs

Chapter 2.4

Chapter 2.4

University

10 Qs

Home Team 001

Home Team 001

University

10 Qs

DATA

DATA

University

10 Qs

Let's Play Excel Excel...!

Let's Play Excel Excel...!

University

15 Qs

Quiz sobre Comandos do Spark

Quiz sobre Comandos do Spark

Assessment

Quiz

Education

University

Medium

Created by

Marco Rezende

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?