I have 2 column dataframe likes this:
ITEM REFNUMS
1 00000299 0036701923024762922029229294652954429569295832...
2 00000655 NaN
24 00001791 00016027123076000158004563065131972
25 00001805 00016027123076000158004563065131972
26 00001813 00016027123076000158004563065131972
27 00001821 00016027123076000158004563065131972
28 00001937 0142530521316303164702509000510012201310027820...
I would like to split the REFNUMS columns into divisible parts and add onto the existing dataframe if possible as I need to retain the row index and matching ITEM #. The data in REFNUMS is a length divisible by 5, when not NaN, so for example Row 1 is = 78 sets of 5.
data_len = (data['REFNUMS'].str.len())/5
Then
0 NaN
1 78.0
2 NaN
Appreciate any suggestions on how to do this.