Informatics Practices
Write the name of function to store data from a dataframe into a CSV file.
Python Data Handling
1 Like
Answer
to_csv() function is used to store data from a DataFrame into a CSV file.
Answered By
3 Likes
Related Questions
Consider the following Class12.csv file containing the data as given below:
RollNo Name Accounts Maths BSt IP Eco 10 Ritu Jain 88 67 87 97 56 11 Mridul Mehta 67 78 77 87 90 12 Divij 87 89 78 82 92 13 Yashvi Verma 67 82.3 76.5 98.2 78.6 14 Deepak Virmani 56.7 76.5 88 78 67 15 Jatin Malik 76 66 77 87.5 67.5 (a) Read the csv file into a dataframe df which is stored with tab ('\t') separator.
(b) Write the code to find the total marks (Total_ marks) for each student and add it to the newly-created dataframe.
(c) Also calculate the percentage obtained by each student under a new column “Average” in the dataframe.
Write a program that reads students marks from a ‘Result.csv’ file and displays percentage of each student.
How can we import specific columns from a CSV file?
What are advantages of CSV file formats ?