Skip to content

Commit

Permalink
Add green taxis to the taxis dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed Oct 9, 2021
1 parent 483305e commit de49440
Show file tree
Hide file tree
Showing 3 changed files with 12,939 additions and 19,964 deletions.
5 changes: 4 additions & 1 deletion process/taxis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"tip_amount": "tip",
"tolls_amount": "tolls",
"total_amount": "total",
"color": "color",
}

PAYMENT_TYPES = {
Expand All @@ -35,8 +36,10 @@
.assign(dropoff_zone=raw["dolocationid"].map(loc["zone"]))
.assign(pickup_borough=raw["pulocationid"].map(loc["borough"]))
.assign(dropoff_borough=raw["dolocationid"].map(loc["borough"]))
.loc[lambda x: x["dropoff_borough"] != "EWR"]
.loc[lambda x: x.eval("dropoff - pickup").dt.seconds < MAX_TRIP_DURATION]
.loc[lambda x: x["fare"] > 0]
.loc[lambda x: (x["fare"] > 0) & (x["fare"] < 200)]
.loc[lambda x: (x["tip"] / x["fare"]) < 1]
)

clean.to_csv("taxis.csv", index=False)
Loading

0 comments on commit de49440

Please sign in to comment.