You are viewing a single comment's thread from:

RE: Payment for Coding done

Calculate the average price for each month

monthly_average_prices = {}
for flight in sorted_data:
    year_month = flight["date"][:7]  # Extract year and month (e.g., "2023-09")
    if year_month not in monthly_average_prices:
        monthly_average_prices[year_month] = {"total_price": 0, "count": 0}
    monthly_average_prices[year_month]["total_price"] += flight["price"]
    monthly_average_prices[year_month]["count"] += 1

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.030
BTC 67315.59
ETH 2604.26
USDT 1.00
SBD 2.71