There is huge list data, how to convert all IP addresses to decimal numbers in pandas and merge with the value of the second column
import pandas as pd
filename = "/Users/sda/Desktop/file"
pdd = pd.read_csv(filename,header=None,sep='|',error_bad_lines=False, warn_bad_lines=False,skiprows=[0],
names=['Name','Code','Ipv', 'Ip','Range','Date', 'Category'])
pd.options.display.max_columns = None
k = pdd[pdd['Ipv'].str.contains("ipv4") & pdd['Ip'].str.contains('[0-9]')]
print(k[['Ip','Range','Code']])
my output:
Ip Range Code
2.16.0.0 524288 EU
200.109.100.0 1024 RU
200.109.102.0 1024 RU
only need to get the decimal value of the first IP address with the same country code and range number.merge with the value of the second column only
IP range code
3362612224 2028 RU