@@ -21,8 +21,12 @@ def handle(self, *args, **options):
2121 def wash (string ):
2222 return string .lower ().replace ("/" , "" ).replace ("_" , "" ).replace ("," , "" ).replace (" " , "" )
2323
24- def wash_leave_space (string ):
25- return string .lower ().replace ("/" , "" ).replace ("_" , "" ).replace ("," , "" )
24+ # Previously used with m2m rows, but in the latest CSV we changed to "wash_comma_to_space" instead of this:
25+ # def wash_leave_space(string):
26+ # return string.lower().replace("/", "").replace("_", "").replace(",", "")
27+
28+ def wash_comma_to_space (string ):
29+ return string .lower ().replace ("/" , "" ).replace ("_" , "" ).replace (" " , "" ).replace ("," , " " )
2630
2731 def numerize (value ):
2832 return value if value .isdigit () else 0
@@ -95,10 +99,10 @@ def numerize(value):
9599 f_nir = row ["Number of isolation rooms" ]
96100 f_wrh = row ["Warehousing" ]
97101 f_cch = row ["Cold chain" ]
98- f_gms = wash_leave_space (row ["General medical services" ]) # m2m
99- f_spm = wash_leave_space (row ["Specialized medical beyond primary level" ]) # m2m
102+ f_gms = wash_comma_to_space (row ["General medical services" ]) # m2m
103+ f_spm = wash_comma_to_space (row ["Specialized medical beyond primary level" ]) # m2m
100104 f_ots = row ["Other Services" ]
101- f_bls = wash_leave_space (row ["Blood Services" ]) # m2m
105+ f_bls = wash_comma_to_space (row ["Blood Services" ]) # m2m
102106 f_tnh = numerize (row ["Total number of Human Resource" ])
103107 f_gpr = numerize (row ["General Practitioner" ])
104108 f_spt = numerize (row ["Specialist" ])
@@ -111,7 +115,7 @@ def numerize(value):
111115 f_opr = row ["Other Profiles" ]
112116 f_fbk = row ["Feedback" ]
113117 f_oaf = row ["Other Affiliation" ]
114- f_ptf = wash_leave_space (row ["Professional Training Facilities" ]) # m2m
118+ f_ptf = wash_comma_to_space (row ["Professional Training Facilities" ]) # m2m
115119 f_ata = row ["Ambulance Type A" ]
116120 f_atb = row ["Ambulance Type B" ]
117121 f_atc = row ["Ambulance Type C" ]
0 commit comments