Created
August 17, 2021 09:27
-
-
Save duarteocarmo/60426940cb7ed8001b9a8202f7d69a20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas | |
def remove_bad_cols(dataframe): | |
return df.drop( | |
labels=df.columns.difference(["passengerid", "price_paid"]), axis=1 | |
) | |
def add_inflation_to_price(dataframe): | |
df["price_paid_inflation"] = df.price_paid * 1.3 | |
return df | |
df = pandas.DataFrame( | |
{ | |
"col1": [1, 2], | |
"col2": [3, 4], | |
"passengerid": [2, 3], | |
"price_paid": [4, 5], | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment