Last active
January 1, 2021 02:15
-
-
Save justinhchae/0e79c9ef92fe07fa187003ae0277a2e0 to your computer and use it in GitHub Desktop.
Another example of a lambdas that changes all values
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
# replace all values with the same thing | |
df[col1] = df[col1].apply(lambda x: x.replace(year=2109, month=1, day=1)) | |
print(df[col1].head(2)) | |
# output | |
""" | |
event_date | |
2109-01-01 | |
2109-01-01 | |
... | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment