EIS metadata validation script

Used to validate Planon output with spreadsheet input

1. Data import


In [16]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

Read data. There are two datasets: Planon and Master. The latter is the EIS data nomencalture that was created. Master is made up of two subsets: loggers and meters. Loggers are sometimes called controllers and meters are sometimes called sensors. In rare cases meters or sensors are also called channels.


In [17]:
planon=pd.read_excel('EIS Assets.xlsx',index_col = 'Code')
master_loggerscontrollers = pd.read_csv('LoggersControllers.csv', index_col = 'Asset Code')
master_meterssensors = pd.read_csv('MetersSensors.csv', encoding = 'macroman', index_col = 'Asset Code')
planon['Code']=planon.index
master_loggerscontrollers['Code']=master_loggerscontrollers.index
master_meterssensors['Code']=master_meterssensors.index

Unify index, caps everything and strip of trailing spaces.


In [18]:
planon.index=[str(i).upper().strip() for i in planon.index]
master_loggerscontrollers.index=[str(i).upper().strip() for i in master_loggerscontrollers.index]
master_meterssensors.index=[str(i).upper().strip() for i in master_meterssensors.index]

Drop duplicates (shouldn't be any)


In [19]:
planon.drop_duplicates(inplace=True)
master_loggerscontrollers.drop_duplicates(inplace=True)
master_meterssensors.drop_duplicates(inplace=True)

Split Planon import into loggers and meters
Drop duplicates (shouldn't be any)


In [20]:
# Split the Planon file into 2, one for loggers & controllers, and one for meters & sensors.
planon_loggerscontrollers = planon.loc[(planon['Classification Group'] == 'EN.EN4 BMS Controller') | (planon['Classification Group'] == 'EN.EN1 Data Logger')]
planon_meterssensors = planon.loc[(planon['Classification Group'] == 'EN.EN2 Energy Meter') | (planon['Classification Group'] == 'EN.EN3 Energy Sensor')]
planon_loggerscontrollers.drop_duplicates(inplace=True)
planon_meterssensors.drop_duplicates(inplace=True)


C:\Anaconda2\envs\python3\lib\site-packages\pandas\util\decorators.py:91: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  return func(*args, **kwargs)

Index unique? show number of duplicates in index


In [22]:
len(planon_loggerscontrollers.index[planon_loggerscontrollers.index.duplicated()])


Out[22]:
0

In [23]:
len(planon_meterssensors.index[planon_meterssensors.index.duplicated()])


Out[23]:
3089

Meters are not unique. This is becasue of the spaces served. This is ok for now, we will deal with duplicates at the comparison stage. Same is true for loggers - in the unlikely event that there are duplicates in the future.


In [24]:
planon_meterssensors.head(3)


Out[24]:
BuildingNo. Building Locations.Space.Space number Space Name Additional Location Info Description Classification Group Record HVAC Ref Element Description ... Logger SIM Meter Pulse Value Meter Units Meter Capacity Network Point ID Tenant Meter.Name Fiscal Meter.Name EIS Space.Space number Utility Type.Name Code
AP000-L01/M001 AP000 Alexandra Park NaN NaN NaN NaN EN.EN2 Energy Meter NaN NaN NaN ... NaN NaN NaN NaN NaN No No NaN NaN AP000-L01/M001
AP000-L02/M001 AP000 Alexandra Park NaN NaN NaN Graduate House 1-11 EN.EN2 Energy Meter NaN NaN NaN ... NaN NaN NaN NaN NaN No No NaN NaN AP000-L02/M001
AP000-L02/M002 AP000 Alexandra Park NaN NaN NaN Alex Park Main EN.EN2 Energy Meter NaN NaN NaN ... NaN NaN NaN NaN NaN No No NaN NaN AP000-L02/M002

3 rows × 30 columns

2. Validation

Create list of all buildings present in Planon export. These are buildings to check the data against from Master.


In [25]:
buildings=set(planon_meterssensors['BuildingNo.'])
buildings


Out[25]:
{'AP000',
 'AP001',
 'AP009',
 'AP010',
 'AP011',
 'AP057',
 'AP080',
 'AP081',
 'EX001',
 'MC000',
 'MC001',
 'MC003',
 'MC007',
 'MC008',
 'MC010',
 'MC011',
 'MC013',
 'MC014',
 'MC029',
 'MC030',
 'MC031',
 'MC032',
 'MC033',
 'MC043',
 'MC044',
 'MC045',
 'MC046',
 'MC047',
 'MC048',
 'MC050',
 'MC051',
 'MC053',
 'MC055',
 'MC061',
 'MC062',
 'MC063',
 'MC064',
 'MC065',
 'MC066',
 'MC067',
 'MC068',
 'MC069',
 'MC070',
 'MC071',
 'MC072',
 'MC075',
 'MC076',
 'MC077',
 'MC078',
 'MC083',
 'MC095',
 'MC099',
 'MC102',
 'MC103',
 'MC125',
 'MC126',
 'MC128',
 'MC129',
 'MC131',
 'MC134',
 'MC138',
 'MC139',
 'MC140',
 'MC141',
 'MC171',
 'MC181',
 'MC197',
 'MC198',
 'MC199',
 'MC200',
 'MC202',
 'MC203',
 'MC204',
 'MC207',
 'MC208',
 'MC210',
 'MC211',
 'OC004',
 'OC005',
 'OC006'}

In [26]:
len(buildings)


Out[26]:
80

2.1. Meters

Create dataframe slice for validation from master_meterssensors where the only the buildings located in buildings are contained. Save this new slice into master_meterssensors_for_validation. This is done by creating sub-slices of the dataframe for each building, then concatenating them all together.


In [27]:
master_meterssensors_for_validation = \
    pd.concat([master_meterssensors.loc[master_meterssensors['Building Code'] == building] \
           for building in buildings])
master_meterssensors_for_validation.head(2)


Out[27]:
Logger Asset Code Description Make Model Meter Units Meter Pulse Value Classification Group Logger Channel Utility Type ?? ... Building Name Space Additional Location Info Tenant meter Fiscal meter Parent meter Child meters Communications type Electrical panel ID Code
MC001-B01/C1 {39A16E8D-2D2B-49BC-BA47-5C2FC061DA17} Virtual CNC 1 NaN NaN NaN NaN Energy sensor C1 NaN NaN ... The Croft NaN NaN 0.0 0.0 NaN NaN NaN NaN MC001-B01/C1
MC001-B01/D10 {39A16E8D-2D2B-49BC-BA47-5C2FC061DA17} DHW Control Valve and Pump NaN NaN NaN NaN Energy sensor D10 NaN NaN ... The Croft NaN NaN 0.0 0.0 NaN NaN NaN NaN MC001-B01/D10

2 rows × 22 columns


In [28]:
master_meterssensors_for_validation.loc['MC202-B15/F15']


Out[28]:
Logger Asset Code           {05937EE0-58E6-42F3-B6BD-A180D9634B6C}
Description                                            Function 15
Make                                                           NaN
Model                                                          NaN
Meter Units                                                    NaN
Meter Pulse Value                                              NaN
Classification Group                                 Energy sensor
Logger Channel                                                 F15
Utility Type                                                   NaN
??                                                             NaN
Meter Type                                                     NaN
Building Code                                                MC202
Building Name                              Charles Carter Building
Space                                                          NaN
Additional Location Info                                       NaN
Tenant meter                                                     0
Fiscal meter                                                     0
Parent meter                                                   NaN
Child meters                                                   NaN
Communications type                                            NaN
Electrical panel ID                                            NaN
Code                                                 MC202-B15/F15
Name: MC202-B15/F15, dtype: object

In [29]:
#alternative method
master_meterssensors_for_validation2 = \
    master_meterssensors[master_meterssensors['Building Code'].isin(buildings)]
master_meterssensors_for_validation2.head(2)


Out[29]:
Logger Asset Code Description Make Model Meter Units Meter Pulse Value Classification Group Logger Channel Utility Type ?? ... Building Name Space Additional Location Info Tenant meter Fiscal meter Parent meter Child meters Communications type Electrical panel ID Code
MC055-B01/C1 {6BF82177-CB8B-4774-9B9C-0008202C0CE8} Virtual CNC 1 NaN NaN NaN NaN Energy sensor C1 NaN NaN ... Furness Residences NaN NaN 0.0 0.0 NaN NaN NaN NaN MC055-B01/C1
MC055-B01/D1 {6BF82177-CB8B-4774-9B9C-0008202C0CE8} Heating Pumps 1 & 2 NaN NaN NaN NaN Energy sensor D1 NaN NaN ... Furness Residences NaN NaN 0.0 0.0 NaN NaN NaN NaN MC055-B01/D1

2 rows × 22 columns

Planon sensors are not unique because of the spaces served convention in the two data architectures. The Planon architecture devotes a new line for each space served - hence the not unique index. The Master architecture lists all the spaces only once, as a list, therefore it has a unique index. We will need to take this into account and create matching dataframe out of planon for comparison, with a unique index.


In [31]:
len(master_meterssensors_for_validation)


Out[31]:
30539

In [32]:
len(planon_meterssensors)-len(planon_meterssensors.index[planon_meterssensors.index.duplicated()])


Out[32]:
29623

Sort datasets after index for easier comparison.


In [33]:
master_meterssensors_for_validation.sort_index(inplace=True)
planon_meterssensors.sort_index(inplace=True)


C:\Anaconda2\envs\python3\lib\site-packages\ipykernel\__main__.py:2: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  from ipykernel import kernelapp as app

2.1.1 Slicing of meters to only certain columns of comparison


In [35]:
planon_meterssensors.T


Out[35]:
AP000-L01/M001 AP000-L02/M001 AP000-L02/M002 AP000-L03/M001 AP000-L03/M002 AP001-L01/M001 AP001-L01/M002 AP001-L01/M003 AP001-L01/M004 AP001-L01/M005 ... OC006-B01/W4 OC006-B01/W5 OC006-B01/Y1 OC006-B01/Y2 OC006-B01/Y3 OC006-B01/Y4 OC006-B01/Y5 OC006-B01/Y6 OC006-B01/Z1 OC006-B01/Z2
BuildingNo. AP000 AP000 AP000 AP000 AP000 AP001 AP001 AP001 AP001 AP001 ... OC006 OC006 OC006 OC006 OC006 OC006 OC006 OC006 OC006 OC006
Building Alexandra Park Alexandra Park Alexandra Park Alexandra Park Alexandra Park House 01 - Bassenthwaite, Graduate College House 01 - Bassenthwaite, Graduate College House 01 - Bassenthwaite, Graduate College House 01 - Bassenthwaite, Graduate College House 01 - Bassenthwaite, Graduate College ... Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House
Locations.Space.Space number NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Space Name NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Additional Location Info NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Description NaN Graduate House 1-11 Alex Park Main NaN NaN NaN Bar Cellar Bar Ground Services Room Bar Water ... ShuntPumpRotate Manual Shunt pump changeover Outside air temperature Immersion Sensor Thermistor TBTC Room temperature Thermistor TBTI 4DIX V Heating Boilers DHWS Immersion
Classification Group EN.EN2 Energy Meter EN.EN2 Energy Meter EN.EN2 Energy Meter EN.EN2 Energy Meter EN.EN2 Energy Meter EN.EN2 Energy Meter EN.EN2 Energy Meter EN.EN2 Energy Meter EN.EN2 Energy Meter EN.EN2 Energy Meter ... EN.EN3 Energy Sensor EN.EN3 Energy Sensor EN.EN3 Energy Sensor EN.EN3 Energy Sensor EN.EN3 Energy Sensor EN.EN3 Energy Sensor EN.EN3 Energy Sensor EN.EN3 Energy Sensor EN.EN3 Energy Sensor EN.EN3 Energy Sensor
Record NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
HVAC Ref NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Element Description NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Servicable Area NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Model NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Make NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
EIS ID 1 1 2 1 2 1 2 3 4 5 ... W4 W5 Y1 Y2 Y3 Y4 Y5 Y6 Z1 Z2
Logger Channel 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0
Logger Upstream Comms Target NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger Modem Serial Number NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger IP Address NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger Serial Number NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger MAC Address NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger SIM NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Meter Pulse Value NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Meter Units NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Meter Capacity NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Network Point ID NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Tenant Meter.Name No No No No No No No No No No ... No No No No No No No No No No
Fiscal Meter.Name No No No No No No No No No No ... No No No No No No No No No No
EIS Space.Space number NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Utility Type.Name NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Code AP000-L01/M001 AP000-L02/M001 AP000-L02/M002 AP000-L03/M001 AP000-L03/M002 AP001-L01/M001 AP001-L01/M002 AP001-L01/M003 AP001-L01/M004 AP001-L01/M005 ... OC006-B01/W4 OC006-B01/W5 OC006-B01/Y1 OC006-B01/Y2 OC006-B01/Y3 OC006-B01/Y4 OC006-B01/Y5 OC006-B01/Y6 OC006-B01/Z1 OC006-B01/Z2

30 rows × 32712 columns


In [36]:
master_meterssensors_for_validation.T


Out[36]:
AP000-L01/M001 AP000-L02/M001 AP000-L02/M002 AP000-L03/M001 AP000-L03/M002 AP000-L99/M303 AP000-L99/M308 AP001-L01/M001 AP001-L01/M002 AP001-L01/M003 ... OC006-B01/Y1 OC006-B01/Y2 OC006-B01/Y3 OC006-B01/Y4 OC006-B01/Y5 OC006-B01/Y6 OC006-B01/Z1 OC006-B01/Z2 OC006-L99/M200 OC006-L99/M503
Logger Asset Code 050157C7ED00 37475126 37475126 48015355 48015355 NaN NaN 0501E3E97100 0501E3E97100 0501E3E97100 ... {BBD3685B-B0DC-417F-A0E8-20139B1074E1} {BBD3685B-B0DC-417F-A0E8-20139B1074E1} {BBD3685B-B0DC-417F-A0E8-20139B1074E1} {BBD3685B-B0DC-417F-A0E8-20139B1074E1} {BBD3685B-B0DC-417F-A0E8-20139B1074E1} {BBD3685B-B0DC-417F-A0E8-20139B1074E1} {BBD3685B-B0DC-417F-A0E8-20139B1074E1} {BBD3685B-B0DC-417F-A0E8-20139B1074E1} NaN NaN
Description NaN Graduate House 1-11 Alex Park Main NaN NaN Alex Park LU Alex Park UPP NaN Bar Cellar Bar Ground ... Outside air temperature Immersion Sensor Thermistor TBTC Room temperature Thermistor TBTI 4DIX V Heating Boilers DHWS Immersion Kent House Kent House
Make Carlo Gavazzi Actaris Delta NaN NaN Elster Landis ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Model EM24 Delta G D35 NaN NaN A1100 E1100 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Meter Units kWh NaN NaN NaN NaN NaN NaN m3 kWh kWh ... Degrees Celsius NaN NaN Degrees Celsius Degrees Celsius NaN NaN NaN NaN NaN
Meter Pulse Value 1 NaN NaN NaN NaN NaN NaN 0.001 0.001 0.001 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Classification Group Energy meter Energy meter Energy meter Energy meter Energy meter Energy meter Energy meter Energy meter Energy meter Energy meter ... Energy sensor Energy sensor Energy sensor Energy sensor Energy sensor Energy sensor Energy sensor Energy sensor Energy meter Energy meter
Logger Channel 1 1 2 1 2 NaN NaN 1 2 3 ... Y1 Y2 Y3 Y4 Y5 Y6 Z1 Z2 NaN NaN
Utility Type Electricity Natural Gas Natural Gas Water Water Natural Gas Natural Gas Water Electricity Electricity ... NaN NaN NaN NaN NaN NaN NaN NaN Electricity Water
?? NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Meter Type NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Building Code AP000 AP000 AP000 AP000 AP000 AP000 AP000 AP001 AP001 AP001 ... OC006 OC006 OC006 OC006 OC006 OC006 OC006 OC006 OC006 OC006
Building Name Alexandra Park Alexandra Park Alexandra Park Alexandra Park Alexandra Park Alexandra Park Alexandra Park House 01 - Bassenthwaite House 01 - Bassenthwaite House 01 - Bassenthwaite ... Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House Chancellor's Wharf, Kent House
Space NaN NaN NaN NaN NaN AP001 A0, AP002 A0, AP003 A0, AP004 A0, Ap005 ... AP012 A0, AP013 A0, AP014 A0, AP015 A0, AP016 ... NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN OC006 A0 OC006 A0
Additional Location Info Graduate 1-11 Plant Room External Gas Meter Building External Gas Meter Building External Water Meter Chamber External Water Meter Chamber NaN NaN Bassenthwaite Rm No 104 Bassenthwaite Rm No 104 Bassenthwaite Rm No 104 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Tenant meter 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0
Fiscal meter 0 0 0 0 0 1 1 0 0 0 ... 0 0 0 0 0 0 0 0 1 1
Parent meter NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Child meters NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Communications type NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Electrical panel ID NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Code AP000-L01/M001 AP000-L02/M001 AP000-L02/M002 AP000-L03/M001 AP000-L03/M002 AP000-L99/M303 AP000-L99/M308 AP001-L01/M001 AP001-L01/M002 AP001-L01/M003 ... OC006-B01/Y1 OC006-B01/Y2 OC006-B01/Y3 OC006-B01/Y4 OC006-B01/Y5 OC006-B01/Y6 OC006-B01/Z1 OC006-B01/Z2 OC006-L99/M200 OC006-L99/M503

22 rows × 30539 columns

Create dictionary that maps Planon column names onto Master.

From Nicola:

  • Code (Asset Code)
  • Description
  • EIS ID (Channel)
  • Utility Type
  • Fiscal Meter
  • Tenant Meter

Building code and Building name are implicitly included. Logger Serial Number, IP or MAC would be essential to include, as well as Make and Model. Additional Location Info is not essnetial but would be useful to have. Locations (Locations.Space.Space number and Space Name) are included in the Planon export - but this is their only viable data source, therefore are not validated against.


In [37]:
#Planon:Master
meters_match_dict={
      "BuildingNo.":"Building Code",
      "Building":"Building Name",
      "Description":"Description",
      "EIS ID":"Logger Channel",
      "Tenant Meter.Name":"Tenant meter",
      "Fiscal Meter.Name":"Fiscal meter",
      "Code":"Code"
      }

Filter both dataframes based on these new columns. Then remove duplicates. Currently, this leads to loss of information of spaces served, but also a unique index for the Planon dataframe, therefore bringing the dataframes closer to each other. When including spaces explicitly in the comparison (if we want to - or just trust the Planon space mapping), this needs to be modified.


In [38]:
master_meterssensors_for_validation_filtered=master_meterssensors_for_validation[list(meters_match_dict.values())]
planon_meterssensors_filtered=planon_meterssensors[list(meters_match_dict.keys())]

In [39]:
pd.DataFrame(master_meterssensors_for_validation_filtered.loc['MC202-B15/F15'])


Out[39]:
MC202-B15/F15
Building Name Charles Carter Building
Fiscal meter 0
Logger Channel F15
Code MC202-B15/F15
Building Code MC202
Tenant meter 0
Description Function 15

In [40]:
master_meterssensors_for_validation_filtered.head(2)


Out[40]:
Building Name Fiscal meter Logger Channel Code Building Code Tenant meter Description
AP000-L01/M001 Alexandra Park 0.0 1 AP000-L01/M001 AP000 0.0 NaN
AP000-L02/M001 Alexandra Park 0.0 1 AP000-L02/M001 AP000 0.0 Graduate House 1-11

In [41]:
planon_meterssensors_filtered.head(2)


Out[41]:
Building Fiscal Meter.Name EIS ID Code BuildingNo. Tenant Meter.Name Description
AP000-L01/M001 Alexandra Park No 1 AP000-L01/M001 AP000 No NaN
AP000-L02/M001 Alexandra Park No 1 AP000-L02/M001 AP000 No Graduate House 1-11

Unify headers, drop duplicates (bear the mind the spaces argument, this where it needs to be brought back in in the future!).


In [42]:
planon_meterssensors_filtered.columns=[meters_match_dict[i] for i in planon_meterssensors_filtered]

In [43]:
planon_meterssensors_filtered.drop_duplicates(inplace=True)
master_meterssensors_for_validation_filtered.drop_duplicates(inplace=True)


C:\Anaconda2\envs\python3\lib\site-packages\pandas\util\decorators.py:91: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  return func(*args, **kwargs)

In [44]:
planon_meterssensors_filtered.head(2)


Out[44]:
Building Name Fiscal meter Logger Channel Code Building Code Tenant meter Description
AP000-L01/M001 Alexandra Park No 1 AP000-L01/M001 AP000 No NaN
AP000-L02/M001 Alexandra Park No 1 AP000-L02/M001 AP000 No Graduate House 1-11

Fiscal/Tenant meter name needs fixing from Yes/No and 1/0.


In [45]:
planon_meterssensors_filtered['Fiscal meter']=planon_meterssensors_filtered['Fiscal meter'].isin(['Yes'])
planon_meterssensors_filtered['Tenant meter']=planon_meterssensors_filtered['Tenant meter'].isin(['Yes'])
master_meterssensors_for_validation_filtered['Fiscal meter']=master_meterssensors_for_validation_filtered['Fiscal meter'].isin([1])
master_meterssensors_for_validation_filtered['Tenant meter']=master_meterssensors_for_validation_filtered['Tenant meter'].isin([1])


C:\Anaconda2\envs\python3\lib\site-packages\ipykernel\__main__.py:1: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  if __name__ == '__main__':
C:\Anaconda2\envs\python3\lib\site-packages\ipykernel\__main__.py:2: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  from ipykernel import kernelapp as app
C:\Anaconda2\envs\python3\lib\site-packages\ipykernel\__main__.py:3: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  app.launch_new_instance()
C:\Anaconda2\envs\python3\lib\site-packages\ipykernel\__main__.py:4: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy

In [46]:
master_meterssensors_for_validation_filtered.head(2)


Out[46]:
Building Name Fiscal meter Logger Channel Code Building Code Tenant meter Description
AP000-L01/M001 Alexandra Park False 1 AP000-L01/M001 AP000 False NaN
AP000-L02/M001 Alexandra Park False 1 AP000-L02/M001 AP000 False Graduate House 1-11

In [47]:
planon_meterssensors_filtered.head(2)


Out[47]:
Building Name Fiscal meter Logger Channel Code Building Code Tenant meter Description
AP000-L01/M001 Alexandra Park False 1 AP000-L01/M001 AP000 False NaN
AP000-L02/M001 Alexandra Park False 1 AP000-L02/M001 AP000 False Graduate House 1-11

Cross-check missing meters


In [48]:
a=np.sort(list(set(planon_meterssensors_filtered.index)))
b=np.sort(list(set(master_meterssensors_for_validation_filtered.index)))
meterssensors_not_in_planon=[]
for i in b:
    if i not in a:
        print(i+',',end=" "),
        meterssensors_not_in_planon.append(i)
print('\n\nMeters in Master, but not in Planon:',
      len(meterssensors_not_in_planon),'/',len(b),':',
      round(len(meterssensors_not_in_planon)/len(b)*100,3),'%')


AP000-L99/M303, AP000-L99/M308, MC000-L99/M201, MC000-L99/M202, MC000-L99/M203, MC000-L99/M506, MC001-L99/M100, MC001-L99/M222, MC001-L99/M224, MC001-L99/M306, MC001-L99/M508, MC003-L99/M207, MC003-L99/M304, MC003-L99/M509, MC007-L99/M211, MC007-L99/M511, MC008-L99/M302, MC047-L02/M00??, MC061-L99/M305, MC061-L99/M310, MC102-L99/M309, MC103-L99/M216, MC103-L99/M300, MC103-L99/M504, MC204-L99/M312, MC210-L01/M001, MC210-L01/M002, MC210-L01/M003, MC210-L01/M004, MC210-L01/M005, MC210-L01/M006, MC210-L01/M007, MC210-L01/M008, MC210-L01/M009, MC210-L01/M010, MC210-L01/M011, MC210-L01/M012, MC210-L01/M013, MC210-L01/M014, MC210-L01/M015, MC210-L01/M016, MC210-L01/M017, MC210-L01/M018, MC210-L01/M019, MC210-L01/M020, MC210-L01/M021, MC210-L01/M022, MC210-L01/M023, MC210-L01/M024, MC210-L01/M025, MC210-L01/M026, MC210-L01/M027, MC210-L01/M028, MC210-L01/M029, MC210-L01/M030, MC210-L02/M001, MC210-L02/M002, MC210-L02/M003, MC210-L02/M004, MC210-L02/M005, MC210-L02/M006, MC210-L02/M007, MC210-L02/M008, MC210-L02/M009, MC210-L02/M010, MC210-L02/M011, MC210-L02/M012, MC210-L02/M013, MC210-L02/M014, MC210-L02/M015, MC210-L02/M016, MC210-L02/M017, MC210-L02/M018, MC210-L02/M019, MC210-L02/M020, MC210-L02/M021, MC210-L02/M022, MC210-L02/M023, NAN, OC004-L99/M206, OC004-L99/M512, OC005-L99/M204, OC005-L99/M505, OC006-L99/M200, OC006-L99/M503, 

Meters in Master, but not in Planon: 85 / 29708 : 0.286 %

In [52]:
#without MC210
len(set([i for i in meterssensors_not_in_planon if i[:5]!='MC210']))


Out[52]:
32

In [49]:
set([i for i in meterssensors_not_in_planon if i[:5]!='MC210'])


Out[49]:
{'AP000-L99/M303',
 'AP000-L99/M308',
 'MC000-L99/M201',
 'MC000-L99/M202',
 'MC000-L99/M203',
 'MC000-L99/M506',
 'MC001-L99/M100',
 'MC001-L99/M222',
 'MC001-L99/M224',
 'MC001-L99/M306',
 'MC001-L99/M508',
 'MC003-L99/M207',
 'MC003-L99/M304',
 'MC003-L99/M509',
 'MC007-L99/M211',
 'MC007-L99/M511',
 'MC008-L99/M302',
 'MC047-L02/M00??',
 'MC061-L99/M305',
 'MC061-L99/M310',
 'MC102-L99/M309',
 'MC103-L99/M216',
 'MC103-L99/M300',
 'MC103-L99/M504',
 'MC204-L99/M312',
 'NAN',
 'OC004-L99/M206',
 'OC004-L99/M512',
 'OC005-L99/M204',
 'OC005-L99/M505',
 'OC006-L99/M200',
 'OC006-L99/M503'}

In [51]:
(set([i[:5] for i in meterssensors_not_in_planon]))


Out[51]:
{'AP000',
 'MC000',
 'MC001',
 'MC003',
 'MC007',
 'MC008',
 'MC047',
 'MC061',
 'MC102',
 'MC103',
 'MC204',
 'MC210',
 'NAN',
 'OC004',
 'OC005',
 'OC006'}

In [53]:
a=np.sort(list(set(planon_meterssensors_filtered.index)))
b=np.sort(list(set(master_meterssensors_for_validation_filtered.index)))
meterssensors_not_in_master=[]
for i in a:
    if i not in b:
        print(i+',',end=" "),
        meterssensors_not_in_master.append(i)
print('\n\nMeters in Planon, not in Master:',
      len(meterssensors_not_in_master),'/',len(a),':',
      round(len(meterssensors_not_in_master)/len(a)*100,3),'%')



Meters in Planon, not in Master: 0 / 29623 : 0.0 %

In [54]:
len(set([i for i in meterssensors_not_in_master]))


Out[54]:
0

In [55]:
set([i[:9] for i in meterssensors_not_in_master])


Out[55]:
set()

In [56]:
set([i[:5] for i in meterssensors_not_in_master])


Out[56]:
set()

Check for duplicates in index, but not duplicates over the entire row


In [57]:
print(len(planon_meterssensors_filtered.index))
print(len(set(planon_meterssensors_filtered.index)))
print(len(master_meterssensors_for_validation_filtered.index))
print(len(set(master_meterssensors_for_validation_filtered.index)))


29623
29623
30494
29708

In [58]:
master_meterssensors_for_validation_filtered[master_meterssensors_for_validation_filtered.index.duplicated()]


Out[58]:
Building Name Fiscal meter Logger Channel Code Building Code Tenant meter Description
MC011-B01/I1 The Roundhouse False i1 MC011-B01/i1 MC011 False xcite/IO/16DI
MC011-B01/I2 The Roundhouse False I2 MC011-B01/I2 MC011 False LTHW Pri Pmp Flow
MC011-B01/O1 The Roundhouse False O1 MC011-B01/O1 MC011 False Heating
MC014-B01/O1 Bowland Hall False o1 MC014-B01/o1 MC014 False Alarm Route 1
MC014-B02/O1 Bowland Hall False O1 MC014-B02/O1 MC014 False Heating times
MC014-B03/O1 Bowland Hall False O1 MC014-B03/O1 MC014 False Heating times
MC014-B04/O1 Bowland Hall False o1 MC014-B04/o1 MC014 False Alarm Route 1
MC014-B05/O1 Bowland Hall False o1 MC014-B05/o1 MC014 False Alarm Route 1
MC014-B06/O1 Bowland Hall False o1 MC014-B06/o1 MC014 False Alarm Route 1
MC014-B07/O1 Bowland Hall False O1 MC014-B07/O1 MC014 False Heating times
MC014-B08/O1 Bowland Hall False O1 MC014-B08/O1 MC014 False Heating times
MC014-B09/O1 Bowland Hall False o1 MC014-B09/o1 MC014 False Alarm Route 1
MC014-B10/O1 Bowland Hall False O1 MC014-B10/O1 MC014 False Heating times
MC014-B11/O1 Bowland Hall False o1 MC014-B11/o1 MC014 False Alarm Route 1
MC014-B12/O1 Bowland Hall False o1 MC014-B12/o1 MC014 False Alarm Route 1
MC014-B13/O1 Bowland Hall False o1 MC014-B13/o1 MC014 False Alarm Route 1
MC014-B14/O1 Bowland Hall False O1 MC014-B14/O1 MC014 False Heating times
MC031-B01/I1 Great Hall False i1 MC031-B01/i1 MC031 False xcite/IO/4UI
MC031-B01/I2 Great Hall False i2 MC031-B01/i2 MC031 False xcite/IO/2UI/2AO
MC031-B01/I3 Great Hall False i3 MC031-B01/i3 MC031 False xcite/IO/4DO
MC031-B01/I4 Great Hall False i4 MC031-B01/i4 MC031 False xcite/IO/8DI
MC031-B02/I1 Great Hall False i1 MC031-B02/i1 MC031 False Module 1
MC031-B02/I2 Great Hall False I2 MC031-B02/I2 MC031 False Sump NO1 Pump 1 Trip
MC032-B01/I1 County South False I1 MC032-B01/I1 MC032 False Fire Alarm Activated
MC032-B01/I2 County South False i2 MC032-B01/i2 MC032 False IQ4/IO/8UI
MC032-B01/I3 County South False i3 MC032-B01/i3 MC032 False IQ4/IO/8DI
MC032-B01/I4 County South False I4 MC032-B01/I4 MC032 False Electric Meter Pulse
MC032-B01/I5 County South False I5 MC032-B01/I5 MC032 False CT Pump Flow Prove
MC032-B02/I1 County South False i1 MC032-B02/i1 MC032 False Module 1
MC032-B02/I2 County South False I2 MC032-B02/I2 MC032 False DHWS Gas Valve Shut
... ... ... ... ... ... ... ...
NAN ISS Building False NaN NaN MC197 False DB/N/P2
NAN ISS Building False NaN NaN MC197 False DB/N/L2
NAN ISS Building False NaN NaN MC197 False DB/N/P1
NAN Sports Centre False 6 NaN MC204 False Sports Centre MCCP 2
NAN Sports Centre False 5 NaN MC204 False Sports Centre MCCP 1
NAN Sports Centre False 4 NaN MC204 False Sports Centre Floating Floor
NAN Sports Centre False 3 NaN MC204 False Sports Centre AHU 2
NAN Sports Centre False 2 NaN MC204 False Sports Centre AHU 1
NAN Sports Centre False 1 NaN MC204 False Sports Centre Steam Room
NAN Sports Centre False 5 NaN MC204 False Sports Centre Wet Change Power DB2 - P
NAN Sports Centre False 4 NaN MC204 False Sports Centre Wet Change Lighting DB2-L
NAN Sports Centre False 3 NaN MC204 False Sports Centre DB1 Basement and Plant Room Power
NAN Sports Centre False 2 NaN MC204 False Sports Centre DB1 Basement and Plant Room Ligh...
NAN Sports Centre False 7 NaN MC204 False Sports Centre Passenger Lift
NAN Sports Centre False 1 NaN MC204 False Sports Centre Emergency Lights
NAN Fylde Residences, House 69 - Pilling False NaN NaN MC126 False NaN
NAN Slaidburn House False 1 NaN MC063 False Slaidburn House Hot Water
NAN Slaidburn House False NaN NaN MC063 False Slaidburn Main
NAN Ruskin Library False 1 NaN MC066 False Ruskin Library
NAN Ruskin Library False 2 NaN MC066 False Ruskin Library
NAN Ruskin Library False 3 NaN MC066 False Ruskin Library
NAN ISS Building False NaN NaN MC197 False DB/N/M1
NAN ISS Building False NaN NaN MC197 False NaN
NAN ISS Building False NaN NaN MC197 False DB/N/L1
NAN Sports Centre False NaN NaN MC204 False Fiscal meter
NAN Furness College False NaN NaN MC071 False A5 Furness
NAN Sports Centre False 8 NaN MC204 False Sports Centre Sauna
NAN Alexandra Park False NaN NaN AP000 False Alexendra Park
NAN Alexandra Park False NaN NaN AP000 False Graduate College Houses 1 - 11
NAN Furness College False 1 NaN MC071 True LUSU - Housing

786 rows × 7 columns

The duplicates are the nans. Remove these for now. Could revisit later to do an index-less comparison, only over row contents.


In [59]:
good_index=[i for i in master_meterssensors_for_validation_filtered.index if str(i).lower().strip()!='nan']
master_meterssensors_for_validation_filtered=master_meterssensors_for_validation_filtered.loc[good_index]
master_meterssensors_for_validation_filtered.drop_duplicates(inplace=True)

In [60]:
len(planon_meterssensors_filtered)


Out[60]:
29623

In [61]:
len(master_meterssensors_for_validation_filtered)


Out[61]:
30139

Do comparison only on common indices. Need to revisit and identify the cause missing meters, both ways (5 Planon->Meters and 30 Meters->Planon in this example).


In [62]:
comon_index=list(set(master_meterssensors_for_validation_filtered.index).intersection(set(planon_meterssensors_filtered.index)))

In [63]:
len(comon_index)


Out[63]:
29623

In [64]:
master_meterssensors_for_validation_intersected=master_meterssensors_for_validation_filtered.loc[comon_index].sort_index()
planon_meterssensors_intersected=planon_meterssensors_filtered.loc[comon_index].sort_index()

In [65]:
len(master_meterssensors_for_validation_intersected)


Out[65]:
30055

In [66]:
len(planon_meterssensors_intersected)


Out[66]:
29623

Still have duplicate indices. For now we just drop and keep the first.


In [67]:
master_meterssensors_for_validation_intersected = master_meterssensors_for_validation_intersected[~master_meterssensors_for_validation_intersected.index.duplicated(keep='first')]

In [68]:
master_meterssensors_for_validation_intersected.head(2)


Out[68]:
Building Name Fiscal meter Logger Channel Code Building Code Tenant meter Description
AP000-L01/M001 Alexandra Park False 1 AP000-L01/M001 AP000 False NaN
AP000-L02/M001 Alexandra Park False 1 AP000-L02/M001 AP000 False Graduate House 1-11

In [69]:
planon_meterssensors_intersected.head(2)


Out[69]:
Building Name Fiscal meter Logger Channel Code Building Code Tenant meter Description
AP000-L01/M001 Alexandra Park False 1 AP000-L01/M001 AP000 False NaN
AP000-L02/M001 Alexandra Park False 1 AP000-L02/M001 AP000 False Graduate House 1-11

2.1.2. Primitive comparison


In [70]:
planon_meterssensors_intersected==master_meterssensors_for_validation_intersected


Out[70]:
Building Name Fiscal meter Logger Channel Code Building Code Tenant meter Description
AP000-L01/M001 True True False True True True False
AP000-L02/M001 True True False True True True True
AP000-L02/M002 True True False True True True True
AP000-L03/M001 True True False True True True False
AP000-L03/M002 True True False True True True False
AP001-L01/M001 False True False True True True False
AP001-L01/M002 False True False True True True False
AP001-L01/M003 False True False True True True False
AP001-L01/M004 False True False True True True False
AP001-L01/M005 False True False True True True True
AP001-L01/M006 False True False True True True True
AP009-L01/M001 False True False True True True True
AP009-L01/M002 False True False True True True True
AP009-L01/M003 False True False True True True False
AP010-L01/M001 False True False True True True True
AP010-L01/M002 False True False True True True True
AP010-L01/M003 False True False True True True True
AP010-L01/M004 False True False True True True True
AP010-L01/M005 False True False True True True True
AP011-L01/M001 False True False True True True True
AP011-L01/M002 False True False True True True True
AP011-L01/M003 False True False True True True True
AP011-L01/M004 False True False True True True True
AP057-L01/M001 True True False True True True False
AP057-L01/M002 True True False True True True True
AP057-L01/M003 True True False True True True True
AP080-L01/M001 True True False True True True False
AP080-L01/M002 True True False True True True True
AP080-L01/M003 True True False True True True True
AP081-L01/M001 True True False True True True False
... ... ... ... ... ... ... ...
OC006-B01/S21 True True True True True True True
OC006-B01/S22 True True True True True True True
OC006-B01/S23 True True True True True True True
OC006-B01/S24 True True True True True True True
OC006-B01/S25 True True True True True True True
OC006-B01/S26 True True True True True True True
OC006-B01/S27 True True True True True True True
OC006-B01/S28 True True True True True True True
OC006-B01/S29 True True True True True True True
OC006-B01/S3 True True True True True True True
OC006-B01/S4 True True True True True True True
OC006-B01/S5 True True True True True True True
OC006-B01/S6 True True True True True True True
OC006-B01/S8 True True True True True True True
OC006-B01/S9 True True True True True True True
OC006-B01/V1 True True True True True True False
OC006-B01/W1 True True True True True True True
OC006-B01/W10 True True True True True True True
OC006-B01/W2 True True True True True True True
OC006-B01/W3 True True True True True True True
OC006-B01/W4 True True True True True True True
OC006-B01/W5 True True True True True True True
OC006-B01/Y1 True True True True True True True
OC006-B01/Y2 True True True True True True True
OC006-B01/Y3 True True True True True True True
OC006-B01/Y4 True True True True True True True
OC006-B01/Y5 True True True True True True True
OC006-B01/Y6 True True True True True True True
OC006-B01/Z1 True True True True True True True
OC006-B01/Z2 True True True True True True True

29623 rows × 7 columns


In [71]:
np.all(planon_meterssensors_intersected==master_meterssensors_for_validation_intersected)


Out[71]:
False

2.1.3. Horizontal comparison

Number of cells matching


In [72]:
(planon_meterssensors_intersected==master_meterssensors_for_validation_intersected).sum()


Out[72]:
Building Name     29089
Fiscal meter      29623
Logger Channel    28760
Code              29423
Building Code     29623
Tenant meter      29623
Description       27944
dtype: int64

Percentage matching


In [73]:
(planon_meterssensors_intersected==master_meterssensors_for_validation_intersected).sum()/\
len(planon_meterssensors_intersected)*100


Out[73]:
Building Name      98.197347
Fiscal meter      100.000000
Logger Channel     97.086723
Code               99.324849
Building Code     100.000000
Tenant meter      100.000000
Description        94.332107
dtype: float64

In [74]:
((planon_meterssensors_intersected==master_meterssensors_for_validation_intersected).sum()/\
len(planon_meterssensors_intersected)*100).plot(kind='bar')


Out[74]:
<matplotlib.axes._subplots.AxesSubplot at 0x1bc082602b0>

2.1.4. Vertical comparison


In [75]:
df=pd.DataFrame((planon_meterssensors_intersected.T==master_meterssensors_for_validation_intersected.T).sum())
df


Out[75]:
0
AP000-L01/M001 5
AP000-L02/M001 6
AP000-L02/M002 6
AP000-L03/M001 5
AP000-L03/M002 5
AP001-L01/M001 4
AP001-L01/M002 4
AP001-L01/M003 4
AP001-L01/M004 4
AP001-L01/M005 5
AP001-L01/M006 5
AP009-L01/M001 5
AP009-L01/M002 5
AP009-L01/M003 4
AP010-L01/M001 5
AP010-L01/M002 5
AP010-L01/M003 5
AP010-L01/M004 5
AP010-L01/M005 5
AP011-L01/M001 5
AP011-L01/M002 5
AP011-L01/M003 5
AP011-L01/M004 5
AP057-L01/M001 5
AP057-L01/M002 6
AP057-L01/M003 6
AP080-L01/M001 5
AP080-L01/M002 6
AP080-L01/M003 6
AP081-L01/M001 5
... ...
OC006-B01/S21 7
OC006-B01/S22 7
OC006-B01/S23 7
OC006-B01/S24 7
OC006-B01/S25 7
OC006-B01/S26 7
OC006-B01/S27 7
OC006-B01/S28 7
OC006-B01/S29 7
OC006-B01/S3 7
OC006-B01/S4 7
OC006-B01/S5 7
OC006-B01/S6 7
OC006-B01/S8 7
OC006-B01/S9 7
OC006-B01/V1 6
OC006-B01/W1 7
OC006-B01/W10 7
OC006-B01/W2 7
OC006-B01/W3 7
OC006-B01/W4 7
OC006-B01/W5 7
OC006-B01/Y1 7
OC006-B01/Y2 7
OC006-B01/Y3 7
OC006-B01/Y4 7
OC006-B01/Y5 7
OC006-B01/Y6 7
OC006-B01/Z1 7
OC006-B01/Z2 7

29623 rows × 1 columns


In [76]:
df=pd.DataFrame((planon_meterssensors_intersected.T==master_meterssensors_for_validation_intersected.T).sum()/\
len(planon_meterssensors_intersected.T)*100)
df[df[0]<100]


Out[76]:
0
AP000-L01/M001 71.428571
AP000-L02/M001 85.714286
AP000-L02/M002 85.714286
AP000-L03/M001 71.428571
AP000-L03/M002 71.428571
AP001-L01/M001 57.142857
AP001-L01/M002 57.142857
AP001-L01/M003 57.142857
AP001-L01/M004 57.142857
AP001-L01/M005 71.428571
AP001-L01/M006 71.428571
AP009-L01/M001 71.428571
AP009-L01/M002 71.428571
AP009-L01/M003 57.142857
AP010-L01/M001 71.428571
AP010-L01/M002 71.428571
AP010-L01/M003 71.428571
AP010-L01/M004 71.428571
AP010-L01/M005 71.428571
AP011-L01/M001 71.428571
AP011-L01/M002 71.428571
AP011-L01/M003 71.428571
AP011-L01/M004 71.428571
AP057-L01/M001 71.428571
AP057-L01/M002 85.714286
AP057-L01/M003 85.714286
AP080-L01/M001 71.428571
AP080-L01/M002 85.714286
AP080-L01/M003 85.714286
AP081-L01/M001 71.428571
... ...
MC210-B03/S8 85.714286
MC210-B03/U1 85.714286
MC210-B03/U2 85.714286
MC210-B03/V1 85.714286
MC211-B01/I1 85.714286
MC211-B01/I2 71.428571
MC211-B01/I3 71.428571
MC211-B01/I4 71.428571
MC211-B01/O1 85.714286
MC211-B01/P23 85.714286
MC211-B01/P24 85.714286
MC211-B01/S24 85.714286
MC211-B01/S25 85.714286
MC211-B01/V1 85.714286
OC004-B01/G50 85.714286
OC004-B01/L1 85.714286
OC004-B01/L2 85.714286
OC004-B01/L3 85.714286
OC004-B01/L4 85.714286
OC004-B01/V1 85.714286
OC005-B01/G50 85.714286
OC005-B01/L1 85.714286
OC005-B01/L2 85.714286
OC005-B01/L3 85.714286
OC005-B01/V1 85.714286
OC006-B01/G50 85.714286
OC006-B01/L1 85.714286
OC006-B01/L2 85.714286
OC006-B01/L3 85.714286
OC006-B01/V1 85.714286

2959 rows × 1 columns

2.1.5. Smart(er) comparison

Not all of the dataframe matches. Let us do some basic string formatting, maybe that helps.


In [77]:
sum(planon_meterssensors_intersected['Description']!=master_meterssensors_for_validation_intersected['Description'])


Out[77]:
1679

In [78]:
planon_meterssensors_intersected['Description']=[str(s).lower().strip().replace('  ',' ').replace('   ',' ') for s in planon_meterssensors_intersected['Description'].values]
master_meterssensors_for_validation_intersected['Description']=[str(s).lower().strip().replace('  ',' ').replace('   ',' ') for s in master_meterssensors_for_validation_intersected['Description'].values]

In [79]:
sum(planon_meterssensors_intersected['Description']!=master_meterssensors_for_validation_intersected['Description'])


Out[79]:
404

Some errors fixed, some left. Let's see which ones. These are either:

  • Wrong duplicate dropped
  • Input human erros in the description.
  • Actual erros somewhere in the indexing.

In [80]:
for i in planon_meterssensors_intersected[planon_meterssensors_intersected['Description']!=master_meterssensors_for_validation_intersected['Description']].index:
    print(i,'\t\tPlanon:',planon_meterssensors_intersected.loc[i]['Description'],'\t\tMaster:',master_meterssensors_for_validation_intersected.loc[i]['Description'])


MC014-B01/L4 		Planon: nan 		Master: 
MC014-B02/L4 		Planon: nan 		Master: 
MC014-B03/L4 		Planon: nan 		Master: 
MC014-B03/O1 		Planon: alarm route 1 		Master: heating times
MC014-B04/L4 		Planon: nan 		Master: 
MC014-B04/O1 		Planon: alarm route 1 		Master: heating times
MC014-B05/L4 		Planon: nan 		Master: 
MC014-B06/L4 		Planon: nan 		Master: 
MC014-B07/L4 		Planon: nan 		Master: 
MC014-B08/L4 		Planon: nan 		Master: 
MC014-B08/O1 		Planon: heating times 		Master: alarm route 1
MC014-B09/L4 		Planon: nan 		Master: 
MC014-B10/L4 		Planon: nan 		Master: 
MC014-B10/O1 		Planon: heating times 		Master: alarm route 1
MC014-B11/L4 		Planon: nan 		Master: 
MC014-B12/L4 		Planon: nan 		Master: 
MC014-B13/L4 		Planon: nan 		Master: 
MC014-B14/L4 		Planon: nan 		Master: 
MC014-B14/O1 		Planon: heating times 		Master: alarm route 1
MC029-B01/L4 		Planon: nan 		Master: 
MC031-B01/I2 		Planon: heating pump status 		Master: xcite/io/2ui/2ao
MC031-B01/I4 		Planon: xcite/io/8di 		Master: greathall ahu 4 hr ext
MC031-B01/P16 		Planon: nan 		Master: #name?
MC031-B01/S15 		Planon: nan 		Master: #name?
MC031-B02/I2 		Planon: module 2 		Master: sump no1 pump 1 trip
MC032-B01/I1 		Planon: fire alarm activated 		Master: iq4/io/16di
MC032-B01/I3 		Planon: iq4/io/8di 		Master: water meter pulse
MC032-B01/I4 		Planon: iq4/io/4do 		Master: electric meter pulse
MC032-B01/I5 		Planon: ct pump flow prove 		Master: iq4/io/8do
MC032-B01/L1 		Planon: nan 		Master: 
MC032-B01/L2 		Planon: nan 		Master: 
MC032-B02/I4 		Planon: catering gas valve shut 		Master: module 4
MC032-B02/L1 		Planon: nan 		Master: 
MC032-B02/L2 		Planon: nan 		Master: 
MC032-B02/L3 		Planon: nan 		Master: 
MC032-B02/L4 		Planon: nan 		Master: 
MC032-B02/L5 		Planon: nan 		Master: 
MC032-B02/L6 		Planon: nan 		Master: 
MC032-B02/L8 		Planon: nan 		Master: 
MC032-B02/O1 		Planon: kitchen ahu 		Master: alarm route 1
MC032-B03/I1 		Planon: fire alarm active 		Master: xcite/io/8ao
MC032-B03/I2 		Planon: emergency stop 		Master: xcite/io/16di
MC032-B03/I3 		Planon: pressure fault 		Master: xcite/io/8do
MC032-B04/I2 		Planon: xcite/io/8ao 		Master: fire alarm active
MC032-B05/N1 		Planon: trend_03_38_72 		Master: ic comms 1
MC032-B06/N1 		Planon: ic comms 1 		Master: trend_03_31_79
MC032-B07/I1 		Planon: module 1 		Master: alarm mute pb
MC032-B07/I2 		Planon: module 2 		Master: sump no4 pump 1 trip
MC033-B01/I1 		Planon: water booster alarm 		Master: 8ui
MC043-B01/I3 		Planon: mod 3 		Master: heat ex pump 1 trip
MC043-B01/I4 		Planon: heat ex pump 2 trip 		Master: mod 4
MC043-B01/I5 		Planon: ct htg pump 1 trip 		Master: mod 5
MC043-B01/I7 		Planon: mod 7 		Master: vt htg pump 1 trip
MC043-B01/L1 		Planon: nan 		Master: 
MC043-B01/L2 		Planon: nan 		Master: 
MC043-B01/L3 		Planon: nan 		Master: 
MC043-B01/L4 		Planon: nan 		Master: 
MC043-B01/L5 		Planon: nan 		Master: 
MC043-B01/L6 		Planon: nan 		Master: 
MC043-B01/L7 		Planon: nan 		Master: 
MC043-B01/O1 		Planon: nan 		Master: 
MC044-B01/I1 		Planon: fire alarm active 		Master: module 1
MC044-B01/I11 		Planon: module 11 		Master: ahu01 extr fan flow
MC044-B01/I2 		Planon: ahu01 sply fan fault 		Master: module 2
MC044-B01/I3 		Planon: ahu01 sply dmpr open 		Master: module 3
MC044-B01/I4 		Planon: module 4 		Master: ahu01 sply fan flow
MC044-B01/I5 		Planon: module 5 		Master: ahu01 frost trip
MC044-B01/I6 		Planon: module 6 		Master: ahu01 panel fltr dirty
MC044-B01/I7 		Planon: module 7 		Master: ahu01 bag fltr dirty
MC044-B01/I8 		Planon: ahu01 th wheel fault 		Master: module 8
MC044-B01/I9 		Planon: ahu01 extr fan fault 		Master: module 9
MC044-B01/L10 		Planon: nan 		Master: 
MC044-B01/L12 		Planon: nan 		Master: 
MC044-B01/L13 		Planon: nan 		Master: 
MC044-B01/L14 		Planon: nan 		Master: 
MC044-B01/L15 		Planon: nan 		Master: 
MC044-B01/L2 		Planon: nan 		Master: 
MC044-B01/L3 		Planon: nan 		Master: 
MC044-B01/L4 		Planon: nan 		Master: 
MC044-B01/L5 		Planon: nan 		Master: 
MC044-B01/L7 		Planon: nan 		Master: 
MC044-B01/L8 		Planon: nan 		Master: 
MC044-B01/L9 		Planon: nan 		Master: 
MC044-B02/I3 		Planon: module 3 		Master: emergency stop
MC044-B02/I4 		Planon: mains failure 		Master: module 4
MC044-B02/I6 		Planon: module 6 		Master: lthw pu fault
MC044-B02/I7 		Planon: lthw pu hi press 		Master: module 7
MC044-B02/N1 		Planon: byte 2 		Master: trend_0c_93_a0
MC044-B03/I2 		Planon: module 2 		Master: ups lock
MC044-B04/I1 		Planon: module 1 		Master: phe1 high temp alarm
MC044-B04/I5 		Planon: 13% gas detect 		Master: module 5
MC044-B04/I7 		Planon: phe2 high temp alarm 		Master: module 7
MC044-B04/I8 		Planon: module 8 		Master: hws high temp alarm
MC044-B04/O1 		Planon: alarm route 1 		Master: foyer vt heating
MC044-B05/N1 		Planon: trend_0c_aa_e0 		Master: ic comms 1
MC044-B06/I3 		Planon: module 3 		Master: emergency stop
MC044-B06/I5 		Planon: plant reset pb 		Master: module 5
MC044-B06/L12 		Planon: nan 		Master: 
MC044-B06/L13 		Planon: nan 		Master: 
MC044-B07/N1 		Planon: trend_0c_92_22 		Master: fc interface lan87
MC044-B07/N2 		Planon: network 2 		Master: vav interface
MC044-B07/N3 		Planon: fc interface lan88 		Master: nan
MC044-B07/N5 		Planon: ic comms 5 		Master: bacnet mstp
MC044-B08/I2 		Planon: emergency stop 		Master: module 2
MC044-B08/I3 		Planon: mains failure 		Master: module 3
MC044-B08/I5 		Planon: ups low battery 		Master: module 5
MC044-B08/I6 		Planon: module 6 		Master: ups lock
MC044-B08/I8 		Planon: large room 3 ndrman status 		Master: module 8
MC044-B08/I9 		Planon: ahu 5 sply fan auto 		Master: module 9
MC044-B08/L3 		Planon: nan 		Master: 
MC044-B08/L4 		Planon: nan 		Master: 
MC044-B08/N1 		Planon: trend_0b_85_51 		Master: ic comms 1
MC044-B10/N2 		Planon: network 2 		Master: variable air volume c e38
MC044-B10/N6 		Planon: variable air volume c e38 		Master: bacnet application
MC044-B11/N1 		Planon: variable air volume b e08 		Master: trend_0b_9c_f8
MC044-B11/N2 		Planon: variable air volume b e09 		Master: network 2
MC044-B11/N5 		Planon: bacnet mstp 		Master: variable air volume b e12
MC044-B11/N6 		Planon: nan 		Master: variable air volume b e13
MC044-B12/N1 		Planon: mthw from central s 		Master: trend_0d_11_6b
MC045-B01/I2 		Planon: xcite/io/8ui 		Master: scc pump fail
MC045-B01/I4 		Planon: chiller failed 		Master: module4 16di
MC045-B01/I7 		Planon: xcite/io/8ao 		Master: chw pump2fail
MC046-B01/I1 		Planon: mod 1 - 8ao 		Master: fire alarm
MC046-B01/I2 		Planon: mod 2 - 8ui 		Master: pressurisation unit
MC046-B01/I5 		Planon: mod 5 - 8ui 		Master: cal 1 45kw on
MC046-B01/I8 		Planon: p1 flow switch 		Master: io module 8
MC046-B01/O1 		Planon: heating 		Master: alarm route 1
MC046-B01/O2 		Planon: heating 		Master: alarm route 2
MC048-B01/I1 		Planon: fire alarm healthy 		Master: digital inputs
MC051-B01/I1 		Planon: io module 1 		Master: fire alarm active
MC051-B01/I3 		Planon: xcite/io/4ui 		Master: heat exchanger shunt pump flow
MC051-B01/I4 		Planon: xcite/io/8do 		Master: vt pumps flow proved
MC051-B01/L4 		Planon: nan 		Master: 
MC051-B01/L5 		Planon: nan 		Master: 
MC051-B01/O1 		Planon: optimum start stop 1 		Master: alarm route 1
MC055-B01/I1 		Planon: io module 1 		Master: heating p1 running
MC061-B01/I3 		Planon: boiler no.1 gas booster fault 		Master: xcite/io/16di
MC061-B01/I4 		Planon: boiler no.1 running 		Master: xcite/io/16di
MC061-B01/I7 		Planon: xcite/io/8do 		Master: boiler no.2 gas booster switch
MC061-B01/I8 		Planon: boiler no.2 gas booster fault 		Master: xcite/io/8ao
MC061-B01/I9 		Planon: xcite/io/8ao 		Master: boiler no.2 running
MC061-B01/N1 		Planon: trend_04_61_96 		Master: heating enabled
MC061-B02/I1 		Planon: io module 1 		Master: fire alarm
MC061-B02/I2 		Planon: io module 2 		Master: pump p3 flow dps
MC061-B03/I2 		Planon: pm-a-01 pump run 		Master: spare
MC063-B01/I1 		Planon: fire alarm active 		Master: module 1
MC063-B01/I2 		Planon: shower fans north fault 		Master: module 2
MC063-B01/L2 		Planon: nan 		Master: 
MC063-B01/L3 		Planon: nan 		Master: 
MC063-B01/L4 		Planon: nan 		Master: 
MC065-B01/I3 		Planon: pressunitcommonfault 		Master: xcite/io/8ao
MC065-B01/L3 		Planon: nan 		Master: 
MC065-B01/L4 		Planon: nan 		Master: 
MC065-B01/L6 		Planon: nan 		Master: 
MC065-B01/L7 		Planon: nan 		Master: 
MC065-B01/N1 		Planon: trend_0d_7f_ae 		Master: os12 heating demand
MC065-B01/O2 		Planon: bookbinders 		Master: alarm route 1
MC065-B02/I1 		Planon: module 1 		Master: fire alarm active
MC065-B02/I2 		Planon: fire alarm or auto 		Master: module 2
MC065-B02/N1 		Planon: trend_05_67_33 		Master: ic comms 1
MC065-B03/I1 		Planon: fire alarm active 		Master: module 1
MC065-B03/I2 		Planon: module 2 		Master: for auto
MC065-B03/I3 		Planon: for off 		Master: module 3
MC065-B03/I4 		Planon: for extr only 		Master: module 4
MC065-B04/I3 		Planon: for off 		Master: module 3
MC065-B04/I4 		Planon: for extr only 		Master: module 4
MC065-B06/I1 		Planon: xcite/io/8ui 		Master: ahu-nw supply vsd fault
MC065-B06/I2 		Planon: xcite/io/8ui 		Master: ahu-nw supply flow sts
MC065-B06/I3 		Planon: xcite/io/8ui 		Master: ahu-nw extract vsd fault
MC065-B06/I5 		Planon: ahu-nwsupplypanelfiltersts 		Master: xcite/io/8ao
MC065-B06/L3 		Planon: nan 		Master: 
MC065-B06/L4 		Planon: nan 		Master: 
MC065-B06/N1 		Planon: trend_0b_b0_a0 		Master: oat frost setpoint
MC065-B07/I3 		Planon: ahu-ne extract vsd fault 		Master: xcite/io/8ao
MC065-B07/L3 		Planon: nan 		Master: 
MC065-B07/L4 		Planon: nan 		Master: 
MC065-B07/N1 		Planon: oat frost setpoint 		Master: trend_0c_c1_8c
MC065-B07/O1 		Planon: ne zone 2 floor a oss 		Master: alarm route 1
MC065-B08/I2 		Planon: ahu-se supply vsd fault 		Master: xcite/io/8ui
MC065-B08/I3 		Planon: ahu-se supply flow sts 		Master: xcite/io/8ui
MC065-B08/I7 		Planon: xcite/io/8ao 		Master: ahu-se bagpanelfiltersts
MC065-B08/I8 		Planon: ahu-se extractlfiltersts 		Master: xcite/io/8ao
MC065-B08/I9 		Planon: xcite/io/8ao 		Master: ahu-se frost stat
MC065-B08/L3 		Planon: nan 		Master: 
MC065-B08/L4 		Planon: nan 		Master: 
MC065-B08/N1 		Planon: trend_0c_c1_8b 		Master: oat frost setpoint
MC065-B08/O1 		Planon: alarm route 1 		Master: se zone 4 floor a oss
MC065-B08/O3 		Planon: alarm route 1 		Master: se zone 4 floor c oss
MC065-B09/I3 		Planon: xcite/io/8ui 		Master: ahu-sw extract vsd fault
MC065-B09/I4 		Planon: ahu-sw extract flow sts 		Master: xcite/io/8ao
MC065-B09/L3 		Planon: nan 		Master: 
MC065-B09/L4 		Planon: nan 		Master: 
MC065-B09/O1 		Planon: sw zone 3 floor a oss 		Master: alarm route 1
MC065-B09/O2 		Planon: sw zone 3 floor b oss 		Master: alarm route 1
MC065-B09/O3 		Planon: alarm route 1 		Master: sw zone 3 floor c oss
MC065-B10/N1 		Planon: trend_04_5e_f7 		Master: ic comms 1
MC066-B01/I4 		Planon: xcite/io/16di 		Master: fire alarm
MC066-B01/I5 		Planon: xcite/io/8ao 		Master: n.gallery pumps flow proven
MC066-B01/I7 		Planon: pressure unit fault 		Master: xcite/io/8ao
MC066-B01/L10 		Planon: nan 		Master: 
MC066-B01/L13 		Planon: nan 		Master: 
MC066-B01/L14 		Planon: nan 		Master: 
MC066-B01/L5 		Planon: nan 		Master: 
MC066-B01/L6 		Planon: nan 		Master: 
MC066-B01/L9 		Planon: nan 		Master: 
MC070-B01/L1 		Planon: nan 		Master: 
MC070-B01/L2 		Planon: nan 		Master: 
MC070-B01/L3 		Planon: nan 		Master: 
MC070-B01/L4 		Planon: nan 		Master: 
MC070-B01/L5 		Planon: nan 		Master: 
MC070-B02/I1 		Planon: 8ui 		Master: fire alarm
MC070-B03/I2 		Planon: io module 2 		Master: ahu supply fan run
MC070-B03/N1 		Planon: trend_0b_02_c1 		Master: ic comms 1
MC070-B05/I1 		Planon: dhw cyl 1 high limit ok 		Master: io module 1
MC070-B05/I2 		Planon: xcite/io/8ao 		Master: dhw cyl 2 high limit ok
MC070-B05/I3 		Planon: compressor fault 		Master: 4ui
MC071-B01/I5 		Planon: 8do_module 1 		Master: toilet extract fan c068 fault
MC071-B01/I6 		Planon: 4ui4ao_module 6 		Master: toilet extract fan c047 fault
MC071-B01/I7 		Planon: toilet extract fan b070 fault 		Master: 8ui_module 7
MC071-B01/I8 		Planon: 4ui4ao_module 8 		Master: eco hold off
MC071-B01/N1 		Planon: trend_0c_20_eb 		Master: ic comms 1
MC071-B01/O1 		Planon: alarm route 1 		Master: optimum start stop 1
MC072-B01/I2 		Planon: ct pump 2 fault 		Master: 1 8do
MC072-B01/I3 		Planon: tower pump 1 fault 		Master: io module 3
MC072-B01/I4 		Planon: tower pump 2 fault 		Master: nan
MC072-B02/I1 		Planon: xcite/io/16di no1 		Master: bms alarm mute
MC072-B02/I3 		Planon: presurisation unit lp fault 		Master: xcite/io/8do no1
MC072-B02/I5 		Planon: xcite/io/8ui no1 		Master: mthw shunt pump p1b fault
MC072-B02/N1 		Planon: trend_09_07_33 		Master: ic comms 1
MC072-B03/I2 		Planon: sump so5 pump 1 trip 		Master: module 2
MC075-B01/I1 		Planon: io module 1 		Master: heating pump 1 fault
MC075-B01/I2 		Planon: xcite/io/4ao/4u 		Master: heating pump 2 fault
MC075-B01/N1 		Planon: trend_05_77_1d 		Master: from man school 2 oat
MC075-B02/I1 		Planon: xcite/io/8ao 		Master: training lights on
MC076-B02/I4 		Planon: ac unit 01_2 fault =1 		Master: xcite/io/4ao
MC078-B01/I2 		Planon: f39 frost 		Master: xcite/io/16di
MC078-B01/I3 		Planon: fan 1 frost 		Master: xcite/io/16di
MC078-B01/I4 		Planon: xcite/io/8ui 		Master: fan 1 filter
MC078-B01/I6 		Planon: ground floor toilet extract 		Master: xcite/io/8ao
MC078-B01/I7 		Planon: f40 supply 		Master: xcite/io/8ao
MC078-B01/I8 		Planon: f40 extract 		Master: xcite/io/4ao
MC078-B02/I1 		Planon: xcite/io/8ui 		Master: main supply fan
MC078-B02/I2 		Planon: main extract fan 		Master: xcite/io/8ui
MC078-B02/I3 		Planon: xcite/io/8ao 		Master: heat recovery pump
MC078-B02/I4 		Planon: heat recovery press unit 		Master: xcite/io/8ao
MC078-B02/I5 		Planon: xcite/io/4ao 		Master: main supply fan air flow
MC078-B02/I6 		Planon: xcite/io/16di 		Master: main supply filter dirty
MC078-B02/N1 		Planon: ic comms 1 		Master: trend_05_50_40
MC078-B03/I2 		Planon: 2 flr hws cal 2 valve 		Master: io module 2
MC078-B03/I3 		Planon: 2-3 flr htg pump 1 		Master: io module 3
MC078-B03/L3 		Planon: nan 		Master: 
MC078-B03/N3 		Planon: ic comms 3 		Master: bacnet ip
MC078-B03/N6 		Planon: bacnet application 		Master: ic comms 6
MC083-B01/I1 		Planon: io module 1 		Master: heating pumps 1+2 run
MC103-B01/I1 		Planon: iq4/io/16di 		Master: heating failed
MC103-B01/L1 		Planon: nan 		Master: 
MC103-B01/O1 		Planon: alarm route 1 		Master: 
MC198-B01/I2 		Planon: gas safety cct trip 		Master: xcite/io/8ui
MC200-B01/I2 		Planon: module 2 - 8ui 		Master: spare
MC200-B01/I3 		Planon: module 3 - 16di 		Master: ahu1 pre filter status
MC200-B01/N1 		Planon: ic comms 1 		Master: trend_0d_5d_de
MC202-B03/N1 		Planon: ic comms 1 		Master: waterside
MC202-B04/N1 		Planon: ic comms 1 		Master: waterside
MC202-B05/N1 		Planon: ic comms 1 		Master: waterside
MC202-B07/N1 		Planon: watersidevent 		Master: ic comms 1
MC202-B10/N1 		Planon: watersidevent 		Master: ic comms 1
MC202-B12/N1 		Planon: watersidevent 		Master: ic comms 1
MC202-B16/N1 		Planon: waterside 		Master: ic comms 1
MC204-B01/I2 		Planon: module 2 		Master: emergency stop
MC204-B01/I3 		Planon: module 3 		Master: gas detected
MC204-B01/I4 		Planon: gas valve shut 		Master: module 4
MC204-B01/N1 		Planon: trend_05_73_4b 		Master: o11 n1
MC204-B02/I1 		Planon: fire alarm active 		Master: module 1
MC204-B02/I2 		Planon: for normal 		Master: module 2
MC204-B02/I3 		Planon: for extr only 		Master: module 3
MC204-B02/L10 		Planon: nan 		Master: 
MC204-B02/L11 		Planon: nan 		Master: 
MC204-B02/L12 		Planon: nan 		Master: 
MC204-B02/L13 		Planon: nan 		Master: 
MC204-B02/L14 		Planon: nan 		Master: 
MC204-B02/L6 		Planon: nan 		Master: 
MC204-B02/L7 		Planon: nan 		Master: 
MC204-B02/L8 		Planon: nan 		Master: 
MC204-B02/L9 		Planon: nan 		Master: 
MC204-B03/I1 		Planon: cws tank 1 hi level 		Master: module 1
MC204-B03/N1 		Planon: trend_04_60_58 		Master: ic comms 1
MC204-B04/L1 		Planon: nan 		Master: 
MC204-B04/L2 		Planon: nan 		Master: 
MC204-B04/L3 		Planon: nan 		Master: 
MC204-B05/I1 		Planon: module 1 		Master: vt pump 3a fault
MC204-B05/I2 		Planon: module 2 		Master: vt pump 3b fault
MC204-B05/I3 		Planon: module 3 		Master: vt pumps flow
MC204-B05/I5 		Planon: module 5 		Master: ufhm1 pump flow
MC204-B05/I6 		Planon: ufhm1 htco 		Master: module 6
MC204-B05/O1 		Planon: vt heating 		Master: alarm route 1
MC204-B05/O2 		Planon: ufhm1-foyer 		Master: alarm route 2
MC204-B05/O4 		Planon: ufhm3-group change f 		Master: alarm route 4
MC204-B05/O5 		Planon: alarm route 5 		Master: ufhm4-pool change
MC204-B06/I2 		Planon: module 2 		Master: ahu4 fa dmpr open
MC204-B06/I4 		Planon: ahu4 sply fan flow 		Master: module 4
MC204-B06/I5 		Planon: module 5 		Master: ahu4 ea dmpr open
MC204-B06/L2 		Planon: nan 		Master: 
MC204-B06/L3 		Planon: nan 		Master: 
MC204-B06/L4 		Planon: nan 		Master: 
MC204-B06/L5 		Planon: nan 		Master: 
MC204-B06/L6 		Planon: nan 		Master: 
MC204-B06/L7 		Planon: nan 		Master: 
MC204-B06/L8 		Planon: nan 		Master: 
MC207-B01/I2 		Planon: press unit fault 		Master: io module 2
MC207-B01/I4 		Planon: ct pumps flow 		Master: io module 4
MC207-B01/I5 		Planon: io module 5 		Master: vt pumps flow
MC207-B01/I6 		Planon: lodge pumps flow 		Master: io module 6
MC207-B01/O1 		Planon: alarm route 1 		Master: heating plant
MC210-B01/I1 		Planon: fire alarm active 		Master: xcite/io/8ui
MC210-B01/I5 		Planon: xcite/io/8do 		Master: iss hub condenser2 fault
MC210-B01/N1 		Planon: ic comms 1 		Master: mcp01a
MC210-B01/P17 		Planon: room co² a17 		Master: room co≤ a17
MC210-B01/S17 		Planon: room co² a17 		Master: room co≤ a17
MC210-B02/I1 		Planon: winter switch active 		Master: xcite/io/8ui
MC210-B02/I2 		Planon: xcite/io/8ui 		Master: summer switch active
MC210-B02/I3 		Planon: xcite/io/8ui 		Master: holiday switch active
MC210-B02/N1 		Planon: mcp01b 		Master: ic comms 1
MC210-B03/A32 		Planon: room co² a17 from os11 		Master: room co≤ a17 from os11
MC210-B03/F114 		Planon: c28 ave co² 		Master: c28 ave co≤
MC210-B03/F126 		Planon: c30 ave co² 		Master: c30 ave co≤
MC210-B03/F90 		Planon: b31 ave co² 		Master: b31 ave co≤
MC210-B03/F99 		Planon: b04 ave co² 		Master: b04 ave co≤
MC210-B03/I1 		Planon: xcite/io/8ui 		Master: compressedairunit1 fault
MC210-B03/I13 		Planon: xcite/io/8ao 		Master: b31 override
MC210-B03/I14 		Planon: b04 override 		Master: xcite/io/8do
MC210-B03/I2 		Planon: xcite/io/8ui 		Master: compressedairunit2 fault
MC210-B03/I3 		Planon: nitrogen generation alarm 		Master: xcite/io/8ui
MC210-B03/I4 		Planon: xcite/io/8ui 		Master: cef03 extract fan fault
MC210-B03/I5 		Planon: a04a&amp;b extract fan fault 		Master: xcite/io/8di
MC210-B03/I9 		Planon: xcite/io/8do 		Master: a17 override
MC210-B03/K12 		Planon: a14 room co² setpt 		Master: a14 room co≤ setpt
MC210-B03/K15 		Planon: a18 room co² setpt 		Master: a18 room co≤ setpt
MC210-B03/K18 		Planon: a19 room co² setpt 		Master: a19 room co≤ setpt
MC210-B03/K21 		Planon: a21 room co² setpt 		Master: a21 room co≤ setpt
MC210-B03/K24 		Planon: a22 room co² setpt 		Master: a22 room co≤ setpt
MC210-B03/K27 		Planon: a06 room co² setpt 		Master: a06 room co≤ setpt
MC210-B03/K30 		Planon: b31 room co² setpt 		Master: b31 room co≤ setpt
MC210-B03/K33 		Planon: b04 room co² setpt 		Master: b04 room co≤ setpt
MC210-B03/K35 		Planon: c28 room co² setpt 		Master: c28 room co≤ setpt
MC210-B03/K38 		Planon: c30 room co² setpt 		Master: c30 room co≤ setpt
MC210-B03/K41 		Planon: c04 room co² setpt 		Master: c04 room co≤ setpt
MC210-B03/K44 		Planon: d30 room co² setpt 		Master: d30 room co≤ setpt
MC210-B03/K46 		Planon: d03 room co² setpt 		Master: d03 room co≤ setpt
MC210-B03/K50 		Planon: atrium room co² setpt 		Master: atrium room co≤ setpt
MC210-B03/K61 		Planon: b30 room co² setpt 		Master: b30 room co≤ setpt
MC210-B03/K9 		Planon: a17 room co² setpt 		Master: a17 room co≤ setpt
MC210-B03/N1 		Planon: ic comms 1 		Master: mcp01c
MC210-B03/P10 		Planon: room co² a22 		Master: room co≤ a22
MC210-B03/P12 		Planon: room co² a14 		Master: room co≤ a14
MC210-B03/P14 		Planon: room co² a06 		Master: room co≤ a06
MC210-B03/P16 		Planon: room co² b31 no1 		Master: room co≤ b31 no1
MC210-B03/P18 		Planon: room co² b31 no2 		Master: room co≤ b31 no2
MC210-B03/P2 		Planon: room co² b30 		Master: room co≤ b30
MC210-B03/P20 		Planon: room co² b04 no1 		Master: room co≤ b04 no1
MC210-B03/P22 		Planon: room co² b04 no2 		Master: room co≤ b04 no2
MC210-B03/P24 		Planon: room co² c28 no1 		Master: room co≤ c28 no1
MC210-B03/P26 		Planon: room co² c28 no2 		Master: room co≤ c28 no2
MC210-B03/P28 		Planon: room co² c30 no1 		Master: room co≤ c30 no1
MC210-B03/P30 		Planon: room co² c30 no2 		Master: room co≤ c30 no2
MC210-B03/P32 		Planon: room co² a02 		Master: room co≤ a02
MC210-B03/P34 		Planon: room co² c04 		Master: room co≤ c04
MC210-B03/P36 		Planon: room co² c25 		Master: room co≤ c25
MC210-B03/P38 		Planon: room co² d30 		Master: room co≤ d30
MC210-B03/P4 		Planon: room co² a18 		Master: room co≤ a18
MC210-B03/P40 		Planon: room co² d03 		Master: room co≤ d03
MC210-B03/P6 		Planon: room co² a19 		Master: room co≤ a19
MC210-B03/P8 		Planon: room co² a21 		Master: room co≤ a21
MC210-B03/S10 		Planon: room co² a22 		Master: room co≤ a22
MC210-B03/S12 		Planon: room co² a14 		Master: room co≤ a14
MC210-B03/S14 		Planon: room co² a06 		Master: room co≤ a06
MC210-B03/S16 		Planon: room co² b31 no1 		Master: room co≤ b31 no1
MC210-B03/S18 		Planon: room co² b31 no2 		Master: room co≤ b31 no2
MC210-B03/S2 		Planon: room co² b30 		Master: room co≤ b30
MC210-B03/S20 		Planon: room co² b04 no1 		Master: room co≤ b04 no1
MC210-B03/S22 		Planon: room co² b04 no2 		Master: room co≤ b04 no2
MC210-B03/S24 		Planon: room co² c28 no1 		Master: room co≤ c28 no1
MC210-B03/S26 		Planon: room co² c28 no2 		Master: room co≤ c28 no2
MC210-B03/S28 		Planon: room co² c30 no1 		Master: room co≤ c30 no1
MC210-B03/S30 		Planon: room co² c30 no2 		Master: room co≤ c30 no2
MC210-B03/S32 		Planon: room co² a02 		Master: room co≤ a02
MC210-B03/S34 		Planon: room co² c04 		Master: room co≤ c04
MC210-B03/S36 		Planon: room co² c25 		Master: room co≤ c25
MC210-B03/S38 		Planon: room co² d30 		Master: room co≤ d30
MC210-B03/S4 		Planon: room co² a18 		Master: room co≤ a18
MC210-B03/S40 		Planon: room co² d03 		Master: room co≤ d03
MC210-B03/S6 		Planon: room co² a19 		Master: room co≤ a19
MC210-B03/S8 		Planon: room co² a21 		Master: room co≤ a21
MC211-B01/I1 		Planon: heating press. unit lp 		Master: xcite/io/8di/8ti
MC211-B01/O1 		Planon: optimum start stop 1 		Master: alarm route 1
OC004-B01/L1 		Planon: nan 		Master: 
OC004-B01/L2 		Planon: nan 		Master: 
OC004-B01/L3 		Planon: nan 		Master: 
OC004-B01/L4 		Planon: nan 		Master: 
OC005-B01/L1 		Planon: nan 		Master: 
OC005-B01/L2 		Planon: nan 		Master: 
OC005-B01/L3 		Planon: nan 		Master: 
OC006-B01/L1 		Planon: nan 		Master: 
OC006-B01/L2 		Planon: nan 		Master: 
OC006-B01/L3 		Planon: nan 		Master: 

Let us repeat the exercise for Logger Channel. Cross-validate, flag as highly likely error where both mismatch.


In [81]:
sum(planon_meterssensors_intersected['Logger Channel']!=master_meterssensors_for_validation_intersected['Logger Channel'])


Out[81]:
863

In [82]:
planon_meterssensors_intersected['Logger Channel']=[str(s).lower().strip().replace('  ',' ').replace('   ',' ') for s in planon_meterssensors_intersected['Logger Channel'].values]
master_meterssensors_for_validation_intersected['Logger Channel']=[str(s).lower().strip().replace('  ',' ').replace('   ',' ') for s in master_meterssensors_for_validation_intersected['Logger Channel'].values]

In [83]:
sum(planon_meterssensors_intersected['Logger Channel']!=master_meterssensors_for_validation_intersected['Logger Channel'])


Out[83]:
0

All errors fixed on logger channels.


In [84]:
for i in planon_meterssensors_intersected[planon_meterssensors_intersected['Logger Channel']!=master_meterssensors_for_validation_intersected['Logger Channel']].index:
    print(i,'\t\tPlanon:',planon_meterssensors_intersected.loc[i]['Logger Channel'],'\t\tMaster:',master_meterssensors_for_validation_intersected.loc[i]['Logger Channel'])

New error percentage:


In [85]:
(planon_meterssensors_intersected!=master_meterssensors_for_validation_intersected).sum()/\
len(planon_meterssensors_intersected)*100


Out[85]:
Building Name     1.802653
Fiscal meter      0.000000
Logger Channel    0.000000
Code              0.675151
Building Code     0.000000
Tenant meter      0.000000
Description       1.363805
dtype: float64

2.2. Loggers


In [143]:
buildings=set(planon_loggerscontrollers['BuildingNo.'])
buildings


Out[143]:
{'AP000',
 'AP001',
 'AP009',
 'AP010',
 'AP011',
 'AP057',
 'AP080',
 'AP081',
 'EX001',
 'MC001',
 'MC003',
 'MC007',
 'MC008',
 'MC010',
 'MC011',
 'MC013',
 'MC014',
 'MC029',
 'MC030',
 'MC031',
 'MC032',
 'MC033',
 'MC042',
 'MC043',
 'MC044',
 'MC045',
 'MC046',
 'MC047',
 'MC048',
 'MC050',
 'MC051',
 'MC053',
 'MC055',
 'MC060',
 'MC061',
 'MC062',
 'MC063',
 'MC064',
 'MC065',
 'MC066',
 'MC067',
 'MC068',
 'MC069',
 'MC070',
 'MC071',
 'MC072',
 'MC075',
 'MC076',
 'MC077',
 'MC078',
 'MC083',
 'MC095',
 'MC099',
 'MC102',
 'MC103',
 'MC125',
 'MC126',
 'MC128',
 'MC129',
 'MC131',
 'MC134',
 'MC138',
 'MC139',
 'MC140',
 'MC141',
 'MC171',
 'MC181',
 'MC197',
 'MC198',
 'MC199',
 'MC200',
 'MC202',
 'MC203',
 'MC204',
 'MC207',
 'MC210',
 'MC211',
 'OC004',
 'OC005',
 'OC006'}

In [145]:
master_loggerscontrollers_for_validation = \
    pd.concat([master_loggerscontrollers.loc[master_loggerscontrollers['Building Code'] == building] \
           for building in buildings])
master_loggerscontrollers_for_validation.head(2)


Out[145]:
Building Code Building Name Space Description Classification Group Make Model Logger Serial Number Logger Mac Address Logger Ip Address Logger Modem Serial Number Logger Sim Network Point Id Logger Upstream Comms Target Additional Location Info
AP009-L01 AP009 House 09 - Devoke, Graduate College A124 Data logger: Graduate College - House 9 Data logger Enercom Multilog G2 0501E38A6300 00-50-C2-2C-3D-CB NaN NaN NaN NaN NaN Devoke House, Room A124
MC014-L01 MC014 Bowland Hall A0 Data logger: Bowland Hall Data logger Enercom Multilog G2 050137C89C00 00-50-C2-2C-3E-38 10.23.12.9 NaN NaN NaN NaN House 2 SR1 / House 4 SR1

In [146]:
master_loggerscontrollers[master_loggerscontrollers['Building Code']=='MC060']


Out[146]:
Building Code Building Name Space Description Classification Group Make Model Logger Serial Number Logger Mac Address Logger Ip Address Logger Modem Serial Number Logger Sim Network Point Id Logger Upstream Comms Target Additional Location Info
MC060-L01 MC060 Furness Residences, Bardsea PL1 Data logger: Furness Residences Data logger Enercom Multilog G2 0501988FCB00 00-50-C2-2C-3E-32 10.23.12.13 NaN NaN NaN NaN NaN

In [147]:
planon_loggerscontrollers[planon_loggerscontrollers['BuildingNo.']=='MC060']


Out[147]:
BuildingNo. Building Locations.Space.Space number Space Name Additional Location Info Description Classification Group Record HVAC Ref Element Description ... Logger MAC Address Logger SIM Meter Pulse Value Meter Units Meter Capacity Network Point ID Tenant Meter.Name Fiscal Meter.Name EIS Space.Space number Utility Type.Name
MC060-L01 MC060 Furness Residences, Bardsea PL1 Plant Room NaN Data logger: Furness Residences EN.EN1 Data Logger NaN NaN NaN ... 00-50-C2-2C-3E-32 NaN NaN NaN NaN NaN NaN NaN NaN NaN

1 rows × 29 columns


In [148]:
master_loggerscontrollers.loc['MC060-L01']


Out[148]:
Building Code                                             MC060
Building Name                       Furness Residences, Bardsea
Space                                                       PL1
Description                     Data logger: Furness Residences
Classification Group                                Data logger
Make                                                    Enercom
Model                                               Multilog G2
Logger Serial Number                               0501988FCB00
Logger Mac Address                            00-50-C2-2C-3E-32
Logger Ip Address                                   10.23.12.13
Logger Modem Serial Number                                  NaN
Logger Sim                                                  NaN
Network Point Id                                            NaN
Logger Upstream Comms Target                                NaN
Additional Location Info                                    NaN
Name: MC060-L01, dtype: object

In [149]:
len(master_loggerscontrollers_for_validation)


Out[149]:
291

In [150]:
len(planon_loggerscontrollers)-len(planon_loggerscontrollers.index[planon_loggerscontrollers.index.duplicated()])


Out[150]:
273

In [151]:
master_loggerscontrollers_for_validation.sort_index(inplace=True)
planon_loggerscontrollers.sort_index(inplace=True)

In [152]:
master_loggerscontrollers_for_validation.loc['MC060-L01']


Out[152]:
Building Code                                             MC060
Building Name                       Furness Residences, Bardsea
Space                                                       PL1
Description                     Data logger: Furness Residences
Classification Group                                Data logger
Make                                                    Enercom
Model                                               Multilog G2
Logger Serial Number                               0501988FCB00
Logger Mac Address                            00-50-C2-2C-3E-32
Logger Ip Address                                   10.23.12.13
Logger Modem Serial Number                                  NaN
Logger Sim                                                  NaN
Network Point Id                                            NaN
Logger Upstream Comms Target                                NaN
Additional Location Info                                    NaN
Name: MC060-L01, dtype: object

In [153]:
planon_loggerscontrollers.T


Out[153]:
AP000-L01 AP000-L02 AP000-L03 AP001-L01 AP009-L01 AP010-L01 AP011-L01 AP057-L01 AP080-L01 AP081-L01 ... MC204-L05 MC204-L06 MC207-B01 MC210-B01 MC210-B02 MC210-B03 MC211-B01 OC004-B01 OC005-B01 OC006-B01
BuildingNo. AP000 AP000 AP000 AP001 AP009 AP010 AP011 AP057 AP080 AP081 ... MC204 MC204 MC207 MC210 MC210 MC210 MC211 OC004 OC005 OC006
Building Alexandra Park Alexandra Park Alexandra Park House 01 - Bassenthwaite, Graduate College House 09 - Devoke, Graduate College House 10 - Elterwater, Graduate College House 11 - Ennerdale, Graduate College Alexandra Park Laundrette Lonsdale House (Block 12) Barker House Farm ... Sports Centre Sports Centre HR Building Engineering Building Engineering Building Engineering Building Life Sciences & Environment Laboratories Chancellor's Wharf, Wyre House Chancellor's Wharf, Lune House Chancellor's Wharf, Kent House
Locations.Space.Space number A0 A0 A0 A104 A124 A109 A102 A0 A13 A64 ... RF04 RF04 NaN NaN NaN NaN NaN NaN NaN NaN
Space Name Whole Site Whole Site Whole Site Electrical Riser Electrical Riser/Cupboard Electrical Riser Electrical Riser Whole Building Laundrette Service Riser ... Roof Top Plant Room Roof Top Plant Room NaN NaN NaN NaN NaN NaN NaN NaN
Additional Location Info NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Description Data logger: Alexandra Park Data logger: Alexandra Park Data logger: Alexandra Park Data logger: Graduate College - House 1 Data logger: Graduate College - House 9 Data logger: Graduate College - House 10 Data logger: Graduate College - House 11 Data logger: Alexandra Park Laundrette Data logger: Lonsdale House - Laundrette Data logger: Barker House Farm ... Data logger: Sports Centre Data logger: Sports Centre BMS Controller: HR Building BMS Controller: Engineering Building BMS Controller: Engineering Building BMS Controller: Engineering Building BMS Controller: Life Sciences & Environment La... BMS Controller: Chancellors Wharf BMS Controller: Chancellors Wharf BMS Controller: Chancellors Wharf
Classification Group EN.EN1 Data Logger EN.EN1 Data Logger EN.EN1 Data Logger EN.EN1 Data Logger EN.EN1 Data Logger EN.EN1 Data Logger EN.EN1 Data Logger EN.EN1 Data Logger EN.EN1 Data Logger EN.EN1 Data Logger ... EN.EN1 Data Logger EN.EN1 Data Logger EN.EN4 BMS Controller EN.EN4 BMS Controller EN.EN4 BMS Controller EN.EN4 BMS Controller EN.EN4 BMS Controller EN.EN4 BMS Controller EN.EN4 BMS Controller EN.EN4 BMS Controller
Record NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
HVAC Ref NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Element Description NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Servicable Area NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Model Multilog G2 Multilog G2 Multilog G2 Multilog G2 Multilog G2 Multilog G2 Multilog G2 Multilog G2 Multilog G2 Multilog G2 ... Multilog G2 Multilog G2 IQ3xcite96 IQ3xcite128 IQ3xcite128 IQ3xcite128 IQ3xcite96 IQ3xact12 IQ3xact12 IQ3xact12
Make Enercom Enercom Enercom Enercom Enercom Enercom Enercom Enercom Enercom Enercom ... Enercom Enercom Trend Trend Trend Trend Trend Trend Trend Trend
EIS ID 050157C7ED00 37475126 48015355 0501E3E97100 0501E38A6300 0501E3D07500 0501E3839500 050157C16100 050157AB6700 050157C09600 ... 0501F26DBC00 050200C3E800 3BF53C6F-96DB-4B9B-8B7C-ED6D6490F4E5 0F850990-984A-49FC-B351-82CCFD6A644B B39C7903-72F6-4B03-A5B6-6CE8CF57D680 9DA6D329-30E9-46CC-A840-5B656A5FFDC2 C587E3F2-E604-4C9B-827D-80797E53FC58 48352BB4-4B1B-4013-AB9F-14E143E83948 281682DC-5479-4064-8290-E873933872B0 BBD3685B-B0DC-417F-A0E8-20139B1074E1
Logger Channel 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0
Logger Upstream Comms Target NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger Modem Serial Number NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger IP Address 10.23.9.39 NaN NaN 10.23.12.36 NaN 10.23.12.37 10.23.12.38 80.93.175.91:40455 10.23.9.40 10.23.9.41 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger Serial Number NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger MAC Address 00-50-C2-2C-3E-43 NaN NaN 00-50-C2-2C-3D-DE 00-50-C2-2C-3D-CB 00-50-C2-2C-3D-D1 00-50-C2-2C-3D-A7 NaN 00-50-C2-2C-3D-1B 00-50-C2-2C-3D-17 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger SIM NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Meter Pulse Value NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Meter Units NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Meter Capacity NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Network Point ID NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Tenant Meter.Name NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Fiscal Meter.Name NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
EIS Space.Space number NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Utility Type.Name NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN

29 rows × 273 columns


In [154]:
master_loggerscontrollers_for_validation.T


Out[154]:
AP000-L01 AP000-L02 AP000-L03 AP001-L01 AP009-L01 AP010-L01 AP011-L01 AP057-L01 AP080-L01 AP081-L01 ... MC210-B01 MC210-B02 MC210-B03 MC210-L01 MC210-L02 MC211-B01 NAN OC004-B01 OC005-B01 OC006-B01
Building Code AP000 AP000 AP000 AP001 AP009 AP010 AP011 AP057 AP080 AP081 ... MC210 MC210 MC210 MC210 MC210 MC211 MC202 OC004 OC005 OC006
Building Name Alexandra Park Alexandra Park Alexandra Park House 01 - Bassenthwaite, Graduate College House 09 - Devoke, Graduate College House 10 - Elterwater, Graduate College House 11 - Ennerdale, Graduate College Alexandra Park Laundrette Lonsdale House (Block 12) Barker House Farm ... Engineering Building Engineering Building Engineering Building Engineering Building Engineering Building Life Sciences & Environment Laboratories Charles Carter Building Chancellors Wharf Chancellors Wharf Chancellors Wharf
Space A0 A0 A0 A104 A124 A109 A102 A0 A13 A64 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Description Data logger: Alexandra Park Data logger: Alexandra Park Data logger: Alexandra Park Data logger: Graduate College - House 1 Data logger: Graduate College - House 9 Data logger: Graduate College - House 10 Data logger: Graduate College - House 11 Data logger: Alexandra Park Laundrette Data logger: Lonsdale House - Laundrette Data logger: Barker House Farm ... BMS Controller: Engineering Building BMS Controller: Engineering Building BMS Controller: Engineering Building Data logger: Engineering Data logger: Engineering BMS Controller: Life Sciences & Environment La... Data logger: Charles Carter Building BMS Controller: Chancellors Wharf BMS Controller: Chancellors Wharf BMS Controller: Chancellors Wharf
Classification Group Data logger Data logger Data logger Data logger Data logger Data logger Data logger Data logger Data logger Data logger ... BMS controller BMS controller BMS controller Data logger Data logger BMS controller Data logger BMS controller BMS controller BMS controller
Make Enercom Enercom Enercom Enercom Enercom Enercom Enercom Enercom Enercom Enercom ... Trend Trend Trend SIP SIP Trend Synetica Trend Trend Trend
Model Multilog G2 Multilog G2 Multilog G2 Multilog G2 Multilog G2 Multilog G2 Multilog G2 Multilog G2 Multilog G2 Multilog G2 ... IQ3xcite128 IQ3xcite128 IQ3xcite128 SIP MLog SIP MLog IQ3xcite96 DS800-M-32 IQ3xact12 IQ3xact12 IQ3xact12
Logger Serial Number 050157C7ED00 37475126 48015355 0501E3E97100 0501E38A6300 0501E3D07500 0501E3839500 050157C16100 050157AB6700 050157C09600 ... {0F850990-984A-49FC-B351-82CCFD6A644B} {B39C7903-72F6-4B03-A5B6-6CE8CF57D680} {9DA6D329-30E9-46CC-A840-5B656A5FFDC2} NaN NaN {C587E3F2-E604-4C9B-827D-80797E53FC58} 47e22ca9-a8f8-4781-963d-31382df0d5c6 {48352BB4-4B1B-4013-AB9F-14E143E83948} {281682DC-5479-4064-8290-E873933872B0} {BBD3685B-B0DC-417F-A0E8-20139B1074E1}
Logger Mac Address 00-50-C2-2C-3E-43 NaN NaN 00-50-C2-2C-3D-DE 00-50-C2-2C-3D-CB 00-50-C2-2C-3D-D1 00-50-C2-2C-3D-A7 NaN 00-50-C2-2C-3D-1B 00-50-C2-2C-3D-17 ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger Ip Address 10.23.9.39 NaN NaN 10.23.12.36 NaN 10.23.12.37 10.23.12.38 80.93.175.91:40455 10.23.9.40 10.23.9.41 ... ng-bms01-e01.bms.local ng-bms02-e01.bms.local ng-bms03-e01.bms.local 10.23.16.51 10.23.16.52 bs-bms01-bslplant.bms.local cc-meter01-plant.bms.local cw-meter03-plant.bms.local cw-meter02-plant.bms.local cw-meter01-plant.bms.local
Logger Modem Serial Number NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger Sim NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Network Point Id NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Logger Upstream Comms Target NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Additional Location Info Graduatae 1-11 Plant Room External Gas Meter Building External Water Meter Chamber A017 Devoke House, Room A124 Elderwater House, Room A109 Ennerdale House - Room A102 Cartmel Laundrette Plant Room MCC Plant Room ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN

15 rows × 291 columns

Create dictionary that maps Planon column names onto Master.

From Nicola:

  • EIS ID (Serial Number)
  • Make
  • Model
  • Description
  • Code (Asset Code)
  • Building Code

Building code and Building name are implicitly included. Logger IP or MAC would be essential to include, as well as Make and Model. Additional Location Info is not essnetial but would be useful to have. Locations (Locations.Space.Space number and Space Name) are included in the Planon export - but this is their only viable data source, therefore are not validated against.


In [155]:
#Planon:Master
loggers_match_dict={
      "BuildingNo.":"Building Code",
      "Building":"Building Name",
      "Description":"Description",
      "EIS ID":"Logger Serial Number",
      "Make":"Make",
      "Model":"Model"
      }

In [156]:
master_loggerscontrollers_for_validation_filtered=master_loggerscontrollers_for_validation[list(loggers_match_dict.values())]
planon_loggerscontrollers_filtered=planon_loggerscontrollers[list(loggers_match_dict.keys())]

In [157]:
master_loggerscontrollers_for_validation_filtered.head(2)


Out[157]:
Description Building Code Building Name Logger Serial Number Make Model
AP000-L01 Data logger: Alexandra Park AP000 Alexandra Park 050157C7ED00 Enercom Multilog G2
AP000-L02 Data logger: Alexandra Park AP000 Alexandra Park 37475126 Enercom Multilog G2

In [158]:
planon_loggerscontrollers_filtered.head(2)


Out[158]:
Description BuildingNo. Building EIS ID Make Model
AP000-L01 Data logger: Alexandra Park AP000 Alexandra Park 050157C7ED00 Enercom Multilog G2
AP000-L02 Data logger: Alexandra Park AP000 Alexandra Park 37475126 Enercom Multilog G2

In [159]:
planon_loggerscontrollers_filtered.columns=[loggers_match_dict[i] for i in planon_loggerscontrollers_filtered]

In [160]:
planon_loggerscontrollers_filtered.drop_duplicates(inplace=True)
master_loggerscontrollers_for_validation_filtered.drop_duplicates(inplace=True)


C:\Anaconda2\envs\python3\lib\site-packages\pandas\util\decorators.py:91: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  return func(*args, **kwargs)

In [161]:
planon_loggerscontrollers_filtered.head(2)


Out[161]:
Description Building Code Building Name Logger Serial Number Make Model
AP000-L01 Data logger: Alexandra Park AP000 Alexandra Park 050157C7ED00 Enercom Multilog G2
AP000-L02 Data logger: Alexandra Park AP000 Alexandra Park 37475126 Enercom Multilog G2

In [162]:
master_loggerscontrollers_for_validation_filtered.head(2)


Out[162]:
Description Building Code Building Name Logger Serial Number Make Model
AP000-L01 Data logger: Alexandra Park AP000 Alexandra Park 050157C7ED00 Enercom Multilog G2
AP000-L02 Data logger: Alexandra Park AP000 Alexandra Park 37475126 Enercom Multilog G2

In [163]:
a=np.sort(list(set(planon_loggerscontrollers_filtered.index)))
b=np.sort(list(set(master_loggerscontrollers_for_validation_filtered.index)))
loggerscontrollers_not_in_planon=[]
for i in b:
    if i not in a:
        print(i+',',end=" "),
        loggerscontrollers_not_in_planon.append(i)
print('\n\nLoggers in Master, but not in Planon:',
      len(loggerscontrollers_not_in_planon),'/',len(b),':',
      round(len(loggerscontrollers_not_in_planon)/len(b)*100,3),'%')


MC032-L01, MC032-L03, MC044-L02, MC046-L01, MC046-L19, MC061-L01, MC076-B03, MC204-L03, MC207-L01, MC210-L01, NAN, 

Loggers in Master, but not in Planon: 11 / 284 : 3.873 %

In [164]:
a=np.sort(list(set(planon_loggerscontrollers_filtered.index)))
b=np.sort(list(set(master_loggerscontrollers_for_validation_filtered.index)))
loggerscontrollers_not_in_master=[]
for i in a:
    if i not in b:
        print(i+',',end=" "),
        loggerscontrollers_not_in_master.append(i)
print('\n\nLoggers in Planon, not in Master:',
      len(loggerscontrollers_not_in_master),'/',len(a),':',
      round(len(loggerscontrollers_not_in_master)/len(a)*100,3),'%')



Loggers in Planon, not in Master: 0 / 273 : 0.0 %

In [88]:
print(len(planon_loggerscontrollers_filtered.index))
print(len(set(planon_loggerscontrollers_filtered.index)))
print(len(master_loggerscontrollers_for_validation_filtered.index))
print(len(set(master_loggerscontrollers_for_validation_filtered.index)))


273
273
282
282

In [89]:
master_loggerscontrollers_for_validation_filtered[master_loggerscontrollers_for_validation_filtered.index.duplicated()]


Out[89]:
Description Building Code Building Name Logger Serial Number Make Model

In [90]:
comon_index=list(set(master_loggerscontrollers_for_validation_filtered.index).intersection(set(planon_loggerscontrollers_filtered.index)))

In [91]:
master_loggerscontrollers_for_validation_intersected=master_loggerscontrollers_for_validation_filtered.loc[comon_index].sort_index()
planon_loggerscontrollers_intersected=planon_loggerscontrollers_filtered.loc[comon_index].sort_index()

In [92]:
master_loggerscontrollers_for_validation_intersected.head(2)


Out[92]:
Description Building Code Building Name Logger Serial Number Make Model
AP000-L01 Data logger: Alexandra Park AP000 Alexandra Park 050157C7ED00 Enercom Multilog G2
AP000-L02 Data logger: Alexandra Park AP000 Alexandra Park 37475126 Enercom Multilog G2

In [93]:
planon_loggerscontrollers_intersected.head(2)


Out[93]:
Description Building Code Building Name Logger Serial Number Make Model
AP000-L01 Data logger: Alexandra Park AP000 Alexandra Park 050157C7ED00 Enercom Multilog G2
AP000-L02 Data logger: Alexandra Park AP000 Alexandra Park 37475126 Enercom Multilog G2

In [94]:
planon_loggerscontrollers_intersected==master_loggerscontrollers_for_validation_intersected


Out[94]:
Description Building Code Building Name Logger Serial Number Make Model
AP000-L01 True True True True True True
AP000-L02 True True True False True True
AP000-L03 True True True False True True
AP001-L01 True True True True True True
AP009-L01 True True True True True True
AP010-L01 True True True True True True
AP011-L01 True True True True True True
AP057-L01 True True True True True True
AP080-L01 True True True True True True
AP081-L01 True True True True True True
EX001-B01 True True False False True True
MC000-L01 True True True True True True
MC001-B01 True True True False True True
MC001-L01 True True True True True True
MC001-L02 True True True True True True
MC003-B01 True True True False True True
MC003-L01 True True True True True True
MC003-L02 True True True True True True
MC007-L01 True True True True True True
MC008-L01 True True True True True True
MC010-L01 True True True True True True
MC011-B01 True True True False True True
MC011-L01 True True True True True True
MC013-L01 True True True True True True
MC014-B01 True True True False True True
MC014-B02 True True True False True True
MC014-B03 True True True False True True
MC014-B04 True True True False True True
MC014-B05 True True True False True True
MC014-B06 True True True False True True
... ... ... ... ... ... ...
MC202-B10 True True True False True True
MC202-B11 True True True False True True
MC202-B12 True True True False True True
MC202-B13 True True True False True True
MC202-B14 True True True False True True
MC202-B15 True True True False True True
MC202-B16 True True True False True True
MC202-B17 True True True False True True
MC202-L01 True True True True True True
MC202-L02 True True True True True True
MC202-L03 True True True True True True
MC203-L01 True True True True True True
MC204-B01 True True True False True True
MC204-B02 True True True False True True
MC204-B03 True True True False True True
MC204-B04 True True True False True True
MC204-B05 True True True False True True
MC204-B06 True True True False True True
MC204-L01 True True True True True True
MC204-L02 True True True True True True
MC204-L05 True True True True True True
MC204-L06 True True True True True True
MC207-B01 True True True False True True
MC210-B01 True True True False True True
MC210-B02 True True True False True True
MC210-B03 True True True False True True
MC211-B01 True True True False True True
OC004-B01 True True False False True True
OC005-B01 True True False False True True
OC006-B01 True True False False True True

271 rows × 6 columns

Loggers matching


In [95]:
(planon_loggerscontrollers_intersected==master_loggerscontrollers_for_validation_intersected).sum()


Out[95]:
Description             271
Building Code           271
Building Name           254
Logger Serial Number    138
Make                    271
Model                   271
dtype: int64

Percentage matching


In [96]:
(planon_loggerscontrollers_intersected==master_loggerscontrollers_for_validation_intersected).sum()/\
len(planon_loggerscontrollers_intersected)*100


Out[96]:
Description             100.000000
Building Code           100.000000
Building Name            93.726937
Logger Serial Number     50.922509
Make                    100.000000
Model                   100.000000
dtype: float64

In [97]:
((planon_loggerscontrollers_intersected==master_loggerscontrollers_for_validation_intersected).sum()/\
len(planon_loggerscontrollers_intersected)*100).plot(kind='bar')


Out[97]:
<matplotlib.axes._subplots.AxesSubplot at 0x1d37dabddd8>

Loggers not matching on Building Name.


In [98]:
sum(planon_loggerscontrollers_intersected['Building Name']!=master_loggerscontrollers_for_validation_intersected['Building Name'])


Out[98]:
17

In [99]:
planon_loggerscontrollers_intersected['Building Name']=[str(s).lower().strip().replace('  ',' ').replace('   ',' ') for s in planon_loggerscontrollers_intersected['Building Name'].values]
master_loggerscontrollers_for_validation_intersected['Building Name']=[str(s).lower().strip().replace('  ',' ').replace('   ',' ') for s in master_loggerscontrollers_for_validation_intersected['Building Name'].values]

In [100]:
sum(planon_loggerscontrollers_intersected['Building Name']!=master_loggerscontrollers_for_validation_intersected['Building Name'])


Out[100]:
16

That didnt help.


In [101]:
for i in planon_loggerscontrollers_intersected[planon_loggerscontrollers_intersected['Building Name']!=master_loggerscontrollers_for_validation_intersected['Building Name']].index:
    print(i,'\t\tPlanon:',planon_loggerscontrollers_intersected.loc[i]['Building Name'],'\t\tMaster:',master_loggerscontrollers_for_validation_intersected.loc[i]['Building Name'])


EX001-B01 		Planon: roads - main campus 		Master: underpass
MC029-B01 		Planon: cetad 		Master: bowland hall cetad
MC033-L03 		Planon: county john creed 		Master: john creed
MC047-B02 		Planon: welcome centre 		Master: conference centre
MC047-L01 		Planon: welcome centre 		Master: conference centre
MC047-L02 		Planon: welcome centre 		Master: conference centre
MC055-B01 		Planon: furness residences 		Master: furness blocks
MC071-B01 		Planon: furness college 		Master: furness
MC072-B02 		Planon: psc 		Master: psc building
MC072-B04 		Planon: psc 		Master: psc building
MC103-B01 		Planon: lancaster house hotel 		Master: hotel
MC198-B01 		Planon: grizedale college - offices, bar & social space 		Master: grizedale
MC198-B02 		Planon: grizedale college - offices, bar & social space 		Master: grizedale
OC004-B01 		Planon: chancellor's wharf, wyre house 		Master: chancellors wharf
OC005-B01 		Planon: chancellor's wharf, lune house 		Master: chancellors wharf
OC006-B01 		Planon: chancellor's wharf, kent house 		Master: chancellors wharf

Follow up with lexical distance comparison. That would flag this as a match.

Loggers not matching on Serial Number.


In [102]:
sum(planon_loggerscontrollers_intersected['Logger Serial Number']!=master_loggerscontrollers_for_validation_intersected['Logger Serial Number'])


Out[102]:
133

In [103]:
planon_loggerscontrollers_intersected['Logger Serial Number']=[str(s).lower().strip().replace('  ',' ').replace('   ',' ').replace('{','').replace('}','') for s in planon_loggerscontrollers_intersected['Logger Serial Number'].values]
master_loggerscontrollers_for_validation_intersected['Logger Serial Number']=[str(s).lower().strip().replace('  ',' ').replace('   ',' ').replace('{','').replace('}','') for s in master_loggerscontrollers_for_validation_intersected['Logger Serial Number'].values]

In [104]:
sum(planon_loggerscontrollers_intersected['Logger Serial Number']!=master_loggerscontrollers_for_validation_intersected['Logger Serial Number'])


Out[104]:
9

In [105]:
for i in planon_loggerscontrollers_intersected[planon_loggerscontrollers_intersected['Logger Serial Number']!=master_loggerscontrollers_for_validation_intersected['Logger Serial Number']].index:
    print(i,'\t\tPlanon:',planon_loggerscontrollers_intersected.loc[i]['Logger Serial Number'],'\t\tMaster:',master_loggerscontrollers_for_validation_intersected.loc[i]['Logger Serial Number'])


MC032-L04 		Planon: 50198367 		Master: 050198367e00
MC046-L05 		Planon: 50198895300 		Master: 050198895300
MC063-L01 		Planon: 50198829500 		Master: 050198829500
MC064-L03 		Planon: 50198872600 		Master: 050198872600
MC071-L02 		Planon: 50201286300 		Master: 050201286300
MC071-L05 		Planon: 50201221 		Master: 050201221e00
MC071-L16 		Planon: 50198904000 		Master: 050198904000
MC078-L03 		Planon: 50198864300 		Master: 050198864300
MC102-L01 		Planon: 50157909800 		Master: 050157909800

Technically the same, but there is a number format error. Compare based on float value, if they match, replace one of them. This needs to be amended, as it will throw cannot onvert to float exception if strings are left in from the previous step.


In [106]:
z1=[]
z2=[]    
for i in planon_loggerscontrollers_intersected.index:
    if planon_loggerscontrollers_intersected.loc[i]['Logger Serial Number']!=master_loggerscontrollers_for_validation_intersected.loc[i]['Logger Serial Number']:
        if float(planon_loggerscontrollers_intersected.loc[i]['Logger Serial Number'])==\
          float(master_loggerscontrollers_for_validation_intersected.loc[i]['Logger Serial Number']):
                z1.append(str(int(float(planon_loggerscontrollers_intersected.loc[i]['Logger Serial Number']))))
                z2.append(str(int(float(planon_loggerscontrollers_intersected.loc[i]['Logger Serial Number']))))
        else:
            z1.append(planon_loggerscontrollers_intersected.loc[i]['Logger Serial Number'])
            z2.append(master_loggerscontrollers_for_validation_intersected.loc[i]['Logger Serial Number'])
    else:
        z1.append(planon_loggerscontrollers_intersected.loc[i]['Logger Serial Number'])
        z2.append(planon_loggerscontrollers_intersected.loc[i]['Logger Serial Number'])
planon_loggerscontrollers_intersected['Logger Serial Number']=z1
master_loggerscontrollers_for_validation_intersected['Logger Serial Number']=z2

In [107]:
for i in planon_loggerscontrollers_intersected[planon_loggerscontrollers_intersected['Logger Serial Number']!=master_loggerscontrollers_for_validation_intersected['Logger Serial Number']].index:
    print(i,'\t\tPlanon:',planon_loggerscontrollers_intersected.loc[i]['Logger Serial Number'],'\t\tMaster:',master_loggerscontrollers_for_validation_intersected.loc[i]['Logger Serial Number'])

New error percentage:


In [108]:
(planon_loggerscontrollers_intersected!=master_loggerscontrollers_for_validation_intersected).sum()/\
len(planon_loggerscontrollers_intersected)*100


Out[108]:
Description             0.000000
Building Code           0.000000
Building Name           5.904059
Logger Serial Number    0.000000
Make                    0.000000
Model                   0.000000
dtype: float64

(Bearing in my mind the above, this is technically 0)