Reading JSON files in Python

JSON (JavaScript Object Notation) is a text format for storing and transporting data. It is "self-describing" and easy to understand. JASON files can be loaded in Python. Two methods are used here: first loading the data using pandas DataFrame and then using the python 'open() file' function. # Reuirements: import pandas as pd from pandas import Series, DataFrame import json # METHOD 1. Read data from fileand display in dataframe: df_components = pd.read_json('Geophysics/components.json') # print(df.to_string()) # print(df) df_components.head() # Set the wellboreName name as index if that's the feature focus# df_components.set_index('wellboreName', inplace=True) # View the first five elements and see how the dataframe…

Continue ReadingReading JSON files in Python