import requests import pandas as pd from io import BytesIO # URL of the Excel file url = r'https://datamillnorth.org/download/2nx5n/a3be8bde-b1d5-4da1-bdf9-258c994c6960/Copy%20of%20Q1%2023-24%20Data%20Mill.xlsx' # Send a GET request to the URL response = requests.get(url) # Check if the request was successful if response.status_code == 200: # Use BytesIO to read the content of the response as a binary stream excel_file = BytesIO(response.content) # Read the Excel file into a DataFrame df = pd.read_excel(excel_file) # Display the DataFrame print(df) else: print(f"Failed to retrieve the file. Status code: {response.status_code}")