-
Notifications
You must be signed in to change notification settings - Fork 3
/
ScratchPad.py
50 lines (40 loc) · 1.2 KB
/
ScratchPad.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#%% [markdown]
# # Data Profiling Playbook
# The intention of this notebook is to develop a generic approach to profiling a single column.
# This will take into account:
# - The primary data type of the column - eg if it's a date, we can generate more specialised analytics
# - We may also be able to apply more specialised checks, for example based on REGEX to check national insurance numbers etc.
#%%
# Import all of the libraries we need to use...
import pandas as pd
import azureml.dataprep as dprep
import os as os
import re as re
import collections
import seaborn as sns
import pandas_profiling as pp
import datetime
from datetime import datetime
from azureml.dataprep import value
from azureml.dataprep import col
from azureml.dataprep import Dataflow
from commonPackageHandling import openDataFlowPackage
#%%
dataFlow, fullPackagePath = openDataFlowPackage('UPMFOLDER_UPMPERSON', '60', 'A')
#%%
dataFlow.head(10)
#%%
builder = dataFlow.builders.split_column_by_example('ADDRESS')
#%%
builder.preview()
#%%
builder.keep_delimiters = False
#%%
builder.delimiters = r'\0d0a'
#%%
dataProfile = dataFlow.get_profile()
dataProfile
#%%
newDataFlow = dataFlow.filter(dataFlow['ID'] == 17977)
#%%
newDataFlow.head(10)