Skip to content

Instantly share code, notes, and snippets.

@ben-n93
Created March 3, 2023 11:05
Show Gist options
  • Save ben-n93/8312996fb3ffe186deeeda31432cb2dd to your computer and use it in GitHub Desktop.
Save ben-n93/8312996fb3ffe186deeeda31432cb2dd to your computer and use it in GitHub Desktop.
import pandas as pd
df = pd.read_csv("./data/horror_films.csv")
df.drop_duplicates(inplace=True)
table = pd.pivot_table(data=df,index='Setting', values='Film', aggfunc='count')
table.to_csv("./data/cleaned_horror_films.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment