Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import OrderedDict
- >>> d1 = {'properties': OrderedDict([('KAEK', 'str:12'),
- ... ('PROP_TYPE', 'str:4'),
- ... ('ORI_TYPE', 'int:1'),
- ... ('ORI_CODE', 'str:100'),
- ... ('DEC_ID', 'str:254'),
- ... ('ADDRESS', 'str:254'),
- ... ('NUM', 'str:9'),
- ... ('LEN', 'float:19.11'),
- ... ('AREA', 'float:19.11')]),
- ... 'geometry': 'Polygon'}
- >>> d1 = d1['properties']
- >>> d2 = {'properties': OrderedDict([('OBJECTID_1', 'int:9'),
- ... ('OBJECTID', 'int:9'),
- ... ('FID_PERIVL', 'int:9'),
- ... ('DESC_', 'str:254'),
- ... ('PROP_TYPE', 'str:4'),
- ... ('Shape_Leng', 'float:19.11'),
- ... ('Shape_Le_1', 'float:19.11'),
- ... ('Shape_Area', 'float:19.11'),
- ... ('PARCEL_COD', 'str:254'),
- ... ('KAEK', 'str:50'),
- ... ('NUM', 'int:4'),
- ... ('DEC_ID', 'int:4'),
- ... ('ADDRESS', 'int:4'),
- ... ('ORI_CODE', 'int:4'),
- ... ('ORI_TYPE', 'int:4')]),
- ... 'geometry': 'Polygon'}
- >>> d2 = d2['properties']
- >>> from pprint import pprint
- >>> pprint(d1)
- OrderedDict([('KAEK', 'str:12'),
- ('PROP_TYPE', 'str:4'),
- ('ORI_TYPE', 'int:1'),
- ('ORI_CODE', 'str:100'),
- ('DEC_ID', 'str:254'),
- ('ADDRESS', 'str:254'),
- ('NUM', 'str:9'),
- ('LEN', 'float:19.11'),
- ('AREA', 'float:19.11')])
- >>> pprint(d2)
- OrderedDict([('OBJECTID_1', 'int:9'),
- ('OBJECTID', 'int:9'),
- ('FID_PERIVL', 'int:9'),
- ('DESC_', 'str:254'),
- ('PROP_TYPE', 'str:4'),
- ('Shape_Leng', 'float:19.11'),
- ('Shape_Le_1', 'float:19.11'),
- ('Shape_Area', 'float:19.11'),
- ('PARCEL_COD', 'str:254'),
- ('KAEK', 'str:50'),
- ('NUM', 'int:4'),
- ('DEC_ID', 'int:4'),
- ('ADDRESS', 'int:4'),
- ('ORI_CODE', 'int:4'),
- ('ORI_TYPE', 'int:4')])
- pprint(set.symmetric_difference(set(d1.items()), set(d2.items())))
- {('ADDRESS', 'int:4'),#somehow inform that this belongs to d2 and so on...
- ('ADDRESS', 'str:254'),#d1
- ('AREA', 'float:19.11'),#d1
- ('DEC_ID', 'int:4'),#d2
- ('DEC_ID', 'str:254'),
- ('DESC_', 'str:254'),
- ('FID_PERIVL', 'int:9'),
- ('KAEK', 'str:12'),
- ('KAEK', 'str:50'),
- ('LEN', 'float:19.11'),
- ('NUM', 'int:4'),
- ('NUM', 'str:9'),
- ('OBJECTID', 'int:9'),
- ('OBJECTID_1', 'int:9'),
- ('ORI_CODE', 'int:4'),
- ('ORI_CODE', 'str:100'),
- ('ORI_TYPE', 'int:1'),
- ('ORI_TYPE', 'int:4'),
- ('PARCEL_COD', 'str:254'),
- ('Shape_Area', 'float:19.11'),
- ('Shape_Le_1', 'float:19.11'),
- ('Shape_Leng', 'float:19.11')}
Add Comment
Please, Sign In to add comment