I encountered a strange error while attempting to count the list of tuples. Any leads or alternate solution is appreciated.
please copy the total_bp_counts list from this text file
https://drive.google.com/file/d/1mTR78PC2ml0LqYkyT-N1QwyQb7Z9Ab0r/view
# Replace the below total_bp_counts line with content from text file
########################
total_bp_counts = list()
########################
bp_count_dict = dict()
bp_counter = 0
for bp, bp_count in total_bp_counts:
bp_counter += bp_count
if bp in bp_count_dict:
bp_count_dict[bp] += bp_count
else:
bp_count_dict[bp] = bp_count
print(bp_counter)
print(bp_count_dict)
RuntimeWarning: overflow encountered in byte_scalars
bp_count_dict[bp] += bp_count
56768
{('A', 'U'): -52, ('A', 'C'): 0, ('A', 'G'): 0, ('U', 'C'): 0, ('U', 'G'): 111, ('C', 'G'): -123}
Process finished with exit code 0
Its strange that while the total summation of of numericals is 56768, overflow happens in dictionary.
Additional Details:
Python Version: 3.7.7, Architecture: 64bit, Windows 10