Want to avoid tons of NaNs when grouping with Grouper in #Python #Pandas? Trim the dates to avoid extremes: ( df .loc[ pd.col('tpep_pickup_datetime').dt.month == 11 ] .groupby(pd.Grouper(key='tpep_pickup_datetime', freq='14D'))['trip_distance'].mean() )
1 repost3 likes