Last active
June 23, 2019 07:22
-
-
Save erichooi/412747f78697b18af4e25677cef90d19 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
data = pd.DataFrame() | |
for col in _data.columns: | |
if col != "bookingID" and col != "label": | |
temp = _data.groupby("bookingID")[col].agg(["mean", "sum", "max", "min"]) | |
data[col + "_mean"] = temp["mean"] | |
data[col + "_sum"] = temp["sum"] | |
data[col + "_max"] = temp["max"] | |
data[col + "_min"] = temp["min"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment