当前位置:网站首页>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]
边栏推荐
- Leetcode-1535. Find the winner of the array game
- How to increase heap size of JVM [duplicate] - how to increase heap size of JVM [duplicate]
- Jpg format and XML format files are separated into different folders
- Leetcode-1604. Warning people who use the same employee card more than or equal to three times within one hour
- 线程有哪些状态?
- 【思维方法】之第一性原理
- Why don't databases use hash tables?
- dlib 人脸检测
- 分段贝塞尔曲线
- Project progress on February 28, 2022
猜你喜欢

Leetcode-1706. Where does the club fall

sqlite交叉编译动态库

RMB classification II

Analysis of memory management mechanism of (UE4 4.26) UE4 uobject

dlib 人脸检测

User login 【 I 】

Quickly master makefile file writing

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

. Net core - pass Net core will Net to cross platform

Book classification based on Naive Bayes
随机推荐
Unity vscode cannot jump to definition
[PowerShell] command line output and adding system environment variables
Script for unity3d to recursively search for a node with a specific name from all child nodes of a node
Guns框架多数据源配置,不修改配置文件
Logistic regression model
Research Report on water sports shoes industry - market status analysis and development prospect forecast
sqlite交叉編譯動態庫
Piecewise Bezier curve
Project progress on February 28, 2022
IBL of directx11 advanced tutorial PBR (3)
Leetcode-553. Optimal division
肝了一個月的 DDD,一文帶你掌握
R语言大作业(四):上海市、东京 1997-2018 年GDP值分析
关于 Sensor flicker/banding现象的解释
Unity can realize the rotation, translation and scaling script of the camera around the target point on the mobile terminal device
EBook upload
. Net core - pass Net core will Net to cross platform
Leetcode-1535. Find the winner of the array game
Liunx Foundation
(UE4 4.27) customize globalshader