Create any CSV file and perform read, write operations using Pandas.
Code:
import pandas as pd
df=pd.read_csv(r"C:\Users.csv")
print("Original data")
print(df)
new_student={"Roll No":102326,"name":"Dia Sharma","prn":123654}
df=df._append(new_student,ignore_index=True)
print("\nUpdated data")
print(df)
df.to_csv("tanishk_updated.csv",index=False)
0 Comments