简体   繁体   中英

how to merge two maps using python

Fairly new to python so this may seem noobish. I have created two basic maps in.line format (new to me), each showing different features using matplotlib. These maps were converted from separate shapefiles. Now I need to merge these two.line maps into one.

Any ideas would be highly appreciated. TY.

In Python 3.5 or greater:

z = {**x, **y}

In Python 2, (or 3.4 or lower) write a function:

def merge_two_dicts(x, y):
    z = x.copy()   # start with x's keys and values
    z.update(y)    # modifies z with y's keys and values & returns None
    return z

z = merge_two_dicts(x, y)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM