当前位置:网站首页>Zip and Items() difference
Zip and Items() difference
2022-06-12 06:09:00 【Just change your name】
zip Is a pointer that rearranges variables , from zip The modification of the extracted object will take effect in the original variable .
.item() What is taken out is the value , from .items() The modification of the extracted items will not affect the original variables .
import json
pth = r"F:\vscode_files\project\segment_side\segment_side_example-18.json"
f = open(pth)
dict_img_id_seg = {}
seg_json = json.load(f)
anno = seg_json["annotations"][0]
dict_img_id_seg[anno["image_id"]] = [anno["category_id"], anno["segmentation"]]
print(dict_img_id_seg)
for k, v in dict_img_id_seg.items():
print(type(k))
print(type(v))
v = 1
print(type(dict_img_id_seg.items()))
print(dict_img_id_seg)
list1 = [dict_img_id_seg]
list2 = [1]
for one, two in zip(list1, list2):
print(type(one))
print(type(two))
one[2400] = two
two = 2
print(type(zip(list1, list2)))
print(list1)
print(list2)
output:
{2400: [11, [[144.7, 134.2, 185.5, 132.3, 183.9, 149.6, 142.1, 150.0, 141.7, 143.0, 144.7, 137.3]]]}
<class 'int'>
<class 'list'>
<class 'dict_items'>
{2400: [11, [[144.7, 134.2, 185.5, 132.3, 183.9, 149.6, 142.1, 150.0, 141.7, 143.0, 144.7, 137.3]]]}
<class 'dict'>
<class 'int'>
<class 'zip'>
[{2400: 1}]
[1]
边栏推荐
- Why is the union index the leftmost matching principle?
- Login authentication filter
- Who is more fierce in network acceleration? New king reappeared in CDN field
- Remap function of C different interval mapping
- Guns框架多数据源配置,不修改配置文件
- Unable to access this account. You may need to update your password or grant the account permission to synchronize to this device. Tencent corporate email
- Leetcode buckle -10 Regular expression matching analysis [recursion and dynamic programming]
- MySQL 主从,6 分钟带你掌握
- Simulateur nightGod ADB View log
- Leetcode-1512. Number of good pairs
猜你喜欢

EBook list page

Data integration framework seatunnel learning notes

IBL of directx11 advanced tutorial PBR (3)

Textcnn (MR dataset - emotion classification)

Nocturnal simulator ADB view log

Bert use

Redis队列

Unity implements smooth interpolation

How do I get the date and time from the Internet- How to get DateTime from the internet?

线程有哪些状态?
随机推荐
RNN model
Leetcode-1260. 2D mesh migration
User login 【 I 】
单通道图片的读入
(UE4 4.27) customize primitivecomponent
User login (medium)
Un mois de DDD hépatique.
Project progress on February 28, 2022
Brief summary of software project architecture
Houdini terrain creation
Annotation configuration of filter
Analysis of memory management mechanism of (UE4 4.26) UE4 uobject
Directx11 advanced tutorial PBR (1) summary of physical phenomena of light
Remap function of C different interval mapping
Leetcode-1043. Separate arrays for maximum sum
Front desk display LED number (number type on calculator)
The unity3d script searches for colliders with overlaps within the specified radius
Jpg format and XML format files are separated into different folders
JS预解析
Storing texture2d to hard disk JPG file with script under unity3d