Create dataframe from file in data table

Hi there - you’re really close! You’re getting this error because you’re passing the Media object directly into pd.read_excel(), which doesn’t understand Media objects. But you can write the Media out to a temporary file, and load it from there:

import anvil.media

with anvil.media.TempFile(data_file_row['file']) as filename:
  df = pd.read_excel(filename, sheet_name='Sheet_1')
4 Likes