JSON là một từ viết tắt là viết tắt của ký hiệu đối tượng JavaScript. Mặc dù tên của nó, JSON là một định dạng bất khả tri ngôn ngữ được sử dụng phổ biến nhất để truyền dữ liệu giữa các hệ thống và đôi khi, lưu trữ dữ liệu. Các chương trình được viết bằng Python, cũng như nhiều ngôn ngữ lập trình khác, có thể nhập dữ liệu được định dạng JSON và có thể tuần tự hóa dữ liệu trong bộ nhớ vào định dạng JSON. Python hỗ trợ JSON thông qua gói tích hợp có tên JSON. Để sử dụng tính năng này, hãy nhập gói JSON vào tập lệnh hoặc mô -đun Python mà bạn muốn tuần tự hóa hoặc giải phóng dữ liệu của bạn. JSON sử dụng các cặp giá trị khóa được phân định dấu phẩy có trong các trích dẫn kép và được phân tách bởi các dấu chấm. Phần thân của tệp JSON có thể được phân định trong niềng răng xoăn {} hoặc niềng răng vuông [] [còn được gọi là dấu ngoặc trên một số địa phương]. Định dạng JSON dường như tương tự như từ điển trong Python, nhưng các chi tiết cụ thể của định dạng JSON có sự khác biệt đáng kể, vì vậy hãy sử dụng chăm sóc khi làm việc với cả hai định dạng. is an acronym that stands for JavaScript Object Notation. Despite its name, JSON is a language agnostic format that is most commonly used to transmit data between systems, and on occasion, store data. Programs written in Python, as well as many other programming languages, can ingest JSON formatted data, and can serialize data in memory into the JSON format. Python supports JSON through a built-in package called json. To use this feature, import the json package into the Python script or module in which you wish to serialize or deserialize your data. JSON utilizes comma delimited key value pairs contained in double quotes and separated by colons. The body of a JSON file can be delimited in curly braces { } or square braces [] [also known as “brackets” in some locales]. The JSON format appears to be similar to the dictionary in Python, but the specifics of the JSON format have significant differences, so use care when working with both formats.
Lưu ý: Để biết thêm thông tin, hãy tham khảo đọc, viết và phân tích JSON bằng Python For more information, refer to Read, Write and Parse JSON using Python
Json.dumps[]
hàm json.dumps [] sẽ chuyển đổi một tập hợp con của các đối tượng python thành chuỗi JSON. Không phải tất cả các đối tượng đều có thể chuyển đổi và bạn có thể cần tạo một từ điển dữ liệu bạn muốn để lộ trước khi tuần tự hóa thành JSON. & NBSP;
Cú pháp: & nbsp; json.dumps [obj, *, skipkeys = false, đảm bảo_ascii = true kw] tham số: & nbsp; obj: sê -ri obj thành một luồng được định dạng JSON & nbsp; skipkeys: nếu SkipKeys là đúng [mặc định: sai], sau đó các khóa không thuộc loại cơ bản [str, int, float, bool bị bỏ qua thay vì nâng một kiểu mẫu. & nbsp; đảm bảo_ascii: nếu đảm bảo_ascii là đúng [mặc định], đầu ra được đảm bảo có tất cả các ký tự không ASCII sắp ra mắt. Nếu đảm bảo_ascii là sai, các ký tự này sẽ được xuất ra. Tồi tệ hơn]. Nếu allow_nan là đúng, các tương đương javascript của chúng [nan, infinity, -infinity] sẽ được sử dụng. & Nbsp; entid mức độ. Một mức độ thụt vào 0, âm hoặc Hồi giáo sẽ chỉ chèn các dòng mới. Không [mặc định] chọn biểu diễn nhỏ gọn nhất. Sử dụng một số nguyên dương tích cực chỉ ra rằng nhiều không gian trên mỗi cấp độ. Nếu thụt lề là một chuỗi [chẳng hạn như \ \ t,], chuỗi đó được sử dụng để thụt vào mỗi cấp độ. & Nbsp; dấu phân cách: Nếu được chỉ định, các dấu phân cách phải là một Tuple [item_separator, key_separator]. Mặc định là [‘,‘, ‘:‘] nếu thụt lề là không và [‘,‘, ‘:‘] nếu không. Để có được biểu diễn JSON nhỏ gọn nhất, bạn nên chỉ định [‘,,‘:: Nó sẽ trả về một phiên bản có thể mã hóa JSON của đối tượng hoặc nâng một kiểu mẫu. Nếu không được chỉ định, typeerror được nâng lên. & Nbsp; sort_keys: nếu sort_keys là đúng [mặc định: sai], thì đầu ra của từ điển sẽ được sắp xếp theo khóa.
json.dumps[obj, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False, **kw]
Parameters:
obj: Serialize obj as a JSON formatted stream
skipkeys: If skipkeys is True [default: False], then dict keys that are not of a basic type [str, int, float, bool, None] will be skipped instead of raising a TypeError.
ensure_ascii: If ensure_ascii is True [the default], the output is guaranteed to have all incoming non-ASCII characters escaped. If ensure_ascii is False, these characters will be output as-is.
check_circular: If check_circular is False [default: True], then the circular reference check for container types will be skipped and a circular reference will result in an OverflowError [or worse].
allow_nan: If allow_nan is False [default: True], then it will be a ValueError to serialize out of range float values [nan, inf, -inf] in strict compliance of the JSON specification. If allow_nan is True, their JavaScript equivalents [NaN, Infinity, -Infinity] will be used.
indent: If indent is a non-negative integer or string, then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0, negative, or “” will only insert newlines. None [the default] selects the most compact representation. Using a positive integer indent indents that many spaces per level. If indent is a string [such as “\t”], that string is used to indent each level.
separators: If specified, separators should be an [item_separator, key_separator] tuple. The default is [‘, ‘, ‘: ‘] if indent is None and [‘, ‘, ‘: ‘] otherwise. To get the most compact JSON representation, you should specify [‘, ‘, ‘:’] to eliminate whitespace.
default: If specified, default should be a function that gets called for objects that can’t otherwise be serialized. It should return a JSON encodable version of the object or raise a TypeError. If not specified, TypeError is raised.
sort_keys: If sort_keys is True [default: False], then the output of dictionaries will be sorted by key.
Ví dụ #1: Chuyển từ điển Python cho hàm json.dumps [] sẽ trả về một chuỗi. & Nbsp; & nbsp; Passing the Python dictionary to json.dumps[] function will return a string.
Python3
import
json
Dictionary
=
{
1
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }0
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }2
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }4
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }6
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }7
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }9
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }1
:
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }3
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }6
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }6
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }9
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }9
import
0____6 import
2
import
3import
4import
5
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
import
7import
8
import
3import
4json
1json
2
import
3import
4json
5json
6
Đầu ra & nbsp;
Chuỗi JSON tương đương của từ điển: {Hồi 1,: Chào mừng bạn, một cách khác nhau
Ví dụ #2: Bằng cách đặt SkipKeys thành TRUE [Mặc định: Sai] Chúng tôi tự động bỏ qua các khóa không thuộc loại cơ bản. & NBSP; By setting the skipkeys to True[default: False] we automatically skip the keys that are not of basic type.
Python3
import
json
import
0____6 import
2
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }6
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }7
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }9
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }1
:
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }3
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }6
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }6
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }9
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }9
import
0____6 1
0
1
11
2=
1
4json
2
import
3import
41
8
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
import
7import
8
Output
Chuỗi JSON tương đương của từ điển: {Hồi 2,
Ví dụ #3: & nbsp; & nbsp;
Python3
import
json
Dictionary
=
Dictionary
11
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }2
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }7
Dictionary
7Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }0
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }2
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }4
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }6
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }7
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }9
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }1
:
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }3
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }6
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }6
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }9
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }23
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }25
import
4Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }27
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }28
import
0____6 1
0
1
11
2=
1
4
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
1
1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }38
=
1
4json
2import
3import
41
8
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
import
7import
8
Đầu ra: & nbsp; & nbsp;
Chuỗi json tương đương của từ điển: {Hồi 2,
Ví dụ #4: & nbsp; & nbsp;
Python3
import
json
1
11
2=
1
4
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }6
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }7
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }9
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }1
:
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }3
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }6
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }6
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }9
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }23
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }25
import
4Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }27
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }28
import
0____6 1
0
1
11
2=
1
4
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
1
1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }38
=
1
4json
2Đầu ra: & nbsp; & nbsp;
import
3import
41
8
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
import
7import
8
Output:
Equivalent json string of dictionary: { "2": "to", "3": "Geeks", "4": "for", "5": "Geeks", "6": NaN }
Chuỗi json tương đương của từ điển: {Hồi 2,
Python3
import
json
Dictionary
=
Dictionary
11
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }2
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }7
Dictionary
7Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }0
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }2
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }4
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }6
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }7
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }9
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }1
:
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }3
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }6
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }6
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }9
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }23
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }25
import
4Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }27
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }28
import
0____6 1
0
1
11
2=
1
4
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
1
1
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }38
=
1
4json
2Đầu ra: & nbsp; & nbsp;
1
1
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }65
=
import
4Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }68
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }70
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }71
import
3import
41
8
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
import
7import
8
Output:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }
Chuỗi json tương đương của từ điển: {Hồi 2,
Python3
import
json
Dictionary
=
{
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }83
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }0
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }87
:
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }4
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
1
11
2=
1
4
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
import
0____6 1
0
Đầu ra: & nbsp; & nbsp;
1
1
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }65
=
import
4Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }68
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }1
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }70
import
11Chuỗi json tương đương của từ điển: {Hồi 2,
import
3import
41
8
Equivalent json string of dictionary: { "2" = "to". "3" = "Geeks". "4" = "for". "5" = "Geeks". "6" = NaN }5
import
7import
8
Output:
Equivalent json string of dictionary: { "a" = "Geeks". "b" = "to". "c" = "Welcome" }