EIS metadata validation script

Used to validate Planon output with spreadsheet input

1. Data import


In [1]:
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 [2]:
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 [3]:
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 [4]:
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 [5]:
# 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 [6]:
len(planon_loggerscontrollers.index[planon_loggerscontrollers.index.duplicated()])


Out[6]:
0

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


Out[7]:
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 [8]:
planon_meterssensors.head(3)


Out[8]:
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 [9]:
buildings=set(planon_meterssensors['BuildingNo.'])
buildings


Out[9]:
{'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 [10]:
len(buildings)


Out[10]:
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 [11]:
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[11]:
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
MC139-L01/M001 050157AC6600 Sub No.9 Transformer No.1 Carlo Gavazzi EM24 kWh 1.0 Energy meter 1 Electricity NaN ... Sub Station 9 NaN Graduate Field 0.0 0.0 NaN NaN NaN NaN MC139-L01/M001
MC139-L01/M002 050157AC6600 Sub No.9 Transformer No.2 Carlo Gavazzi EM24 kWh 1.0 Energy meter 2 Electricity NaN ... Sub Station 9 NaN Graduate Field 0.0 0.0 NaN NaN NaN NaN MC139-L01/M002

2 rows × 22 columns


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


Out[12]:
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 [13]:
#alternative method
master_meterssensors_for_validation2 = \
    master_meterssensors[master_meterssensors['Building Code'].isin(buildings)]
master_meterssensors_for_validation2.head(2)


Out[13]:
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 [14]:
len(master_meterssensors_for_validation)


Out[14]:
30539

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


Out[15]:
29623

Sort datasets after index for easier comparison.


In [16]:
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 [17]:
planon_meterssensors.T


Out[17]:
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 [18]:
master_meterssensors_for_validation.T


Out[18]:
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 [19]:
#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 [20]:
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 [21]:
pd.DataFrame(master_meterssensors_for_validation_filtered.loc['MC202-B15/F15'])


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

In [22]:
master_meterssensors_for_validation_filtered.head(2)


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

In [23]:
planon_meterssensors_filtered.head(2)


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

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


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

In [25]:
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 [26]:
planon_meterssensors_filtered.head(2)


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

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


In [27]:
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 [28]:
master_meterssensors_for_validation_filtered.head(2)


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

In [29]:
planon_meterssensors_filtered.head(2)


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

Cross-check missing meters


In [30]:
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 [31]:
#without MC210
len(set([i for i in meterssensors_not_in_planon if i[:5]!='MC210']))


Out[31]:
32

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


Out[32]:
{'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 [33]:
(set([i[:5] for i in meterssensors_not_in_planon]))


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

In [34]:
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 [35]:
len(set([i for i in meterssensors_not_in_master]))


Out[35]:
0

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


Out[36]:
set()

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


Out[37]:
set()

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


In [38]:
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 [39]:
master_meterssensors_for_validation_filtered[master_meterssensors_for_validation_filtered.index.duplicated()]


Out[39]:
Code Fiscal meter Description Tenant meter Building Name Logger Channel Building Code
MC011-B01/I1 MC011-B01/I1 False Fire alarm active False The Roundhouse I1 MC011
MC011-B01/I2 MC011-B01/I2 False LTHW Pri Pmp Flow False The Roundhouse I2 MC011
MC011-B01/O1 MC011-B01/o1 False Alarm Route 1 False The Roundhouse o1 MC011
MC014-B01/O1 MC014-B01/O1 False Heating times False Bowland Hall O1 MC014
MC014-B02/O1 MC014-B02/O1 False Heating times False Bowland Hall O1 MC014
MC014-B03/O1 MC014-B03/o1 False Alarm Route 1 False Bowland Hall o1 MC014
MC014-B04/O1 MC014-B04/o1 False Alarm Route 1 False Bowland Hall o1 MC014
MC014-B05/O1 MC014-B05/o1 False Alarm Route 1 False Bowland Hall o1 MC014
MC014-B06/O1 MC014-B06/o1 False Alarm Route 1 False Bowland Hall o1 MC014
MC014-B07/O1 MC014-B07/O1 False Heating times False Bowland Hall O1 MC014
MC014-B08/O1 MC014-B08/O1 False Heating times False Bowland Hall O1 MC014
MC014-B09/O1 MC014-B09/o1 False Alarm Route 1 False Bowland Hall o1 MC014
MC014-B10/O1 MC014-B10/O1 False Heating times False Bowland Hall O1 MC014
MC014-B11/O1 MC014-B11/O1 False Heating times False Bowland Hall O1 MC014
MC014-B12/O1 MC014-B12/O1 False Heating times False Bowland Hall O1 MC014
MC014-B13/O1 MC014-B13/o1 False Alarm Route 1 False Bowland Hall o1 MC014
MC014-B14/O1 MC014-B14/O1 False Heating times False Bowland Hall O1 MC014
MC031-B01/I1 MC031-B01/I1 False HWS Pump 1 or 2 Status False Great Hall I1 MC031
MC031-B01/I2 MC031-B01/i2 False xcite/IO/2UI/2AO False Great Hall i2 MC031
MC031-B01/I3 MC031-B01/I3 False Greathall ahu on-off False Great Hall I3 MC031
MC031-B01/I4 MC031-B01/I4 False Greathall Ahu 4 hr EXT False Great Hall I4 MC031
MC031-B02/I1 MC031-B02/I1 False Alarm Mute Pb False Great Hall I1 MC031
MC031-B02/I2 MC031-B02/i2 False Module 2 False Great Hall i2 MC031
MC032-B01/I1 MC032-B01/i1 False IQ4/IO/16DI False County South i1 MC032
MC032-B01/I2 MC032-B01/i2 False IQ4/IO/8UI False County South i2 MC032
MC032-B01/I3 MC032-B01/i3 False IQ4/IO/8DI False County South i3 MC032
MC032-B01/I4 MC032-B01/i4 False IQ4/IO/4DO False County South i4 MC032
MC032-B01/I5 MC032-B01/I5 False CT Pump Flow Prove False County South I5 MC032
MC032-B02/I1 MC032-B02/i1 False Module 1 False County South i1 MC032
MC032-B02/I2 MC032-B02/I2 False DHWS Gas Valve Shut False County South I2 MC032
... ... ... ... ... ... ... ...
NAN NaN False DB C2P False Library NaN MC065
NAN NaN False COMM 1 DB CP3 False Library NaN MC065
NAN NaN False COMM 2 DB CP4 False Library NaN MC065
NAN NaN False LIBRARY False Library NaN MC065
NAN NaN False Library Phase L1, L2, L3 False Library NaN MC065
NAN NaN False Library ??? False Library NaN MC065
NAN NaN False Library Bindery False Library NaN MC065
NAN NaN False DB LG2LP False Library NaN MC065
NAN NaN False Top Section Load False The Roundhouse NaN MC011
NAN NaN False Total Load False The Roundhouse NaN MC011
NAN NaN False DB/N/M1 False ISS Building NaN MC197
NAN NaN False NaN False ISS Building NaN MC197
NAN NaN False DB/N/L1 False ISS Building NaN MC197
NAN NaN False DB/N/P1 False ISS Building NaN MC197
NAN NaN False DB/N/L2 False ISS Building NaN MC197
NAN NaN False DB/N/P2 False ISS Building NaN MC197
NAN NaN False DB/N/L3 False ISS Building NaN MC197
NAN NaN False DB/N/P3 False ISS Building NaN MC197
NAN NaN False DB C1P False Library NaN MC065
NAN NaN False MCP 03 False Library 2 MC065
NAN NaN False DB C1L False Library NaN MC065
NAN NaN False DB B1L False Library NaN MC065
NAN NaN False DB C1 Power False Library 4 MC065
NAN NaN False DB D1 Lighting and Power False Library 5 MC065
NAN NaN False MCP 02 False Library 6 MC065
NAN NaN False DB B1P False Library NaN MC065
NAN NaN False Flat 3 False Bowland Main NaN MC046
NAN NaN False DB A1P False Library NaN MC065
NAN NaN False DB A1L False Library NaN MC065
NAN NaN False DB D2 Lighting and Power False Library 7 MC065

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 [40]:
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 [41]:
len(planon_meterssensors_filtered)


Out[41]:
29623

In [42]:
len(master_meterssensors_for_validation_filtered)


Out[42]:
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 [43]:
comon_index=list(set(master_meterssensors_for_validation_filtered.index).intersection(set(planon_meterssensors_filtered.index)))

In [44]:
len(comon_index)


Out[44]:
29623

In [45]:
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 [46]:
len(master_meterssensors_for_validation_intersected)


Out[46]:
30055

In [47]:
len(planon_meterssensors_intersected)


Out[47]:
29623

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


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

In [49]:
master_meterssensors_for_validation_intersected.head(2)


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

In [50]:
planon_meterssensors_intersected.head(2)


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

2.1.2. Primitive comparison


In [51]:
planon_meterssensors_intersected==master_meterssensors_for_validation_intersected


Out[51]:
Code Fiscal meter Description Tenant meter Building Name Logger Channel Building Code
AP000-L01/M001 True True False True True False True
AP000-L02/M001 True True True True True False True
AP000-L02/M002 True True True True True False True
AP000-L03/M001 True True False True True False True
AP000-L03/M002 True True False True True False True
AP001-L01/M001 True True False True False False True
AP001-L01/M002 True True False True False False True
AP001-L01/M003 True True False True False False True
AP001-L01/M004 True True False True False False True
AP001-L01/M005 True True True True False False True
AP001-L01/M006 True True True True False False True
AP009-L01/M001 True True True True False False True
AP009-L01/M002 True True True True False False True
AP009-L01/M003 True True False True False False True
AP010-L01/M001 True True True True False False True
AP010-L01/M002 True True True True False False True
AP010-L01/M003 True True True True False False True
AP010-L01/M004 True True True True False False True
AP010-L01/M005 True True True True False False True
AP011-L01/M001 True True True True False False True
AP011-L01/M002 True True True True False False True
AP011-L01/M003 True True True True False False True
AP011-L01/M004 True True True True False False True
AP057-L01/M001 True True False True True False True
AP057-L01/M002 True True True True True False True
AP057-L01/M003 True True True True True False True
AP080-L01/M001 True True False True True False True
AP080-L01/M002 True True True True True False True
AP080-L01/M003 True True True True True False True
AP081-L01/M001 True True False True True False True
... ... ... ... ... ... ... ...
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 False True True True True
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 [52]:
np.all(planon_meterssensors_intersected==master_meterssensors_for_validation_intersected)


Out[52]:
False

2.1.3. Horizontal comparison

Number of cells matching


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


Out[53]:
Code              29382
Fiscal meter      29623
Description       27985
Tenant meter      29623
Building Name     29089
Logger Channel    28719
Building Code     29623
dtype: int64

Percentage matching


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


Out[54]:
Code               99.186443
Fiscal meter      100.000000
Description        94.470513
Tenant meter      100.000000
Building Name      98.197347
Logger Channel     96.948317
Building Code     100.000000
dtype: float64

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


Out[55]:
<matplotlib.axes._subplots.AxesSubplot at 0x1edabf134e0>

2.1.4. Vertical comparison


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


Out[56]:
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 [57]:
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[57]:
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 85.714286
MC211-B01/O1 71.428571
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 [58]:
sum(planon_meterssensors_intersected['Description']!=master_meterssensors_for_validation_intersected['Description'])


Out[58]:
1638

In [59]:
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 [60]:
sum(planon_meterssensors_intersected['Description']!=master_meterssensors_for_validation_intersected['Description'])


Out[60]:
363

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 [61]:
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'])


MC011-B01/I1 		Planon: fire alarm active 		Master: xcite/io/16di
MC011-B01/I2 		Planon: xcite/io/8do 		Master: lthw pri pmp flow
MC014-B01/L4 		Planon: nan 		Master: 
MC014-B01/O1 		Planon: heating times 		Master: alarm route 1
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-B05/L4 		Planon: nan 		Master: 
MC014-B05/O1 		Planon: alarm route 1 		Master: heating times
MC014-B06/L4 		Planon: nan 		Master: 
MC014-B06/O1 		Planon: alarm route 1 		Master: heating times
MC014-B07/L4 		Planon: nan 		Master: 
MC014-B07/O1 		Planon: heating times 		Master: alarm route 1
MC014-B08/L4 		Planon: nan 		Master: 
MC014-B08/O1 		Planon: heating times 		Master: alarm route 1
MC014-B09/L4 		Planon: nan 		Master: 
MC014-B09/O1 		Planon: alarm route 1 		Master: heating times
MC014-B10/L4 		Planon: nan 		Master: 
MC014-B11/L4 		Planon: nan 		Master: 
MC014-B12/L4 		Planon: nan 		Master: 
MC014-B13/L4 		Planon: nan 		Master: 
MC014-B14/L4 		Planon: nan 		Master: 
MC029-B01/L4 		Planon: nan 		Master: 
MC031-B01/I2 		Planon: heating pump status 		Master: xcite/io/2ui/2ao
MC031-B01/I3 		Planon: xcite/io/4do 		Master: greathall ahu on-off
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/I3 		Planon: iq4/io/8di 		Master: water meter pulse
MC032-B01/L1 		Planon: nan 		Master: 
MC032-B01/L2 		Planon: nan 		Master: 
MC032-B02/I3 		Planon: module 3 		Master: ahu gas valve shut
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-B07/I1 		Planon: module 1 		Master: alarm mute pb
MC032-B07/I3 		Planon: sump no4 pump 2 trip 		Master: module 3
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/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/I10 		Planon: ahu01 extr dmpr open 		Master: module 10
MC044-B01/I11 		Planon: module 11 		Master: ahu01 extr fan flow
MC044-B01/I2 		Planon: ahu01 sply fan fault 		Master: module 2
MC044-B01/I5 		Planon: module 5 		Master: ahu01 frost trip
MC044-B01/I7 		Planon: module 7 		Master: ahu01 bag fltr dirty
MC044-B01/I8 		Planon: ahu01 th wheel fault 		Master: module 8
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/I2 		Planon: module 2 		Master: fire alarm active
MC044-B02/I5 		Planon: plant reset pb 		Master: module 5
MC044-B02/I6 		Planon: module 6 		Master: lthw pu fault
MC044-B02/I7 		Planon: lthw pu hi press 		Master: module 7
MC044-B02/I8 		Planon: lthw pu lo press 		Master: module 8
MC044-B02/N1 		Planon: byte 2 		Master: trend_0c_93_a0
MC044-B02/O2 		Planon: alarm route 2 		Master: vt system 102
MC044-B03/I1 		Planon: module 1 		Master: ups low battery
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/I6 		Planon: 20% gas detect 		Master: module 6
MC044-B04/O1 		Planon: alarm route 1 		Master: foyer vt heating
MC044-B04/O2 		Planon: physics vt heating 		Master: alarm route 2
MC044-B06/I2 		Planon: fire alarm active 		Master: module 2
MC044-B06/I3 		Planon: module 3 		Master: emergency stop
MC044-B06/I4 		Planon: module 4 		Master: mains failure
MC044-B06/I8 		Planon: ahu 2 fa dmpr open 		Master: module 8
MC044-B06/L12 		Planon: nan 		Master: 
MC044-B06/L13 		Planon: nan 		Master: 
MC044-B06/N1 		Planon: ahu2 interface 		Master: trend_0d_54_04
MC044-B07/N1 		Planon: trend_0c_92_22 		Master: fc interface lan87
MC044-B07/N3 		Planon: fc interface lan88 		Master: nan
MC044-B08/I1 		Planon: module 1 		Master: fire alarm active
MC044-B08/I2 		Planon: emergency stop 		Master: module 2
MC044-B08/I5 		Planon: ups low battery 		Master: module 5
MC044-B08/I8 		Planon: large room 3 ndrman status 		Master: module 8
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-B08/O1 		Planon: ahu 5 physics store vent 		Master: alarm route 1
MC044-B10/N2 		Planon: network 2 		Master: variable air volume c e38
MC044-B10/N5 		Planon: bacnet mstp 		Master: variable air volume c e38
MC044-B11/N1 		Planon: variable air volume b e08 		Master: trend_0b_9c_f8
MC044-B11/N5 		Planon: bacnet mstp 		Master: variable air volume b e12
MC044-B12/N1 		Planon: mthw from central s 		Master: trend_0d_11_6b
MC045-B01/I1 		Planon: process pump fail 		Master: xcite/io/8ui
MC045-B01/I2 		Planon: xcite/io/8ui 		Master: scc pump fail
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/I3 		Planon: p1 a fault 		Master: mod 3 - 8ao
MC046-B01/I4 		Planon: mod 4 - 8ui 		Master: p1 b fault
MC046-B01/I7 		Planon: mod 7 - 4ui 		Master: cal 2  45kw
MC051-B01/I4 		Planon: xcite/io/8do 		Master: vt pumps flow proved
MC051-B01/L4 		Planon: nan 		Master: 
MC051-B01/L5 		Planon: nan 		Master: 
MC055-B01/I1 		Planon: io module 1 		Master: heating p1 running
MC061-B01/I6 		Planon: boiler no.2 flow switch 		Master: xcite/io/8ui
MC061-B01/I8 		Planon: boiler no.2 gas booster fault 		Master: xcite/io/8ao
MC061-B01/N1 		Planon: trend_04_61_96 		Master: heating enabled
MC061-B02/I1 		Planon: io module 1 		Master: fire alarm
MC061-B02/N1 		Planon: trend_0e_2d_88 		Master: univreturntemp
MC061-B03/N1 		Planon: trend_0b_94_73 		Master: pressure ok os 11
MC063-B01/I3 		Planon: module 3 		Master: shower fans south fault
MC063-B01/L2 		Planon: nan 		Master: 
MC063-B01/L3 		Planon: nan 		Master: 
MC063-B01/L4 		Planon: nan 		Master: 
MC065-B01/I1 		Planon: xcite/io/8ui 		Master: phex no.1highlimitstatus
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/O2 		Planon: bookbinders 		Master: alarm route 1
MC065-B02/I1 		Planon: module 1 		Master: fire alarm active
MC065-B02/I3 		Planon: module 3 		Master: for off
MC065-B03/I1 		Planon: fire alarm active 		Master: module 1
MC065-B04/I4 		Planon: for extr only 		Master: module 4
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/I4 		Planon: xcite/io/16di 		Master: ahu-nw extract flow sts
MC065-B06/I6 		Planon: xcite/io/8ao 		Master: ahu-nwsupplybagfiltersts
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-B06/O1 		Planon: nw zone 1 floor a oss 		Master: alarm route 1
MC065-B07/I1 		Planon: xcite/io/8ui 		Master: ahu-ne supply vsd fault
MC065-B07/I2 		Planon: xcite/io/8ui 		Master: ahu-ne supply flow sts
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/O2 		Planon: ne zone 2 floor b oss 		Master: alarm route 1
MC065-B08/I1 		Planon: c085 ac fault 		Master: xcite/io/8ui
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/O2 		Planon: alarm route 1 		Master: se zone 4 floor b oss
MC065-B09/I1 		Planon: xcite/io/8ui 		Master: ahu-sw supply vsd fault
MC065-B09/I2 		Planon: xcite/io/8ui 		Master: ahu-sw supply flow sts
MC065-B09/I4 		Planon: ahu-sw extract flow sts 		Master: xcite/io/8ao
MC065-B09/I5 		Planon: tef1 toilet extrct fault 		Master: xcite/io/8ao
MC065-B09/L3 		Planon: nan 		Master: 
MC065-B09/L4 		Planon: nan 		Master: 
MC065-B09/N1 		Planon: oat frost setpoint 		Master: trend_0d_7f_af
MC065-B09/O2 		Planon: sw zone 3 floor b oss 		Master: alarm route 1
MC065-B10/N1 		Planon: trend_04_5e_f7 		Master: ic comms 1
MC066-B01/I2 		Planon: ct pump flow proven 		Master: xcite/io/8ui
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-B03/I2 		Planon: io module 2 		Master: ahu supply fan run
MC070-B05/I1 		Planon: dhw cyl 1 high limit ok 		Master: io module 1
MC070-B05/I3 		Planon: compressor fault 		Master: 4ui
MC070-B06/I1 		Planon: xcite/io/4ui/4ao 		Master: hws immersion 1
MC071-B01/I2 		Planon: 8ui_module 2 		Master: bar lossney hx04 fault
MC071-B01/I4 		Planon: toilet extract fan b013 fault 		Master: 4ao_module 4
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
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/I2 		Planon: xcite/io/16di no2 		Master: presurisation unit hp fault
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/O1 		Planon: heating 		Master: alarm route 1
MC072-B03/I1 		Planon: module 1 		Master: alarm mute pb
MC072-B05/I1 		Planon: alarm mute pb 		Master: module 1
MC075-B01/N1 		Planon: trend_05_77_1d 		Master: from man school 2 oat
MC076-B02/I1 		Planon: ac unit 01_1 fault =1 		Master: xcite/io/8ui
MC076-B02/I5 		Planon: ahu 1 filter dirty 1=dirty 		Master: xcite/io/2ui/2ao
MC078-B01/I1 		Planon: f39 filter 		Master: xcite/io/8ui
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/I5 		Planon: f40 frost 		Master: xcite/io/8ao
MC078-B01/I6 		Planon: ground floor toilet extract 		Master: xcite/io/8ao
MC078-B01/I8 		Planon: f40 extract 		Master: xcite/io/4ao
MC078-B01/I9 		Planon: f40 filter 		Master: xcite/io/2ui/2ao
MC078-B02/I3 		Planon: xcite/io/8ao 		Master: heat recovery pump
MC078-B02/I5 		Planon: xcite/io/4ao 		Master: main supply fan air flow
MC078-B02/I7 		Planon: main extract air flow proved 		Master: xcite/io/16di
MC078-B02/I9 		Planon: heat recovery pump flow proven 		Master: io module 9
MC078-B02/N1 		Planon: ic comms 1 		Master: trend_05_50_40
MC078-B03/I1 		Planon: 2 flr hws cal 1 valve 		Master: xcite/io/16di
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
MC103-B01/I1 		Planon: iq4/io/16di 		Master: heating failed
MC103-B01/L1 		Planon: nan 		Master: 
MC198-B01/I2 		Planon: gas safety cct trip 		Master: xcite/io/8ui
MC198-B01/N1 		Planon: ic comms 1 		Master: trend_05_4d_dd
MC198-B01/O1 		Planon: heating 		Master: alarm route 1
MC200-B01/N1 		Planon: ic comms 1 		Master: trend_0d_5d_de
MC202-B01/N1 		Planon: ic comms 1 		Master: waterside
MC202-B02/N1 		Planon: waterside 		Master: ic comms 1
MC202-B03/N1 		Planon: ic comms 1 		Master: waterside
MC202-B04/N1 		Planon: ic comms 1 		Master: waterside
MC202-B13/N1 		Planon: ic comms 1 		Master: waterside
MC204-B01/I4 		Planon: gas valve shut 		Master: module 4
MC204-B01/I5 		Planon: blr room water leak det 		Master: module 5
MC204-B02/I1 		Planon: fire alarm active 		Master: module 1
MC204-B02/I4 		Planon: ahu3 frost trip 		Master: module 4
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-B02/N1 		Planon: trend_09_03_4a 		Master: ic comms 1
MC204-B03/I1 		Planon: cws tank 1 hi level 		Master: module 1
MC204-B04/L1 		Planon: nan 		Master: 
MC204-B04/L2 		Planon: nan 		Master: 
MC204-B04/L3 		Planon: nan 		Master: 
MC204-B04/O2 		Planon: climbing wall 		Master: alarm route 2
MC204-B05/I1 		Planon: module 1 		Master: vt pump 3a fault
MC204-B05/I2 		Planon: module 2 		Master: vt pump 3b fault
MC204-B05/I4 		Planon: ufhm1 heat dmd 		Master: module 4
MC204-B05/I6 		Planon: ufhm1 htco 		Master: module 6
MC204-B05/O3 		Planon: ufhm2-group change m 		Master: alarm route 3
MC204-B06/I4 		Planon: ahu4 sply fan flow 		Master: module 4
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: 
MC204-B06/O3 		Planon: alarm route 3 		Master: sports hall
MC207-B01/I2 		Planon: press unit fault 		Master: io module 2
MC207-B01/I3 		Planon: sec hr pumps flow 		Master: io module 3
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
MC210-B01/I1 		Planon: fire alarm active 		Master: xcite/io/8ui
MC210-B01/I10 		Planon: xcite/io/16di 		Master: phe sec pump p1b flow prove
MC210-B01/I9 		Planon: phe sec pump p1a flow prove 		Master: xcite/io/16di
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/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/I10 		Planon: b30 override 		Master: xcite/io/8do
MC210-B03/I11 		Planon: a18 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/I6 		Planon: chemenglab condenser fault 		Master: xcite/io/8ui
MC210-B03/I7 		Planon: nuclearlab condenser fault 		Master: xcite/io/8ui
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/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/I4 		Planon: xcite/io/4ao 		Master: district heating heat meter
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 [62]:
sum(planon_meterssensors_intersected['Logger Channel']!=master_meterssensors_for_validation_intersected['Logger Channel'])


Out[62]:
904

In [63]:
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 [64]:
sum(planon_meterssensors_intersected['Logger Channel']!=master_meterssensors_for_validation_intersected['Logger Channel'])


Out[64]:
0

All errors fixed on logger channels.


In [65]:
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 [66]:
(planon_meterssensors_intersected!=master_meterssensors_for_validation_intersected).sum()/\
len(planon_meterssensors_intersected)*100


Out[66]:
Code              0.813557
Fiscal meter      0.000000
Description       1.225399
Tenant meter      0.000000
Building Name     1.802653
Logger Channel    0.000000
Building Code     0.000000
dtype: float64

2.2. Loggers


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


Out[67]:
{'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 [68]:
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[68]:
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 Code
MC139-L01 MC139 Sub Station 9 A0 Data logger: Sub Station 9 Data logger Enercom Multilog G2 050157AC6600 NaN 80.93.175.91:40455 NaN NaN NaN NaN Graduate Field MC139-L01
MC008-L01 MC008 LEC Remote Workshops A0 Data logger: LEC Workshops Data logger Enercom Multilog G2 050157B96E00 NaN 80.93.175.91:40453 NaN NaN NaN NaN BMS Panel MC008-L01

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


Out[69]:
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 Code
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 MC060-L01

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


Out[70]:
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
MC060-L01 MC060 Furness Residences, Bardsea PL1 Plant Room NaN Data logger: Furness Residences EN.EN1 Data Logger NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN MC060-L01

1 rows × 30 columns


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


Out[71]:
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
Code                                                  MC060-L01
Name: MC060-L01, dtype: object

In [72]:
len(master_loggerscontrollers_for_validation)


Out[72]:
295

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


Out[73]:
273

In [74]:
master_loggerscontrollers_for_validation.sort_index(inplace=True)
planon_loggerscontrollers.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

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


Out[75]:
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
Code                                                  MC060-L01
Name: MC060-L01, dtype: object

In [76]:
planon_loggerscontrollers.T


Out[76]:
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
Code 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

30 rows × 273 columns


In [77]:
master_loggerscontrollers_for_validation.T


Out[77]:
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
Code 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

16 rows × 295 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 [78]:
#Planon:Master
loggers_match_dict={
      "BuildingNo.":"Building Code",
      "Building":"Building Name",
      "Description":"Description",
      "EIS ID":"Logger Serial Number",
      "Make":"Make",
      "Model":"Model",
      "Code":"Code"
      }

In [79]:
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 [80]:
master_loggerscontrollers_for_validation_filtered.head(2)


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

In [81]:
planon_loggerscontrollers_filtered.head(2)


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

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

In [83]:
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 [84]:
planon_loggerscontrollers_filtered.head(2)


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

In [85]:
master_loggerscontrollers_for_validation_filtered.head(2)


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

In [86]:
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, MC044-L03, MC044-L04, MC044-L05, MC046-L01, MC046-L03, MC046-L04, MC046-L18, MC046-L19, MC061-L01, MC076-B03, MC204-L03, MC204-L04, MC204-L07, MC204-L08, MC204-L09, MC207-L01, MC210-L01, MC210-L02, NAN, 

Loggers in Master, but not in Planon: 22 / 295 : 7.458 %

In [87]:
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
295
295

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


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

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]:
Code Description Make Building Name Model Logger Serial Number Building Code
AP000-L01 AP000-L01 Data logger: Alexandra Park Enercom Alexandra Park Multilog G2 050157C7ED00 AP000
AP000-L02 AP000-L02 Data logger: Alexandra Park Enercom Alexandra Park Multilog G2 37475126 AP000

In [93]:
planon_loggerscontrollers_intersected.head(2)


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

In [94]:
planon_loggerscontrollers_intersected==master_loggerscontrollers_for_validation_intersected


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

273 rows × 7 columns

Loggers matching


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


Out[95]:
Code                    273
Description             273
Make                    273
Building Name           255
Model                   273
Logger Serial Number    140
Building Code           273
dtype: int64

Percentage matching


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


Out[96]:
Code                    100.000000
Description             100.000000
Make                    100.000000
Building Name            93.406593
Model                   100.000000
Logger Serial Number     51.282051
Building Code           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 0x1edac522748>

Loggers not matching on Building Name.


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


Out[98]:
18

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]:
Code                    0.000000
Description             0.000000
Make                    0.000000
Building Name           5.860806
Model                   0.000000
Logger Serial Number    0.000000
Building Code           0.000000
dtype: float64

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


In [109]:
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, 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: 84 / 29707 : 0.283 %

In [119]:
q1=pd.DataFrame(meterssensors_not_in_planon)

In [110]:
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 [120]:
q2=pd.DataFrame(meterssensors_not_in_master)

In [111]:
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, MC044-L03, MC044-L04, MC044-L05, MC046-L01, MC046-L03, MC046-L04, MC046-L18, MC046-L19, MC061-L01, MC076-B03, MC204-L03, MC204-L04, MC204-L07, MC204-L08, MC204-L09, MC207-L01, MC210-L01, MC210-L02, NAN, 

Loggers in Master, but not in Planon: 22 / 295 : 7.458 %

In [126]:
q3=pd.DataFrame(loggerscontrollers_not_in_planon)

In [112]:
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 [127]:
q4=pd.DataFrame(loggerscontrollers_not_in_master)

In [142]:
q5=pd.DataFrame((planon_meterssensors_intersected!=master_meterssensors_for_validation_intersected).sum()/\
len(planon_meterssensors_intersected)*100)

In [143]:
q6=pd.DataFrame((planon_loggerscontrollers_intersected!=master_loggerscontrollers_for_validation_intersected).sum()/\
len(planon_loggerscontrollers_intersected)*100)

In [130]:
w1=[]
for i in planon_meterssensors_intersected[planon_meterssensors_intersected['Description']!=master_meterssensors_for_validation_intersected['Description']].index:
    w1.append({"Meter":i,'Planon':planon_meterssensors_intersected.loc[i]['Description'],
               'Master':master_meterssensors_for_validation_intersected.loc[i]['Description']})

In [132]:
q7=pd.DataFrame(w1)

In [133]:
w2=[]
for i in planon_loggerscontrollers_intersected[planon_loggerscontrollers_intersected['Building Name']!=master_loggerscontrollers_for_validation_intersected['Building Name']].index:
    w2.append({"Logger":i,'Planon':planon_loggerscontrollers_intersected.loc[i]['Building Name'],
               'Master':master_loggerscontrollers_for_validation_intersected.loc[i]['Building Name']})

In [134]:
q8=pd.DataFrame(w2)

In [145]:
writer = pd.ExcelWriter('final.xlsx')
q1.to_excel(writer,'Meters Master, not Planon')
q2.to_excel(writer,'Meters Planon, not Master')
q3.to_excel(writer,'Loggers Master, not Planon')
q4.to_excel(writer,'Loggers Planon, not Master')
q5.to_excel(writer,'Meters error perc')
q6.to_excel(writer,'Loggers error perc')
q7.to_excel(writer,'Meters naming conflcits')
q8.to_excel(writer,'Loggers naming conflicts')
writer.save()