ETL in Python – read csv, json files
Let’s start with how to read csv, json files:
1 2 3 4 5 6 | import glob list_csv = glob("*.csv") list_json = glob("*.json") |
Let’s create a function to read a CSV file in python:
1 2 3 4 5 6 7 | def extract_from_csv(file_to_process): dataframe = pd.read_csv(file_to_process) return dataframe df = extract_from_csv("example1.csv") |
Now, let’s create another function to read content[…]