Skip to content

Instantly share code, notes, and snippets.

@smzn
Created January 30, 2024 14:52
日毎の販売回数の集計
#日毎の販売回数の集計
# Convert the 'DateTime' column to datetime objects
bakery_data['DateTime'] = pd.to_datetime(bakery_data['DateTime'])
# Extract the date from the 'DateTime' column
bakery_data['Date'] = bakery_data['DateTime'].dt.date
# Group by the date and count the number of transactions per day
daily_sales = bakery_data.groupby('Date')['TransactionNo'].nunique()
# Display the first few rows of the daily sales
daily_sales
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment