0% found this document useful (0 votes)
6 views4 pages

Data Science: Handling Missing Values

The document outlines a series of data analysis tasks using a dataset, including checking for missing values, calculating differences in passenger classes, and visualizing medal counts in the Olympics. It also includes code snippets for data manipulation using pandas, such as filling missing values, grouping data, and plotting graphs. Additionally, it discusses the performance of different countries in the Olympics and the analysis of park run participants.

Uploaded by

fernandostcampos
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Data Science: Handling Missing Values

The document outlines a series of data analysis tasks using a dataset, including checking for missing values, calculating differences in passenger classes, and visualizing medal counts in the Olympics. It also includes code snippets for data manipulation using pandas, such as filling missing values, grouping data, and plotting graphs. Additionally, it discusses the performance of different countries in the Olympics and the analysis of park run participants.

Uploaded by

fernandostcampos
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Check for missing values and deal with diff_1_2 = passengers_by_class[1] -

missing values. passengers_by_class[2] import pandas as pd


diff_2_3 = passengers_by_class[2] -
Load Dataset: passengers_by_class[3] df = pd.read_csv('[Link]')
df = pd.read_csv(‘my_file’) diff_1_3 = passengers_by_class[1] - [Link](30)
passengers_by_class[3] [Link](30)
Visualise the Dataset:
[Link](10) print(f"\nDifference between class 1 and 2: year_df = df[(df['Country'] == 'China') &
[Link](10) {diff_1_2}") (df['Year'] == 2008)]
print(f"Difference between class 2 and 3: gender_winner = year_df.groupby('Gender')
Check missing values: {diff_2_3}") ['Medal'].count()
Print([Link]().sum()) print(f"Difference between class 1 and 3:
{diff_1_3}") print(f'2008 in China who won more medals
Deal with missing values: were {gender_winner.idxmax()} with
# .mean() is the average {gender_winner.max()} medals')
df[‘Age’].fillna(df[‘Age’].median(), Give the 10 least successful countries
inplace=True) in Olympic history.
df[‘Embarked’].fillna(df[‘Embarked’].mode() Provide a pie chart to show the medals
[0], inplace=True) medal_counts = [Link]('Country') won in each sport by Iran in Olympics
df[‘Cabin’].fillna(‘Unknown’, inplace=True) ['Medal'].count() between 1976 and 2008.

least_successful = df_iran_1976_2008 = df[(df['Country'] ==


Provide the mean age for the female medal_counts.sort_values().head(10) 'Iran') & (df['Year'] >= 1976) & (df['Year'] <=
passengers. 2008)]
print(least_successful) sport_medals =
mean_age_female = df[df['Sex'] == df_iran_1976_2008.groupby('Sport')
'female']['Age'].mean() ['Medal'].count().sort_index()
Create a bar chart of the 10 most
print(f”Mean age of female passengers: successful countries in Olympics print(f"\n Medals on by Iran from 1976 to
{mean_female_age:.2f}”) History in terms of Gold Medals. 2008 are:\n {sport_medals}")

most_golden_medals = df[df['Medal'] == # Pie Chart


Code to median age and ticket price for 'Gold' ]['Country'].value_counts().head(10) [Link](figsize=(10, 6))
the passengers. sport_medals.plot(kind='pie',autopct='%1.1f
# Alternative method %%', startangle=90,
passenger_midian_age = df['Age'].median() gold_df = df[df['Medal'] == 'Gold'] wedgeprops={'edgecolor': 'black'})
fare_median = df['Fare'].median() goden_countries = [Link]('Iran`s Medals per Sport')
gold_df.groupby('Country')['Medal'].count() plt.tight_layout()
print("Median age of passengers: ", # Main method [Link]()
passenger_midian_age) gold_counts =
print("Median fare of tickets: ", fare_median) gold_df['Country'].value_counts().head(10) [Link]("[Link]")

print("The 10 most successfull golden


Give the average fare by passenger Countries are:\n" ,gold_counts.sort_values()) Create a bar chart to show the number
class. of golds, silvers and bronzes won by
# Plot Bar chart the USA between 1976 and 2008.
average_fare_by_class = [Link]('Pclass') [Link](figsize=(10, 6))
['Fare'].mean() gold_counts.plot(kind = 'bar', color = 'gold', df_usa = df[(df['Country'] == 'United
edgecolor = 'black') States') & (df['Year'] >= 1976) & (df['Year']
print('Average fare by class: ', <= 2008)]
average_fare_by_class) [Link]('Top 10 Countries with the most Gold medals_gotten =
Medals') df_usa['Medal'].value_counts().sort_index()
for pclass, fare in [Link]('Country')
passengers_average_fare.items(): [Link]('Number of Gold Medals') print("\nMedals won by USA from 1976 to
print(f"Pclass {pclass}: £{fare:.2f}") [Link](rotation = 45) 2008 are:\n", medals_gotten)
[Link](axis ='y', linestyle = '--', alpha = 0.7)
plt.tight_layout() # Bar Chart
Give the difference between the [Link]() [Link](figsize=(10, 8))
youngest and oldest passengers. medals_gotten.plot(kind='bar', color=['peru',
'darkgoldenrod', 'silver'])
age_min = df["Age"].min() Show the most success Olympics for [Link]('American Medals 1976 to 2008')
age_max = df["Age"].max() Iran between 1976 and 2008 in terms of [Link]('Quantity')
age_range = age_max - age_min the most golds and most medals. [Link]('Medal Class')
print(f"Youngest passenger age: [Link](rotation = 45)
{age_min}") iran_participation = df[(df['Country'] == [Link](axis='y', linestyle='--', alpha=0.7)
print(f"Oldest passenger age: {age_max}") 'Iran') & (df['Year'] >= 1976) & (df['Year'] <= plt.tight_layout
print(f"difference between oldest and 2008)] [Link]()
youngest: {age_range}") iran_total_medals =
iran_participation.groupby('Year')
['Medal'].count() Determine the athlete who has won the
Give the number of passengers in each iran_gold_medals = most number of medals in the olympics
of the passenger classes. iran_participation[iran_participation['Medal'] 1976 to 2008.
== 'Gold']
passengers_by_class = iran_gold_by_year = year_df = df[(df['Year'] >= 1976) &
df["Pclass"].value_counts().sort_index() iran_gold_medals.groupby('Year') (df['Year'] <= 2008)]
print("The number of passenger by class is: \ ['Medal'].count().sort_index() athlete_medal_counts =
n", passengers_by_class) most_gold_year = year_df.groupby('Athlete')['Medal'].count()
iran_gold_by_year.idxmax() best_athlete =
Another approach gold_count = iran_gold_by_year.max() athlete_medal_counts.idxmax()
class_passengers_number = total_medals = athlete_medal_counts.max()
[Link]('Pclass')['Name'].count() print("This is the total of Iran medals:",
print("\n The number of passengers in each iran_total_medals) print(f'The best athlete is {best_athlete}
class are: \n\n", class_passengers_number) print("This is the total of Iran Gold Medals", with a total of {total_medals}')
iran_gold_medals)
print("These are the Olympics with most Create a line graph that shows how
Give the difference between the gold:", iran_gold_by_year) many golds France got in the Olympics
number of passengers in each of the print(f"{most_gold_year} is the year Iran got between 1976 and 2008. Do not
passenger classes. most gold medals, summing the amount of include the 1980 olympics.
{gold_count} gold medals")
# Let's reuse the variable from previous df_france = df[(df['Year'].between(1976,
exercise 2008)) & (df['Year'] != 1980) & (df['Country']
# Calculate differences Compare who won the most medals == 'France') & (df['Medal'] == 'Gold')]
between China men and women at the medals_by_year = df_france.groupby('Year')
2008 olympics. ['Medal'].count()
total_medals = df_france['Medal'].count() tied_parks = parks[parks == bad_games = df_linux[['title','score']]
print(f"\nBetween 1976 and 2008, excluding max_count] print('\n This is it:', bad_games)
the year 1980, France won these gold print("This is it:", parks)
medals in each respective year medals\n print("This is it:", most_popular)
{medals_by_year}, summing a total of print("This is it:", tied_parks) Create a bar chart to show the
{total_medals}") frequencies in each score for the Lynx
platform.
# Line Bar The portion of all runners who belong
[Link](figsize=(8, 8)) to the sheffield club. Assume that no df_lynx = df[(df['platform'] == 'Lynx') &
count_golds.plot(kind='line', marker='o', two runners have the same name. (df['score'] < 7)]
color='darkgoldenrod') bad_games = df_lynx[['title','score']]
[Link]('France Gold Medals (1976-2008)') df_shef = df[df['club'] == 'Sheffield']
by_score = df_lynx.groupby('score')
[Link]('Year') belonging = df_shef['name'].nunique()
[Link]('Gold Medals') print("This is it:", belonging) ['title'].value_counts()
[Link](True) by_score_list = df_lynx.groupby('score')
[Link]() ['title'].apply(list)
Use only the information in the scatter print('\n This is it:', bad_games)
matrix to comment (as print('\n This is it:', by_score)
Calculate the total number of medals comprehensively as possible) on the
Germany received between 1976 and relationship
[Link](figsize=(10, 10))
2008. Exclude the 1980 and 1984 between bill_depth (measured in mm)
Olympics. and body_mass (measured in g). by_score.plot(kind='bar', color='orange',
edgecolor='black')
germany_df = df[(df['Year'].between (1976, [Link]('Bad Games')
2008)) & (~df['Year'].isin([1980, 1984])) & [Link]('Games')
(df['Country'] == 'Germany')] [Link]('Score')
total_medals = germany_df['Medal'].count() [Link](rotation=45)
[Link](axis='y', linestyle='--', alpha=0.7)
print(f'\n Between 1976 and 2008, excluding
1980 and 1984, Germany received plt.tight_layout()
{total_medals} medals') [Link]()

Find the genre that gets the most


Determine how many different runners editors_choices and which gets the
took part in park runs. Assume no two The scatter matrix reveals a moderate to least. The numbers should be as a
runners have the same name. strong negative correlation. Penguins with percentage of the all the games in the
deeper bills generally weigh less, while those
# Normalization specific genres.
with shallower bills tend to be heavier. This
df[['club', 'park']] = df[['club', trend is consistent across both females and
'park']].apply(lambda col: [Link]()) males, as seen by the strong negative editors_choices_per_genre =
correlation values (females: -0.775, males: - df[df['editors_choice'] == 'Y']
unique_runners = df['name'].nunique() 0.763). This pattern may also be influenced ['genre'].value_counts()
by species differences, with Adelie penguins total_per_genre = df['genre'].value_counts()
print(f'{unique_runners} runners took part in having deeper bills and lower body mass. percentage = (editors_choices_per_genre /
the park runs.') and Gentoo penguins having higher body
total_per_genre)/100
mass with shallower bills.
most = [Link](),
Determine how many veteran runners [Link]()
(runners over 55 years old) took part in Determine if there are missing values least = [Link](),
the Clumber Park run. and if there are deal with them. [Link]()
veterans_over_55 = df[(df['age'] > 55) & print('Missing values per column:')
df['park'] == 'Clumber']['name'].count() print('\n This is it: \n', percentage)
print([Link]().sum())
print('This is it:', veterans_over_55) print('\n This is it: \n', most)
# Dealing with missing values print('\n This is it: \n', least)
# Option 1: Drop rows with missing values
Determine how many runners from [Link](inplace=True)
Sheffield took part in the park runs. # Option 2: Fill missing values with a specific
value
sheffield_runners = df[df['club'] == df['genre'].fillna('Unknown', inplace=True) import pandas as pd
'Sheffield']['name'].nunique() import [Link] as plt
print('This is it:', sheffield_runners) print('\n Missing values per column after import numpy as np
filling:', [Link]().sum()) import seaborn as sns

Determine which club had the most and Predict Exam Scores based on Hours
least number of representatives at park Determine which year produced the Studied.
runs. games with the highest average score.
# Scatterplot for relationship between 'Hours
club_rep = [Link]('club') games_prod = [Link]('release_year') Studied' and 'Exam Score'
['name'].nunique() ['score'].mean() [Link](x='Hours Studied', y='Exam
most_rep = club_rep.agg(['idxmax', 'max']) highest_avg = games_prod.agg(['idxmax', Score', data=df)
least_rep = club_rep.agg(['idxmin', 'min']) 'max']) [Link]('Relationship between Hours Studied
print(club_rep) print('\n This is it:', games_prod) and Exam Score')
print("This is it:", most_rep) print('\n This is it:', highest_avg) [Link]('Hours Studied')
print("This is it:", least_rep) [Link]('Exam Score')
[Link](True)
Determine what was the mean age of Provide the Python Jupyter Notebook [Link]()
the runners from the Mansfield club. code to find the platform that has the
least games. # Extracting the columns and convert to
df_mansfield = df[df['club'] == 'Mansfield'] NumPY arrays
mean_age = df_mansfield['age'].mean() df_games = [Link]('platform') X = df[['Hours Studied']]
print("This is it:", mean_age) ['title'].count() y = df['Exam Score']
print('This is it', df['age'].dtype) # For least_games = df_games.agg(['idxmin',
Diagnostic 'min']) # Splitting the data into training and testing
print('\n This is it:', df_games) sets
print('\n This is it:', least_games) X_train, X_test, y_train, y_test =
Determine the most popular park for of games is: ', least_games_platform) train_test_split(X, y, test_size=0.2,
the runners. random_state=42)

parks = df['park'].value_counts() Find the games that have a review # Outputting


most_popular = [Link](['idxmax', 'max']) below 7 and are on the Lynx platform. (X_train.shape , X_test.shape, y_train.shape,
max_count = [Link]() y_test.shape)
# Filter for Series (To show the tied) df_linux = df[(df['platform'] == 'Lynx') &
(df['score'] < 7)] # Heatmap for correlation matrix
corr_matrix = [Link](numeric_only=True) print(final_df['Retail
Branding'].value_counts()) What was the most and less used
# Plotting the heatmap vaccine used in Hungary between the
[Link](figsize=(8, 8)) [Link](data=final_df, x='platform') 7th May 2021 and 11th June 2021.
[Link](corr_matrix, annot=True, [Link](rotation=45)
cmap='coolwarm', square=True) [Link]() df df_hungary =
[Link]('Correlation Matrix') df[df['date'].between('07/05/2021',
[Link]() avg_usage = final_df.groupby('device') '11/06/2021') & (df['location'] == 'Hungary')]
['monthly_mb'].mean().sort_values(ascendin used_vaccines =
# Creating a simple Linear Regression model g=False) df_hungary.groupby('vaccine')
model = LinearRegression() print(avg_usage.head(10)) ['total_vaccinations'].sum().sort_index()
most = used_vaccines.idxmax()
# Model Training figure_for_most = used_vaccines.max()
[Link](X_train, y_train) [Link](final_df.corr(numeric_only=Tru least = used_vaccines.idxmin()
e), annot=True, cmap='coolwarm') figure_for_least = used_vaccines.min()
# Predicting on test data [Link]()
y_pred = [Link](X_test) print(f"\n Figures for the applied vaccines
are: {used_vaccines}, the most used was
# Evaluating the model Check for missing values and deal with {most}: {figure_for_most}, and the least
mse = mean_squared_error(y_test, y_pred) missing values. used was {least}: {figure_for_least}")
r2 = r2_score(y_test, y_pred)
(mse, r2) pd.set_option('display.max_columns', None)
df['date'] = pd.to_datetime(df['date']) Determine the date of least on most
# Plotting the predicted values df_October_2021 = df[(df['date'].[Link] == vaccines in Japan.
[Link](figsize=(8, 5)) 2021) & (df['date'].[Link] == 10) &
[Link](X,y, color='blue', label='Actual (df['location'] != 'European Union')] df_japan = df[df['location'] == 'Japan']
Data') people_vaccinated = vaccination = df_japan.groupby('date')
regression_line = [Link](X) df_October_2021.groupby('location') ['total_vaccinations'].sum().sort_index()
[Link](X, regression_line, color='red', ['total_vaccinations'].count().sort_index() most_vac = [Link]()
label='Regression Line') least_vaccination_country = vaccine_fig_most = [Link]()
[Link]('Hours Studied vs Exam Score with people_vaccinated.idxmin() least_vac = [Link]()
Regression Line') vaccine_quantity = people_vaccinated.min() vaccine_fig_least = [Link]()
[Link]('Hours Studied') print(f"\n This is the number of people
[Link]('Exam Score') vaccinated in their respective locations:\n print(f"\n This is the Japan's date of least
[Link]() {people_vaccinated} and the quantity for vaccines is {least_vac}: {vaccine_fig_least}
[Link](True) the least vaccinated population is and the most vaccines is {most_vac}:
[Link]() {vaccine_quantity}.") {vaccine_fig_most}")

Integrar essas informações por meio de Determine which Country vaccinated Excluded the numbers for the European
junções (merges) e realizar uma análise the least number of people in October Union and create an appropriate chart
exploratória dos dados. 2021. Do not include the European that shows the most and to least
Union. popular vaccines in 2021
user_usage =
pd.read_csv("user_usage.csv") df['date'] = pd.to_datetime(df['date']) df['date'] = pd.to_datetime(df['date'],
user_device = df_October_2021 = df[(df['date'].[Link] == dayfirst=True)
pd.read_csv("user_device.csv") 2021) & (df['date'].[Link] == 10) & df_no_european = df[(df['location'] !=
android_devices = (df['location'] != 'European Union')] 'European Union') & (df['date'].[Link] ==
pd.read_csv("android_devices.csv") people_vaccinated = 2021)]
df_October_2021.groupby('location') vaccination =
print(user_usage.head(), '\n') ['total_vaccinations'].count().sort_index() df_no_european.groupby('vaccine')
print(user_device.head(), '\n') least_vaccination_country = ['total_vaccinations'].sum().sort_index()
print(android_devices.head(), '\n') people_vaccinated.idxmin() most_vac = [Link]()
# user_usage.info() vaccine_quantity = people_vaccinated.min() vaccine_fig_most = [Link]()
# user_device.info() print(f"\n This is the number of people least_vac = [Link]()
# android_devices.info() vaccinated in their respective locations:\n vaccine_fig_least = [Link]()
{people_vaccinated} and the quantity for extreme_vaccines =
merged_df = [Link](user_usage, the least vaccinated population is [Link][[least_vac, most_vac]]
user_device, on='use_id', how='left') {vaccine_quantity}.")
print(f"\n This is the non-European least
display(merged_df.head()) popular vaccine, {least_vac}:
display(merged_df.tail()) Determine whether the European Union {vaccine_fig_least}, and the most popular
or the United States Vaccinated more vaccines is {most_vac}:
eventual_issues = merged_df.isnull().sum() people. {vaccine_fig_most}")
print(eventual_issues)
df_eu_us = df[df['location'].isin(['European [Link](figsize=(10, 10))
merged_df.fillna({ Union', 'United States'])] extreme_vaccines.plot(kind='bar',
'user_id': -1, countries_vaccination = color=['green', 'blue'], edgecolor='black')
'platform': 'Unknown', df_eu_us.groupby('location') [Link]('Most and Least Popular Vaccines')
'platform_version': 'Unknown', ['total_vaccinations'].sum() [Link]('Vaccines')
'device': 'Unknown', most_vaccinator = [Link]('Quantity')
'use_type_id': -1 countries_vaccination.idxmax() [Link](rotation=45)
}, inplace=True) vaccines_applied = [Link](axis='y', linestyle='--', alpha=0.7)
countries_vaccination.max() plt.tight_layout()
fixed_issues = merged_df.isnull().sum() [Link]()
print(fixed_issues, '\n') print(f"\nThis is the country that most
vaccinated, {most_vaccinator}: [Link]("[Link]")
final_df = [Link](merged_df, {vaccines_applied}")
android_devices, left_on='device',
right_on='Device', how='left') Determine if France or Germany
print(final_df.isnull().sum()) Determine the most vaccinations were Vaccinated the most people in October
given in Hong Kong. 2022.
fixing_again = final_df.fillna({
'Retail Branding': 'Unknown', df_hong_kong = df[df['location'] == 'Hong df['date'] = pd.to_datetime(df['date'],
'Marketing Name': 'Unknown', Kong'] dayfirst=True)
'Device': 'Unknown', vac_by_date= df_hong_kong.groupby('date') df_oct_2022 = df[(df['date'].[Link] ==
'Model': 'Unknown' ['total_vaccinations'].sum() 10) & (df['date'].[Link] == 2022)]
}, inplace=True) most_vac = vac_by_date.idxmax() country_vaccinations =
vac_figure = vac_by_date.max() df_oct_2022.groupby('location')
print(final_df.isnull().sum()) ['total_vaccinations'].sum()
print(f'\n The most vaccinations in Hong top_country =
# Analytical Part Kong were {vac_figure} and happened on country_vaccinations.idxmax()
{most_vac}') top_value = country_vaccinations.max()
# Check if it was France or Germany variações e relação entre as modelo favorecer ou prejudicar
if top_country in ['France', 'Germany']: linhas. certos grupos.
print(f"{top_country} vaccinated the most 4. Como interpretar uma tabela 24. O que define a GDPR em
in October 2022 with {top_value} doses.") 4x4 com foco na linha 3, por relação aos dados?
else: exemplo? → Conjunto de regras da UE sobre
print(f"{top_country} vaccinated the most → Analisa-se apenas os dados da privacidade e proteção de dados
in October 2022 with {top_value} doses. So, terceira linha, comparando os pessoais.
neither France nor Germany were top.") valores nas colunas. 25. Por que a explicabilidade
5. Para que serve o método (explainability) é importante
groupby() no pandas? em modelos de IA?
Determine the least-used vaccine in → Agrupa dados por uma coluna → Garante transparência,
South Korea between April 2021 and para aplicar funções agregadas confiança e permite auditoria dos
April 2022. como mean() ou sum(). resultados.
6. Qual o uso de [Link]()
df['date'] = pd.to_datetime(df['date'], em um dataset numérico?
dayfirst=True) → Visualizar correlações entre
df_south_korea = df[(df['location'] == 'South variáveis numéricas.
Korea') & (df['date'].[Link] == 4) & 7. Explique o que é um gráfico de
(df['date'].[Link](2021, 2022))] dispersão e quando usá-lo.
period_of_vaccines = → Mostra a relação entre duas
df_south_korea.groupby('vaccine') variáveis numéricas; útil para
['total_vaccinations'].sum() detectar padrões.
least_sk = period_of_vaccines.idxmin() 8. Como identificar valores
least_fig = period_of_vaccines.min() ausentes em um DataFrame?
→ Usando [Link]().sum().
print(f"\n The {least_sk} was the least 9. Como substituir valores
administrated vaccine in South Korea. Only ausentes por uma string
{least_fig} applied") 'Unknown'?
→ df['coluna'] =
df['coluna'].fillna('Unknown').
Create a bar chart to show the top 5 10. O que value_counts() faz?
countries that used the → Conta a frequência de cada
Oxford/AstraZeneca in 2021. valor único em uma coluna.
11. O que é regressão linear
df['date'] = pd.to_datetime(df['date'], simples?
dayfirst=True) → Modelo que relaciona uma
df_astrazeneca_2021 = df[(df['vaccine'] == variável independente a uma
"Oxford/AstraZeneca") & (df['date'].[Link] variável dependente por uma linha
== 2021)] reta.
top_5 = 12. Qual é o propósito do
df_astrazeneca_2021.groupby('location') train_test_split()?
['total_vaccinations'].sum() → Dividir os dados em treino e
teste para avaliar o desempenho
print("\n This is", df_astrazeneca_2021) do modelo.
print("\n This is", top_5) 13. Cite duas métricas comuns de
avaliação em regressão linear.
[Link](figsize=(10, 10)) → r2_score e mean_squared_error.
top_5.plot(kind='bar', color='blue', 14. Como representar
edgecolor='black') graficamente a linha de
[Link]('Top 5 vaccines') regressão sobre os dados?
[Link]('Countries') → Usar [Link]() sobre o
[Link]('Quantity') [Link]().
[Link](rotation=45) 15. Para que serve o
[Link](axis='y', linestyle='--', alpha=0.7) LinearRegression() do sklearn?
plt.tight_layout() → Criar e treinar um modelo de
[Link]() regressão linear.
16. Quando é necessário usar
[Link]("vaccination_top_5.png") Dask em vez de pandas?
→ Quando os dados são muito
grandes para caber na memória.
Determine which vaccine was the most 17. Cite uma vantagem do
used in the United States for each of processamento paralelo.
the months provided. → Reduz o tempo de execução
dividindo tarefas entre múltiplos
df_usa = df[df['location'] == 'United States'] núcleos.
range_of_date = df_usa.groupby(['date', 18. O que é um DAG em sistemas
'vaccine'])['total_vaccinations'].sum() distribuídos?
most_common_per_date = → Grafo acíclico direcionado que
range_of_date.agg(['idxmax', 'max']) # representa dependências entre
Element and Figure of Max in the same tarefas.
line. 19. Por que a serialização é
importante em Big Data?
print(f"\n This is it:", range_of_date) → Permite salvar e transferir
print(f"\n This is it:", objetos complexos entre nós de
most_common_per_date) processamento.
20. O que é um autovalor
(eigenvalue)?
→ Valor escalar que, ao multiplicar
1. Explique brevemente os
um vetor próprio, não altera sua
quatro estágios do ciclo de
direção.
vida dos dados.
21. Qual é o objetivo da
→ Aquisição, pré-processamento,
diagonalização de matrizes?
análise/modelagem,
→ Simplificar cálculos, como
interpretação/comunicação.
potências de matrizes e sistemas
2. Como criar manualmente um
lineares.
DataFrame simples com
22. Como verificar se uma matriz é
pandas?
diagonalizável?
→ Usando [Link]({ 'nome':
→ Checar se possui número
['Ana'], 'idade': [22] }).
suficiente de autovetores
3. Ao observar um gráfico de
linearmente independentes.
linha com dois parâmetros, o
23. O que é viés algorítmico
que deve ser analisado?
(algorithmic bias)?
→ Tendência (aumenta/diminui),
→ Tendência sistemática de um

You might also like