Skip to content

Commit

Permalink
Merge pull request #11 from kuldeeplodha/changes_in_mastersheet
Browse files Browse the repository at this point in the history
Hiding data for PCMC households
  • Loading branch information
kuldeeplodha authored Sep 18, 2023
2 parents 6c34dbf + 0e92491 commit c9e7876
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion component/kobotoolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def get_household_analysis_data(city, slum_code, question_fields, kobo_survey=''
'''
output = {}
slum = get_object_or_404(Slum, id=slum_code)
household_data = HouseholdData.objects.filter(slum=slum)
hide_houdehold_data = [1303818, 1303797, 1451314, 1451316, 1451317, 1302914, 1302918, 1302992, 1303016, 1302958, 1451060, 1302943, 1445969, 1302932, 1302917, 1451055, 1451027, 1451004, 1451007, 1451044, 1303758, 1303813, 1303801, 1303828, 1303803, 1303792, 1451318, 1303749, 1303807, 1303811, 1303756, 1451654, 1450977, 1448811, 1448831, 1448859, 1448942, 1302623, 1302687, 1302675, 1302673, 1302666, 1448814, 1302653, 1302667, 1448871, 1448938, 1448958, 1302656, 1302642, 1302615, 1302668, 1302663, 1302670, 1302669, 1450948, 1450960, 1450969, 1445450, 1448934, 1448856, 1448946, 1450971, 1448944, 1448959, 1445456, 1448953, 1445455, 1305655, 1305653, 1303754, 1303774, 1445422, 1305791, 1451024, 1451050, 1302727, 1451235, 1451237, 1451236, 1451238, 1451239, 1451242, 1451246, 1451250, 1451249, 1451252, 1451253, 1451254, 1451256, 1451257, 1451261, 1451262, 1305754, 1305699, 1305711, 1305712, 1305730, 1305695, 1305700, 1305706, 1305708, 1305713, 1305718, 1305696, 1305705, 1469484, 1451315, 1451696, 1451698, 1451703, 1302931, 1451030, 1451233, 1302693, 1451234, 1451240, 1451241, 1451251, 1302979, 1303076, 1302954, 1302959, 1451704, 1451707, 1303037, 1303013, 1448837, 1448842, 1448857, 1450959, 1302677, 1448941, 1448779, 1448954, 1448952, 1448812, 1448809, 1448808, 1450961, 1448945, 1448967, 1448957, 1450972, 1445453, 1448836, 1448874, 1448833, 1447258, 1448854, 1448948, 1448940, 1450958, 1448844, 1448936, 1448843, 1448845, 1448933, 1448872, 1448917, 1303783, 1303814, 1303750, 1303821, 1448869, 1302689, 1302688, 1302674, 1302664, 1302651, 1302650, 1302685, 1302644, 1302640, 1302635, 1302625, 1302624, 1302620, 1448777, 1302708, 1302706, 1451280, 1448771, 1451266, 1448781, 1302735, 1302734, 1448792, 1448790, 1448875, 1448782, 1451255, 1447261, 1302732, 1302742, 1302740, 1302739, 1302738, 1302737, 1302773, 1302771, 1302731, 1302724, 1302723, 1302772, 1302717, 1302792, 1302775, 1302712, 1302701, 1302700, 1302763, 1302791, 1302698, 1302760, 1302774, 1302691, 1302766, 1302765, 1302790, 1302761, 1302758, 1302778, 1302786, 1302785, 1302745, 1302743, 1302781, 1302783, 1302751, 1302750, 1302779, 1451270, 1448878, 1302961, 1302982, 1302960, 1302983, 1303067, 1302945, 1302952, 1302947, 1328931, 1302980, 1451023, 1451028, 1451231, 1451232, 1303019, 1448960, 1302657, 1302680, 1302665, 1451264, 1302784, 1305682, 1305709, 1305684, 1305697, 1459702, 1448841, 1303810, 1450979, 1302608, 1302787, 1459699, 1302793, 1302718, 1302733, 1302720, 1448784, 1302704, 1448807, 1448817, 1328941, 1448776, 1302788, 1302789, 1448785, 1448788, 1448791, 1448793, 1448810, 1448813, 1448816, 1448834, 1448858, 1448867, 1303784, 1451310, 1451298, 1302757, 1451288, 1451301, 1448775, 1302759, 1302716, 1302728, 1451269, 1451276, 1302649, 1448770, 1448778, 1448780, 1448787, 1302641, 1448918, 1448932, 1448939, 1448947, 1448949, 1448955, 1448815, 1448832, 1448835, 1448855, 1448860, 1445452, 1302652, 1447260, 1302780, 1302744, 1448774, 1302696, 1302697, 1302702, 1448803, 1448805, 1448806, 1448862, 1448861, 1448865, 1448876, 1302748, 1302659, 1448935, 1448937, 1448951, 1450953, 1450954, 1450957, 1450973, 1450978, 1450956, 1448922, 1450974, 1451278, 1302747, 1302762, 1448961, 1450949, 1450950, 1450951, 1450965, 1450968, 1450970, 1451324, 1328932, 1328987, 1450975, 1450955, 1450976, 1451263, 1451265, 1303078, 1302998, 1302946, 1451273, 1451272, 1451274, 1448931, 1448943, 1448956, 1303023, 1448950, 1302617, 1302645, 1302794, 1451267, 1451268, 1303072, 1302989, 1451277, 1302913, 1451281, 1303006, 1445451, 1305645, 1445454, 1302681, 1302749, 1447259, 1302627, 1302636, 1302648, 1302654, 1302655, 1302690, 1302709, 1302719, 1302736, 1302764, 1302782, 1302905, 1302908, 1302975, 1302981, 1302995, 1303004, 1303039, 1303766, 1303825, 1305717, 1305790, 1305907, 1305926, 1305942, 1306120, 1306135, 1305685, 1302968, 1451279, 1450988, 1451300, 1302710, 1451302, 1302725, 1303010, 1303005, 1302912, 1305634, 1305776, 1305751, 1302930, 1302951, 1302986, 1303008, 1303066, 1305729, 1305692, 1305723, 1305707, 1302906, 1302948, 1302999, 1302925, 1445421, 1445423, 1451680, 1451695, 1451286, 1305694, 1451003, 1451042, 1451047, 1451051, 1445424, 1305681, 1445441, 1305701, 1445440, 1305605, 1305607, 1305608, 1305777, 1451029, 1451043, 1451048, 1451054, 1451056, 1305716, 1451059, 1451061, 1445426, 1305680, 1305728, 1302629, 1302752, 1302707, 1445446, 1445449, 1445448, 1445447, 1302658, 1302928, 1435440, 1306027, 1306075, 1306128, 1305906, 1451001, 1451002, 1451062, 1451041, 1305756, 1451271, 1450986, 1451000, 1451046, 1451045, 1451306, 1451307, 1451057, 1451309, 1451058, 1451005, 1303775, 1451287, 1451290, 1451291, 1451292, 1451293, 1451294, 1451718, 1451275, 1451006, 1303772, 1303804, 1303768, 1303762, 1451296, 1451297, 1303780, 1303781, 1451289, 1303763, 1303809, 1305620, 1451299, 1303782, 1303824, 1303764, 1303819, 1303785, 1451303, 1451305, 1303773, 1303816, 1451308, 1303815, 1303795, 1303790, 1451311, 1305757, 1451312, 1451313, 1305759, 1451701, 1451699, 1451697]
household_data = HouseholdData.objects.filter(slum=slum).exclude(id__in = hide_houdehold_data)
records = map(lambda x:x.rhs_data, household_data)
records = filter(lambda x: x!=None, records)
grouped_records = itertools.groupby(sorted(records, key=lambda x:int(x['Household_number'])), key=lambda x:int(x["Household_number"]))
Expand Down

0 comments on commit c9e7876

Please sign in to comment.