Spaces:
Build error
Build error
Update app.py
Browse files8 unmodified lines9101112131415168 unmodified linesdef load_data(file):file.seek(0) # Move to the start of the filedf = pd.read_csv(file)df['Date of Birth'] = pd.to_datetime(df['Date of Birth'], format='%Y-%m-%d')df['Visit Date'] = pd.to_datetime(df['Visit Date'], format='%Y-%m-%d')df['Age'] = df['Date of Birth'].apply(lambda dob: (dt.datetime.now() - dob).days // 365)return df8 unmodified lines9101112131415168 unmodified linesdef load_data(file):file.seek(0) # Move to the start of the filedf = pd.read_csv(file)df['Date of Birth'] = pd.to_datetime(df['Date of Birth'], format='%Y-%m-%d', errors='coerce')df['Visit Date'] = pd.to_datetime(df['Visit Date'], format='%Y-%m-%d', errors='coerce')df['Age'] = df['Date of Birth'].apply(lambda dob: (dt.datetime.now() - dob).days // 365)return df
app.py+2-2