-4

I wanna understand this code in a feature engineering term

train['TransactionAmt_to_mean_card1'] = train['TransactionAmt'] / train.groupby(['card1'])['TransactionAmt'].transform('mean')
Anubhav Sinha
  • 150
  • 2
  • 16

1 Answers1

0

This function creates a new column that is the the “TransactionAmount” divided by the mean of the of the “TransactionAmount” for all the entries with the same value for “card1”.

David Kong
  • 578
  • 1
  • 5
  • 20