Im trying to do a multiple join, with the following:
host_data = temp_merged_data.merge(desc_data, left_on=['device_id, port'], how='left')
However am receiving the error:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/pandas/core/frame.py", line 6389, in merge
copy=copy, indicator=indicator, validate=validate)
File "/usr/local/lib/python3.6/site-packages/pandas/core/reshape/merge.py", line 61, in merge
validate=validate)
File "/usr/local/lib/python3.6/site-packages/pandas/core/reshape/merge.py", line 546, in __init__
self._validate_specification()
File "/usr/local/lib/python3.6/site-packages/pandas/core/reshape/merge.py", line 1059, in _validate_specification
if len(self.right_on) != len(self.left_on):
TypeError: object of type 'NoneType' has no len()
temp_merged_data sample:
mac_address device_id device_type ip_address port vlan
0000.001d.f805 304 Switch 10.10.10.1 None 5.0
0000.001d.f10a 89 Router 10.10.10.129 None 10.0
0000.001d.f0a3 89 Router 10.10.10.193 None 15.0
0000.001d.f024 303 Switch 10.10.10.225 Gi0/23 20.0
0101.001d.79a2 303 Switch 10.10.10.26 Gi0/3 5.0
desc_data sample:
description device_id device_type mac_address port
*** UPLINK to SW-03 *** 303 Switch Gi0/23
*** UPLINK to SW *** 303 Switch Gi0/24
*** CCTV *** 304 Switch Gi0/21
*** UPLINK to SW-03 *** 304 Switch Gi0/23
*** UPLINK to SW *** 304 Switch Gi0/24
I want to be able to merge the port description into the temp_mergedata frame if it exists, if it doesnt leave the original data as is.
Thanks