Spaces:
Sleeping
Sleeping
File size: 683 Bytes
76bfb75 bddf29f 76bfb75 bddf29f 76bfb75 bddf29f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
import pandas as pd
def process_excel(file):
# Read the Excel file
df = pd.read_excel(file.name)
# Perform any processing on the DataFrame here
return df.head() # Return the first few rows as an example
# Define the Gradio interface
interface = gr.Interface(
fn=process_excel, # The function to process the uploaded file
inputs=gr.File(type="file", label="Upload Excel File"), # File upload input
outputs="dataframe", # Display the output as a DataFrame
title="Excel File Uploader",
description="Upload an Excel file to see the first few rows."
)
# Launch the interface
if __name__ == "__main__":
interface.launch()
|