Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ import io
|
|
9 |
def load_data(file):
|
10 |
file.seek(0) # Move to the start of the file
|
11 |
df = pd.read_csv(file)
|
12 |
-
df['Date of Birth'] = pd.to_datetime(df['Date of Birth'], format='%Y-%m-%d')
|
13 |
-
df['Visit Date'] = pd.to_datetime(df['Visit Date'], format='%Y-%m-%d')
|
14 |
df['Age'] = df['Date of Birth'].apply(lambda dob: (dt.datetime.now() - dob).days // 365)
|
15 |
return df
|
16 |
|
|
|
9 |
def load_data(file):
|
10 |
file.seek(0) # Move to the start of the file
|
11 |
df = pd.read_csv(file)
|
12 |
+
df['Date of Birth'] = pd.to_datetime(df['Date of Birth'], format='%Y-%m-%d', errors='coerce')
|
13 |
+
df['Visit Date'] = pd.to_datetime(df['Visit Date'], format='%Y-%m-%d', errors='coerce')
|
14 |
df['Age'] = df['Date of Birth'].apply(lambda dob: (dt.datetime.now() - dob).days // 365)
|
15 |
return df
|
16 |
|