Alealejandrooo commited on
Commit
fbec7e3
1 Parent(s): a127b58

updated process data

Browse files
Files changed (1) hide show
  1. process.py +6 -2
process.py CHANGED
@@ -12,6 +12,10 @@ def process_data(files_mindbody, files_medserv, tollerance, progress=gr.Progress
12
  # Split 'Client' names into first name and last name components for both DataFrames
13
  medserv[['Last Name', 'First Name']] = medserv['Client'].str.split(',', expand=True)
14
  mindbody[['Last Name', 'First Name']] = mindbody['Client'].str.split(',', expand=True)
 
 
 
 
15
  # Initialize an empty list to store unmatched rows
16
  unmatched_rows = []
17
 
@@ -31,8 +35,8 @@ def process_data(files_mindbody, files_medserv, tollerance, progress=gr.Progress
31
 
32
  # Filter medserv based on the date range and name criteria
33
  matches = medserv[((medserv['DOS'].dt.date.isin(date_range)) &
34
- ((medserv['First Name'] == first_name) |
35
- (medserv['Last Name'] == last_name)))]
36
 
37
  # If no match is found, append the row to the unmatched_rows list
38
  if matches.empty:
 
12
  # Split 'Client' names into first name and last name components for both DataFrames
13
  medserv[['Last Name', 'First Name']] = medserv['Client'].str.split(',', expand=True)
14
  mindbody[['Last Name', 'First Name']] = mindbody['Client'].str.split(',', expand=True)
15
+
16
+ mindbody['DOS'] = pd.to_datetime(mindbody['DOS'], format='%d/%m/%Y')
17
+ medserv['DOS'] = pd.to_datetime(medserv['DOS'], format='%d/%m/%Y')
18
+
19
  # Initialize an empty list to store unmatched rows
20
  unmatched_rows = []
21
 
 
35
 
36
  # Filter medserv based on the date range and name criteria
37
  matches = medserv[((medserv['DOS'].dt.date.isin(date_range)) &
38
+ ((medserv['First Name'].str.lower() == first_name.lower()) |
39
+ (medserv['Last Name'].str.lower() == last_name.lower())))]
40
 
41
  # If no match is found, append the row to the unmatched_rows list
42
  if matches.empty: