Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please zoom in on the image since chegg no longer allows for more than one image. Please provide sample code with matching outputs and passing

Please zoom in on the image since chegg no longer allows for more than one image. Please provide sample code with matching outputs and passing test cases. I will provide the files below so you can see them, please use thos and explain hot to convert to csv. Thank you!
Please look up the files they should pop up it is not letting me upload them here.
Rest of instructions:
Does it follow the law?
The other thing you should determine is if the data follows Benfords Law. For the purposes of this PA, a data set will follow Benfords law if the percentage of occurrences of each digits follows the following percentages, plus 10% or minus 5%.
digit percent (-5,+10)
130%
217%
312%
49%
57%
66%
75%
85%
94%
list_of_numbers = csv_to_list("places.csv")
assert list_of_numbers ==["1234","145","10","1700","1729","1711","219",\
"231","20001","301","3879","404","40123","505",\
"502","601","712","81231","91231"]
counts = count_start_digits(list_of_numbers)
percentages = digit_percentages(counts)
assert check_benfords_law(percentages)== True
Test cases
populations.csv does follow Benfords Law
stocks.csv does follow Benfords Law
random_numbers.csv does NOT follow Benfords Law
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions