Sumita Arora Solution

7. Why do you need connection to an SQL database in order to get data from a table ?
8. What is ‘pymysql’ library of Python ?

Ans 7: A database can be accessed by many programs simultaneously and hence to represent the unique session with a database connected from within a script or program we need connection to an SQL database to get data from a table. Ans 8: pymysql is a python library also called database connecter used for connecting […]

7. Why do you need connection to an SQL database in order to get data from a table ?
8. What is ‘pymysql’ library of Python ?
Read More »

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 ?
5. Which argument would you give to read.csv() if you only want to read top 10 rows of data ?

Ans 4: df = pd.read_csv( “File Path” , header = None ) Ans 5:We would give ‘nrows’ argument to read.csv() if you only want to read top 10 rows of data. for example: df = pd.read_csv( “File Path” , header = None , nrows = 10)

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 ?
5. Which argument would you give to read.csv() if you only want to read top 10 rows of data ?
Read More »

2. What all libraries do you require in order to bring data from a CSV file into a dataframe ?
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() ?

Ans 2: We mainly use ‘panda’ library  to being data from a CSV file into dataframe. Ans 3: df = pd.read_csv( ” File Path”, names = [ Sequence of coloumns ]

2. What all libraries do you require in order to bring data from a CSV file into a dataframe ?
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() ?
Read More »

15. Name the function to show the legend on a plot.
16. Name the function to add ticks on axes.

Ans:15We can use legend() function to show the legend on the plot.<matplotlib.pyplot>.legend(loc = <position number or string>) 16.<matplotlib.pyplot>.xticks(<sequence containing tick data points>)<matplotlib.pyplot>.yticks(<sequence containing tick data points>)

15. Name the function to show the legend on a plot.
16. Name the function to add ticks on axes.
Read More »

12. Name the function to give the title to a plot?
13. Name the function to set the figure size of a plot.
14. Name the function to set the limit for the axes.

Ans:12. To give the title of plot we can use title() function as :<matplotlib.pyplot>.title(<title string>)13. We can set the figure size of a plot using figure() function with figsize argument as <matplotlib.pyplot>.figure(figsize = (<width>, <length>))14.We can use xlim() and ylim() functions to set limits for X-axis and Y-axis respectively. <matplotlib.pyplot>.xlim(<xmin>, <xmax>)<br><matplotlib.pyplot>.ylim(<ymin>, <ymax>)

12. Name the function to give the title to a plot?
13. Name the function to set the figure size of a plot.
14. Name the function to set the limit for the axes.
Read More »

error: Content is protected !!