Spaces:
Sleeping
Sleeping
File size: 519 Bytes
bdca7fa |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import pandas as pd
df = pd.read_csv("candidatelist.txt", sep = "\t")
df.columns
df["StatusCode"].value_counts()
# filter out withdraw or did not qualify
df = df[df["StatusCode"] != "WIT"]
df = df[df["StatusCode"] != "DNQ"]
df["StatusCode"].value_counts()
# filter for orange county
df["County"].value_counts()
ora = df[df["County"] == "ORA"]
ora = ora.dropna(subset="TrsNameFirst")
ora["website"]= ora["TrsNameFirst"]+ora["TrsNameLast"]+".com"
ora["website"]
ora.to_csv("orange_county_Candidates.csv")
ora.tail() |