当前位置:网站首页>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
边栏推荐
- c语言hello world代码(代码编程入门)
- SQL、HQL、JPQL 到底有什么区别
- 最小费用最大流问题详解
- Essential Learning for Getting Started with Unity Shader - Transparency Effect
- R语言ggstatsplot包ggbarstats函数可视化条形图、并添加假设检验结果(包含样本数、统计量、效应大小及其置信区间、显著性、组间两两比较、贝叶斯假设)、检验结果报告符合APA标准
- OpenCV测量物体的尺寸技能 get~
- The meaning of node_exporter performance monitoring information collection in Prometheus
- Female service community product design
- JVM参数解析 Xmx、Xms、Xmn、NewRatio、SurvivorRatio、PermSize、PrintGC「建议收藏」
- R language ggplot2 visualization: use the ggboxplot function of the ggpubr package to visualize the box plot, use the font function to customize the font size, color, style (bold, italic) of the legen
猜你喜欢
随机推荐
MANIFEST.MF文件(PDB文件)
The meaning of node_exporter performance monitoring information collection in Prometheus
Emmet 语法
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化箱图、使用font函数自定义图例标题文本(legend.title)字体的大小、颜色、样式(粗体、斜体)
Web自动化实战——Selenium4(自动化测试环境的搭建)
DeepLab Series Learning
做事软件开发-法的重要性所在以及合理结论的认识
工程力学复习资料
Small test knife: Go reflection helped me convert Excel to Struct
OpenShift 4 - Deploy Redis Cluster with Operator
2021 OWASP TOP 10 漏洞指南
Groupid(artifact id)
LeetCode二叉树系列——226.翻转二叉树
Synchronized和volatile 面试简单汇总
R language moves time series data forward or backward (custom lag or lead period): use the lag function in the dplyr package to move the time series data forward by one day (set the parameter n to a p
Efficient use of RecyclerView Section 2
The role of /etc/profile, /etc/bashrc, ~/.bash_profile, ~/.bashrc files
TRACE32 - C source code association
修改SQL语言实现Mysql 多表关联查询优化
Excel快速对齐表格的中姓名(两个字姓名和三个字姓名对齐)