Conteúdo do Curso
Introduction to Python for Data Analysis
Introduction to Python for Data Analysis
2. Introduction to Python 2/2
3. Explore Dataset
Data StudyOperations with the FileHow to Explore the DataSorting DataMax, min, mean, medianChallengeGroup DataDive Deeper into Grouping DataGroup Data 2.0Introduction to NumPyPivot TablesRecall Loops.loc FunctionDeal with Several ConditionsChallengeVisualization: First StepsDive Deeper into Visualization
How Much Do We Earn
You may recognize the column 'money_spent'
that corresponds to the amount of money the user spent and gained. In this chapter, we will find if there is any dependence between the day of the week and the amount of money we have!
But firstly, recall some functions:
Group Data:
df = df[['columns which we group']] .groupby(['columns on which we group'])
Visualization:
sns.barplot(df = DataFrame, x = 'column for x-axis', y = 'column for y-axis') plt.show()
Tarefa
Swipe to start coding
- Group data:
- Extract only columns
'day', 'money_spent'
from thedf
DataFrame. - Group by the column
'day'
. - Apply
.mean()
function to groupeddf
. - Apply
.reset_index()
function.
- Create a barplot:
- Use
df
as the first argument. - Use column
'day'
for x-axis. - Use the column
'money_spent'
for the y-axis.
- Output barplot.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 4. Capítulo 8
How Much Do We Earn
You may recognize the column 'money_spent'
that corresponds to the amount of money the user spent and gained. In this chapter, we will find if there is any dependence between the day of the week and the amount of money we have!
But firstly, recall some functions:
Group Data:
df = df[['columns which we group']] .groupby(['columns on which we group'])
Visualization:
sns.barplot(df = DataFrame, x = 'column for x-axis', y = 'column for y-axis') plt.show()
Tarefa
Swipe to start coding
- Group data:
- Extract only columns
'day', 'money_spent'
from thedf
DataFrame. - Group by the column
'day'
. - Apply
.mean()
function to groupeddf
. - Apply
.reset_index()
function.
- Create a barplot:
- Use
df
as the first argument. - Use column
'day'
for x-axis. - Use the column
'money_spent'
for the y-axis.
- Output barplot.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 4. Capítulo 8