当前位置:网站首页>what exactly is json (c# json)
what exactly is json (c# json)
2022-07-31 15:15:00 【Full stack programmer webmaster】
大家好,又见面了,我是你们的朋友全栈君.
If the point in you is a superior,那……You should come here for identification..Many partners engaged in data analysis work from“最简单”的神器—Excel开始入门的,对编程语言、Many tools of the computer world are poorly understood.to do structured data,Just go and study by yourselfsql,学习sql server或是mysql数据库.to be semi-structured、Unstructured data has to learn things likemongo数据库的东西. Every day, I hear the programmer brother across from me say that I will pack a package for you.json吧,will this work?阿,json是个啥?管不了这么多了,secretly thinking,Since you can pack,I can take this bag apart.……不敢说,It became a programmer to encourage division,Laugh at the opposite programmer Oppa.言归正传.
1. 初识JSON
这是个json,Stored data describes a personJohn Smith的一些个人信息,比如姓名,是否活着,年龄,Information such as address and phone number.其中,地址address和电话号码phoneNumbers呢,The following also includes the state、城市、街道,家庭电话、Information such as office phone number and mobile phone number.
If only previously contacted storage inExcel或者sql serverStructured data in a structured database,Then the first time I sawjson格式的数据,must be new.Perceptual knowledge about it first,operate it later.
this data organization,条理清晰,It can better represent the attribute relationship of entities such as people or things in nature.Can be understood as a tree structure,a tree with branches,tree with leaves.
2. 操作JSON
打开Ipython,Type in the following code,The next operation also uses the value of this variable as a chestnut.
你看了一眼,would say I know this,Is it not a dictionary?在Ipython中使用type()获得js变量的数据类型.
you're right,就是个dict类型.
2.1 写入json文件
2.2 读出json文件
save what you read,What is a data type.
You can see that we writejsonfile is adict类型,After reading it is still adict类型.这也就是json区别于csvfile place.csv文件呢,No matter what type of data structure you are writing to,The read is always a string of characters.json文件呢,The essence is also stored as a string,区别于csv的是,通过json.load读出json,The type of data can be automatically parsed.
2.3 区分json.dump()与json.dumps()
json.dump()
使用时,You need to specify the need to write the data,and a write stream.The function implemented by the following code is tojswrite the content to the desktop onetest.json的文档中.After executing the code, you can see that there is one more on the desktoptest.json文件.
json.dumps()
The method used is relatively simple,directly write thedict传递给这个函数.
3. Identify by inferenceJSON
3.1 区分json与dict
Sometimes will suddenly make confused,想json跟dict到底是什么关系,有什么区别呢?In fact, that's what you don't understandjson和dict本身的概念.
json
Essentially a way of organizing files,比如你熟悉的txt, csv, doc,docx,xls,xlsx文件等等.
dict
is a data structure defined in a programming language,比如列表list,比如集合set,比如字符串str,There are e.g. arraysarray.
3.2 区分json与XML
XML和JSON都使用结构化方法来标记数据.
JSON 简单的语法格式和清晰的层次结构明显要比 XML 容易阅读,并且在数据交换方面,由于 JSON 所使用的字符要比 XML 少得多,可以大大得节约传输数据所占用得带宽
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/128257.html原文链接:https://javaforall.cn
边栏推荐
猜你喜欢
随机推荐
NC | 中国农大草业学院杨高文组揭示发现多因子干扰会降低土壤微生物多样性的积极效应...
DeepLab Series Learning
LeetCode二叉树系列——226.翻转二叉树
LeetCode二叉树系列——222.完全二叉树的节点个数
力扣:56. 合并区间
Linux查看redis版本(查看mongodb版本)
leetcode303场周赛复盘
「秋招系列」MySQL面试核心25问(附答案)
radiobutton的使用
RecyclerView高效使用第三节
自动化测试如何创造业务价值?
易驱线主控芯片对比(电动三轮电机90O瓦世纪通达)
Kubernetes原理剖析与实战应用手册,太全了
Efficient use of RecyclerView Section 1
Getting started with UnityShader (1) - GPU and Shader
border控件的使用
abaqus find contact pairs报错:surface name is already in use
工程水文学复习资料
JVM参数解析 Xmx、Xms、Xmn、NewRatio、SurvivorRatio、PermSize、PrintGC「建议收藏」
MANIFEST.MF文件(PDB文件)