List of Private IPs are noted below
10.0.0.0 – 10.255.255.255
172.16.0.0 – 172.31.255.255
192.168.0.0 – 192.168.255.255
I have a dataframe with one column called IP_Address. I want to create another column called IP_Type with the value being either Public or Private
How do I proceed to execute this?
This is what I have below:
IP_Address
----------
68.168.102.50
185.175.32.166
77.160.161.171
94.47.147.90
110.36.82.74
88.231.25.35
188.159.36.111
201.158.110.171
So far I have broken it down like this
#Private IPs in the 10 range
drill=df[0].str.split('.',expand=True)
ten= drill.loc[(drill[0] == "10") & (drill[1] <= "255") & (drill[2] <= "255") & (drill[3] <= "255")]