当前位置:网站首页>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
边栏推荐
- R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(legend、修改可视化图像的图例在整图中的位置)
- radiobutton的使用
- Linux查看redis版本(查看mongodb版本)
- The meaning of node_exporter performance monitoring information collection in Prometheus
- Advanced Mathematics - Commonly Used Indefinite Integral Formulas
- 微信聊天记录中搜索红包
- Excel快速对齐表格的中姓名(两个字姓名和三个字姓名对齐)
- Word表格转到Excel中
- Trigonometric identity transformation formula
- WPF项目--控件入门基础用法,必知必会XAML
猜你喜欢

How useful is four-quadrant time management?

WeChat chat record search in a red envelope

Synchronized and volatile interview brief summary

Introductory UnityShader learning (2) - the rendering pipeline

梅克尔工作室-第一次

RecyclerView的高效使用第一节

Word表格转到Excel中

TextBlock控件入门基础工具使用用法,取上法入门

网银被盗?这篇文章告诉你如何安全使用网银

OpenShift 4 - Customize RHACS security policies to prevent production clusters from using high-risk registry
随机推荐
11 pinia使用
基于极限学习机(ELM)进行多变量用电量预测(Matlab代码实现)
双边滤波加速「建议收藏」
TRACE32——C源码关联
Excel quickly aligns the middle name of the table (two-word name and three-word name alignment)
leetcode303 Weekly Match Replay
TextBlock控件入门基础工具使用用法,取上法入门
自适应控制——仿真实验二 用Narendra方案设计模型参考自适应系统
格林美瑞交所IPO:募资3.8亿美元 更多中国企业将赴欧洲上市
R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(caption、添加、修改可视化图像的题注、脚注内容)
MANIFEST.MF文件(PDB文件)
[CUDA study notes] First acquaintance with CUDA
四象限时间管理有多好用?
梅克尔工作室-第一次
实现防抖与节流函数
小试牛刀:Go 反射帮我把 Excel 转成 Struct
网银被盗?这篇文章告诉你如何安全使用网银
org.apache.jasperException(could not initialize class org)
svn安装及使用(身体功能手册)
hough变换检测直线原理(opencv霍夫直线检测)