import pandas as pd

PROCESSED_PATH = '/opt/airflow/data/processed/movies_clean.csv'
OUTPUT_PATH = '/opt/airflow/data/processed/movie_scores.csv'

def calculate_movie_score():
    df = pd.read_csv(PROCESSED_PATH)
    df['MovieScore'] = df[['IMDB_norm', 'RottenTomatoes_norm', 'Metacritic_norm']].mean(axis=1)
    df.to_csv(OUTPUT_PATH, index=False)
    print("Movie Scores calculated successfully!")