Попробуйте это быстрое решение.
import pandas as pd
import re
#data-preprocessing
data = {'Name': ['Tom','Nick','Juli','June','Junw'],'Code': ['0', '89797071', '57797074', '0', '23000000']}
#I omitted Number key in data
df = pd.DataFrame(data)
print(df)
#find patterns
pattern = r'(\d{2})(\d{2})(\d{2})(\d{2})'
zero_pattern = r'0{1,}'
split_data = []
for _ in df['Code'].items():
to_find = _[1]
splitted = re.findall(pattern, to_find)
if splitted:
temp = list(splitted[0])
if '00' in temp:
temp.append('incomplete')
else:
temp.append('complete')
split_data.append(temp)
zeromatch = re.match(zero_pattern, to_find)
if zeromatch:
split_data.append(['0','0','0','0','incomplete'])
#make right dataframe
col_name = ['DIV1','DIV2','DIV3','DIV4','Incomplete']
df2 = pd.DataFrame(split_data, columns=col_name)
df[col_name]= df2
print(df)
Вывод
Name Code
0 Tom 0
1 Nick 89797071
2 Juli 57797074
3 June 0
4 Junw 23000000
Name Code DIV1 DIV2 DIV3 DIV4 Incomplete
0 Tom 0 0 0 0 0 incomplete
1 Nick 89797071 89 79 70 71 complete
2 Juli 57797074 57 79 70 74 complete
3 June 0 0 0 0 0 incomplete
4 Junw 23000000 23 00 00 00 incomplete