I\'m attempting to create a weighted histogram using the following code snippet:
def read_chunks(f, length): while True: data = f.read(length)