@Yuechean wrote:
I want to create a pop-up, modal, or confirm dialog when the file user upload is not a CSV file. Can anyone teach me how to do it?
Below is the code:
def parse_contents(contents, filename): content_type, content_string = contents.split(',') decoded = base64.b64decode(content_string) if 'csv' in filename: # Assume that the user uploaded a CSV file return pd.read_csv( io.StringIO(decoded.decode('utf-8')))
Posts: 1
Participants: 1