finding indexes of 1's in a bit string and storing these indexes in a list — Index should be started from 1 not 0
I am finding indexes of 1’s in a bit string successfully. However, these indexes start from 0. Sample Data: initial_pop 000000000000000000000000000001011000000 000000001000000000000001000000000010000 000000000000000000000000000000010011000 000000000000001001000000000000010000000 000000000000000000010000001000000010000 1000000000100000000010000000000000000000 1000000010000000000001000000000000000000 1001000000000000000010000000000000000000 000000000000100000000000100000000000010 000000000110000000000000000000001000000 Now, If we look at the 6th, 7th, and 8th data rows, values are placed at index 0 by default. My sample code: #Getting 1’s… Read More finding indexes of 1's in a bit string and storing these indexes in a list — Index should be started from 1 not 0