# 5.3 CSV आणि Excel वाचूया

Source: https://ravindrabagale.com/mr/datascience/ch05-pandas-dataframes-and-series/5-3-read-csv-and-excel.html
Language: mr (Marathi with English technical terms)

DataFrame data/blinkit_sample.csv म्हणून save करा आणि परत वाचा:

df.to_csv("data/blinkit_sample.csv", index=False)
df2 = pd.read_csv("data/blinkit_sample.csv")
df2.head()

Excel साठी openpyxl लागतो:

df.to_excel("data/blinkit_sample.xlsx", index=False)
df3 = pd.read_excel("data/blinkit_sample.xlsx")

 | Method | उपयोग

 | read_csv | Class मधले बहुतेक exports वाचायला

 | read_excel | Ops team कडून आलेली .xlsx file वाचायला

 | to_csv / to_excel | Clean केलेला output save करायला

Practice

DataFrame मध्ये आणखी दोन काल्पनिक rows जोडा — Solapur Delivered आणि Nagpur Returned. CSV save करा, परत read करा आणि shape (5, 7) आहे का पाहा.

रवींद्र बागले यांची tip

File save करण्याआधी data folder तयार आहे का पाहा. index=False मुळे notebook चा row index स्वतंत्र CSV column म्हणून save होत नाही.
