So I am in a operating system class and my assignment is to harvest bits from a geiger counter. Every time the geiger counter reports something I receive a timestamp i.e. 1522187398.44 1522187408.17 there is one timestamp per line. I currently have 22,000 lines of numbers. From here I am to take 16 lines at a time and use those lines to create 8-bits that I will then convert into an ASCII character. Since my time stamps keep increasing I realized that the decimal points are randomly higher or lower then the previous. Currently I am trying to figure out how to just keep the decimals and store them into a list. I did explore a some asked questions about modf and reading from a file but I keep getting an syntax error telling me that at line 11 there is a TypeError: a float is required. I am required to use python 2.7 by the professor (We are using FUSE file system for the second half of the assignment but that is irrelevant for this question) . If someone could please help me at this part I am confident I can finish the assignment. My code as it is currently is down below. Any help would be appreciated.
import math
numbers = []
#Open file with timestamps and store in a list
with open('geiger.txt') as f:
for line in f:
numbers.append(map(float, line.split()))
#Keep only the decimals and move decimal place
for convert in numbers:
numbers = math.modf(convert) * 100
#Check to see if it worked
print(numbers[0:11])