import pandas as pd # Load the input file file_path = 'Air_Quality_Data_with_Dates_2020.xlsx' # Replace with your file path data = pd.read_excel(file_path, sheet_name='Sheet1') # Fill missing values using interpolation and convert them to integers data["Calculated PM2.5 AQI"] = data["Calculated PM2.5 AQI"].interpolate(method='linear').round(0).astype(int) data["Calculated PM10 AQI"] = data["Calculated PM10 AQI"].interpolate(method='linear').round(0).astype(int) # Save the updated file output_file_path = 'Air_Quality_Data_Filled_Integer.xlsx' data.to_excel(output_file_path, index=False) print(f"File with filled integer values has been saved as {output_file_path}.")