When I store the uploaded file as a variable and call the uploaded file once to store inside a variable, there seems to be no issues with it. But when I reference the uploaded file a second time to store it in another variable I get the following error:
Here is my code:
@st.cache() def read_pdf(file, coordinates, page): df = tabula.read_pdf(file, area = coordinates,pages = page) return df pg2_df = read_pdf(uploaded_file,(11.858,174.267,151.088,565.947),'2') df2 = read_pdf(uploaded_file,(204.638,176.333,756.968,556.538),'1')
As you can see, I am referencing the uploaded file in two variables which causes this error to occur.