# Fill NaNs race_history_df = race_history_df.fillna(0)
# Sort by horse and date race_history_df = race_history_df.sort_values(['horse_id', 'race_date']) winner carreras americanas
# Average speed figure last 3 races race_history_df['avg_speed_last3'] = ( race_history_df.groupby('horse_id')['speed_figure'] .transform(lambda x: x.rolling(3, min_periods=1).mean()) ) # Fill NaNs race_history_df = race_history_df
# Distance-specific win rate (precomputed per horse) race_history_df['dist_win_rate'] = ( race_history_df.groupby(['horse_id', 'distance'])['is_winner'] .transform('mean') ) winner carreras americanas
It sounds like you want to build a feature related to — likely a model or data pipeline to predict or identify the winner of American horse races (Carreras Americanas).
Select at least 2 products
to compare