Class 11 IP Chapter 12 Data Transfer Between Files , SQL Databases and Dataframes / Uncategorized / By Neha Exercise 12.1 Solutions 1. What is CSV file ? Is it a text file ? ...click here for answer 2. Name the function you would use to read data from a CSV file into a dataframe. ...click here for answer 3. Name the function you would use to store data from a dataframe into a CSV file. ...click here for answer 4. Which function lets you fetch data from an SQL table into a dataframe ? ...click here for answer 5. Which function lets you store data of a dataframe into an SQL table ? ...click here for answer 6. Which additional argument would you give to append the data of a dataframe in an existing SQL table ? ...click here for answer Back Exercise Part A Solutions 7 . Why do you need connection to an SQL database in order to get data from a table ? ...click here for answer 11. If query is a string storing an SQL statement. Write statements so that the data is fetched based on query from SQL database Mydata.db. ...click here for answer 8. What is sqlite3 library of Python ? ...click here for answer 1. What are advantages of CSV file formats ? ...click here for answer 2. What all libraries do you require in order to bring data from a CSV file into a dataframe ? ...click here for answer 3. You want to read data from a CSV file in a dataframe but you want to provide your own column names to dataframe. What additional argument would you specify in read_csv( ) ? ...click here for answer 4. By default, read_csv() uses the values of first row as column headers in dataframes. Which argument will you give to ensure that the top/first row’s data is used as data and not as column headers ? 'header' argument ...click here for answer 6. Write command to store data of dataframe mdf into a CSV file Mydata.csv, with separator character as ‘@’. ...click here for answer 5. Which argument would you give to read_csv() if you only want to read top 10 rows of data ? ...click here for answer 9. What all libraries do you require in order to interact with sqlite3 databases (and dataframe) from within Python ? ...click here for answer 10. What additional argument do you need to specify in to_sql() so that old data of SQL table is retained ? ...click here for answer Back Exercise Part B Solutions 1. Predict the output of following code fragments one by one. For every next code fragment, consider that the changes by previous code fragment are in place. That is, for code fragment (b), changes made by code fragment (a) are persisting ; for (c), changes by (a) and (b ) are persisting and so on. (a) import ...click here for answer Back Exercise Part C Solutions 3 . Write a program to get following data in two dataframes : ...Click for answer 1. Write a program to read details such as Item, Sales made in a dataframe and then store this data in a CSV file. ...Click for answer 2 . Write a program to read data from a CSV file where separator character is ‘@’. Make sure that: the top row is used as data, not as column headers. only 20 rows are read into dataframe ...Click for answer