Overview:
- JSON is the abbreviation of JavaScript Object Notation. A JSON string consists of a collection of name value pairs. The value for a name can be a collection.
- The function read_json() of pandas library constructs and returns a DataFrame object, while to_json() creates a JSON string from a DataFrame object.
Example:
# Example Python program that creates # Animal data as JSON string # Print the DataFrame |
Output:
Animal Height Weight 0 Asian Elephant 110 8818.00 1 Lion 47 418.00 2 Giraffe 232 2627.00 3 Brush Rabbit 12 1.54 |