Data can be loaded in a DataFrame from a CSV file on the disk by using Pandas _______function.
Data can be loaded in a DataFrame from a CSV file on the disk by using Pandas _______function.
Solution
✅ Correct Option: 2
Pandas uses pd.read_csv("file.csv") to read a CSV file from disk and return its contents as a DataFrame. The "read" in the name shows that data is being loaded into the program.
Options 1 and 3: these are malformed versions of to_csv(), which does the opposite job. It writes a DataFrame out to a CSV file instead of loading one.
Remember: read_csv() brings data in, to_csv() sends data out.
Related questions:
2026: 20 May Shift 1
2025: 14 May Shift 1
2026: 26 May Shift 1