Search…
⌃K
Links

Phone Number Data

The phone_number Add-On is for data that represents telephone numbers.
🌎
This Add-On understands the geographical context of phone numbers. It can extract international and region country codes that are embedded in your phone numbers.
🔓
This Add-On offers the novel Contextual Anonymization technique on phone numbers that are Personal Identifiable Information (PII).

In the Add-On

This Add-On provides access to two additional transformers: AnonymizedGeoExtractor and GeoExtractor for handling phone number data.
Use them by specifying that they are phone_number data.
# first import rdt and load the data
>>> from rdt import HyperTransformer
>>> ht = HyperTransformer()
>>> ht.detect_initial_config(my_data)
Detecting a new config from the data ... SUCCESS
Setting the new config ... SUCCESS
Config:
{
'sdtypes': {
'age': 'numerical',
'cell_phone_no': 'categorical',
'dollars_spent': 'numerical'
},
'transformers': {
'age': FloatFormatter(missing_value_replacement="mean"),
'cell_phone_no': FrequencyEncoder(),
'dollars_spent': FloatFormatter(missing_value_replacement="mean")
}
}
# now import the premium Add-On and sepecify the phone number data
>>> from rdt_plus.transformers import phone_number
>>> ht.update_sdtypes({'cell_phone_no': 'phone_number'})
# this will automatically assign the recommended transformer
# view the config to verify
>>> ht.get_config()
{
'sdtypes': {
'age': 'numerical',
'cell_phone_no': 'phone_number',
'dollars_spent': 'numerical'
},
'transformers': {
'age': FloatFormatter(missing_value_replacement="mean"),
'cell_phone_no': phone_number.AnonymizedGeoExtractor(),
'dollars_spent': FloatFormatter(missing_value_replacement="mean")
}
}

Explore the Transformers

A transformer that uses Contextual Anonymization. It extracts geographical context from the phone numbers and then uses it to create fake numbers in the correct locations. See Usage Doc.
A transformer that extract the geographical context from a phone number. See Usage Doc.

FAQs

The transformers extract the country from the international calling code, and the region based on the rules in that country.