Question
Python; Benford's laws Loan_Data = [1435614, 168743568, 897946, 6063521, 435640, 63074837, 604365, 89703, 431857, 8741541, 3543365, 3687463, 986743, 9846513, 13215947, 564312, 21190, 196703, 18602, 28397,
Python; Benford's laws
Loan_Data = [1435614, 168743568, 897946, 6063521, 435640, 63074837, 604365, 89703, 431857, 8741541, 3543365, 3687463, 986743, 9846513, 13215947, 564312, 21190, 196703, 18602, 28397, 3930, 72834, 21950, 59524, 81455, 159818, 15153, 184817, 11735, 125546, 48940, 61842, 4040, 189576, 52440, 202492, 72940, 38672, 46665, 37200, 90400, 87178, 88319, 70960, 211463, 40909, 18161, 27819, 58911, 99420, 175859, 53, 128324, 650, 53355, 3968, 121856, 56509, 126087, 35596, 179118, 29880, 67102, 75645, 49872, 58373, 90097, 97616, 137509, 6784, 171258, 20153, 199504, 88100, 110462, 62387, 153988, 87356, 49170, 7239, 143074, 73586, 56146, 64396, 199539, 19624, 154451, 93422, 94238, 86731, 206810, 18593, 18061, 97758, 1793, 83180, 160886, 42412, 131561, 3506, 121013, 74590, 34458, 91093, 71759, 12122, 177060, 9033, 18825, 48775, 169913, 54959, 92533, 52852, 167616, 30539, 107259, 6493, 177311, 2108, 200326, 11585, 65016, 24888, 45521, 9304, 208183, 69795, 36094, 78486, 160314, 12887, 132996, 58172, 29043, 56091, 196510, 18698, 103204, 3945, 72403, 74616, 35050, 9642, 123462, 48561, 83501, 16038, 180942, 53200, 80912, 6702, 214618, 5778, 91661, 15190, 147990, 10744, 87542, 75724, 213310, 10501, 73498, 30816, 165073, 46738, 84600, 99729, 145890, 31030, 202079, 57822, 27931, 69053, 159317, 42912, 42424, 92911, 15866, 46919, 146374, 37644, 54602, 63822]
1. Extract the first digit of amount in the list and add 1 to count for the each key in the dictionary called countData.
2. Extract the first digit of amount in the list and add the percentage of times n for the each key in the dictionary called perctgData.
Using empty dictionary
countData = {}
perctgData = {}
write the code below:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started