Course Notes
Use this workspace to take notes, store code snippets, or build your own interactive cheatsheet! The datasets used in this course are available in the datasets
folder.
# Import any packages you want to use here
Take Notes
Add notes here about the concepts you've learned and code cells with code you want to keep.
Add your notes here
# Add your code snippets here
-
.sort_values('column_name', ascending = boolean)
-
df = df[df['column_name'] = 'how do you wanna filter']
-
PIVOT TABLES: use sum() to sum up numericals only use groupby() and sum to sum up numericals according to a specified group/column use defined list ['', ''] if you want to groupby() several columns in your dataframe.
MULTIPLE SHEETS
-
Function: pd.ExcelFile
-
Methods: workbook.parse() turns individual sheets into DFs. does something for us.
-
Attributes: workbook.sheet_anmes gives somethiing to us.
-
Methods
-
str.lower(), str.upper(), str.title(), str.strip()
-
DF.drop('DF column', axis=1) - to drop one column out of the DF
-
To Join/Vlookup: DF1.merge('DF2', on= 'key column name', how = 'left/right')
-
oder DF1.merge('DF2', left_on= 'key column name', right_on= 'key coulmn name', how = 'left/right')
VISUALISATION
-
imprt seaborn as sns
-
sns.barplot(x='df col', y='df col', data='df col', hue='df col segregation')
-
sns.set_style('whitegrid') oder you can also set it according to your banner style
-
sns.despine() remove upper abd right borders from plot
-
plt.legend(bbox_to_anchor = (1,1))