Skip to content
New Workbook
Sign up
Course Notes: Python for Spreadsheet Users

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
  1. .sort_values('column_name', ascending = boolean)

  2. df = df[df['column_name'] = 'how do you wanna filter']

  3. 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

  4. Function: pd.ExcelFile

  5. Methods: workbook.parse() turns individual sheets into DFs. does something for us.

  6. Attributes: workbook.sheet_anmes gives somethiing to us.

  7. Methods

  8. str.lower(), str.upper(), str.title(), str.strip()
  9. DF.drop('DF column', axis=1) - to drop one column out of the DF
  10. To Join/Vlookup: DF1.merge('DF2', on= 'key column name', how = 'left/right')
  11. oder DF1.merge('DF2', left_on= 'key column name', right_on= 'key coulmn name', how = 'left/right')

    VISUALISATION

  12. imprt seaborn as sns

  13. sns.barplot(x='df col', y='df col', data='df col', hue='df col segregation')

  14. sns.set_style('whitegrid') oder you can also set it according to your banner style

  15. sns.despine() remove upper abd right borders from plot

  16. plt.legend(bbox_to_anchor = (1,1))