Io File Read And Write
1. READING THE FILE
1.1 Reading a CSV file
import numpy as np
import pandas as pd
# location of csv file we are going to read
csv_location = "data/totalbeta.csv"
csv_df = pd.read_csv(csv_location)
# .head() shows only the first five rows in output
csv_df.head() Industry
No.
AU Beta
AL Beta
No.
AU Beta
AL Beta
1.2. Reading an Excel File
Industry
No.
AU Beta
AL Beta
Industry
No.
AU Beta
AL Beta
Industry
No.
AU Beta
AL Beta
Industry Name
No.
AU Beta
AL Beta
1.3. Reading a JSON file
Industry
No.
AU Beta
AL Beta
2. Writing to File
2.1. Writing to a CSV file
Unnamed: 0
Industry
No.
AU Beta
AL Beta
Industry
No.
AU Beta
AL Beta
2.2. Writing to Excel File
Industry
No.
AU Beta
AL Beta
Industry
No.
AU Beta
AL Beta
2.3. Write to JSON File
Industry
No.
AU Beta
AL Beta
Last updated