Skip to main content

ads1

Chapter :- 1 Python Pandas - I

 Chapter :- 1 Python Pandas  



Answer the Following Question   

Q.1 How many Data Structures available in Pandas?

Ans. Two Data Structures available in Pandas

1. Data Series / Series 

2. Data Frame

Q.2 Write import Statement for Pandas Module

Ans. import pandas as pd

Q.3 Name some Python's data science Libraries.

Ans. Popular Python libraries used for data science are NumPy, Pandas, Scipy etc..

which are used with popular Visualization libraries matplotlib, Seaborn etc.

Q.4 What is the relationship between the rank of an array and the shape of the array?

Ans. The number of dimensions (axes) in an ndarray is known as its rank. A shape is a tuple that stores the number of elements in each dimension of the ndarray. Thus the length (len()) of shape tuple is same as that of rank of the ndarray.

Q.5 Define the following terms: (a) array slice (b) array subset.

Ans.

(a) An array slice is a subset of elements from an existing ndarray. An array slice is an ndarray itself. 

(b) Like an array slice, an array subset represents some extracted elements from an existing ndarray and is an ndarray itself. 

Array subset is little different from an array slice is that an array slice contains as per some pattern in its elements while elements of array subsets may or may not contain a pattern (can be contiguous or non-contiguous).


Q.6 What is Python Pandas? OR What is the significance of Pandas library?

Ans :-  Pandas is a Python data analysis library that offers fast, flexible, and expressive data structures for doing practical, real world data analysis in Python.


Q.7 ame the three basic data structures of Python Pandas. Or Name some common data structures of Python's Pandas library.

Ans. Three basic data structures of Python Pandas are:

Series 

DataFrame

Panel


Q.8 What is Series data structure of Python Pandas? 

Ans. Series is a one-dimensional labelled array capable of holding any data type (integers, strings, floating point numbers, Python objects, and so forth.).  


Q.9 Data Frame is ______ dimensional data structure.

Ans. Two


Q.10 _______ function returns last n rows from the object based on position.

Ans. tail()


Q.11 _______ function returns first n rows from the object based on position.

Ans. head()


Q.12 CSV stands for 

Ans Comma separated values.


Q.13 ________ Return the minimum over requested axis in Data Frame Df.

Ans. Df.min


Q.14_________ Return the sum over requested axis in Data Frame Df.

Ans. Df.sum


Q.15 What does DataFrame df.columns give?

Ans. Shows the columns name of Data Frame df.


Q.16 ________is used to check the Null values in a Data Frame.

Ans isnull ( )


Q.17 Which of the following is used to replace Null values in a Data Frame?

Ans fillna ( )


Q.18 Axis=0 in a Data Frame represents

Ans. Rows


Q.19 Axis=1 in a Data Frame represents.

Ans columns


Q.20 What is Dataframe data structure of Python pandas ?

Ans. DataFrame is a two-dimensional labelled data structure with columns of potentially different types.


Q.21 How does dataframe object specify indexes to its data rows?

Ans. If indexes are not specified with the DataFrame(), then these are generated from the input data in an intuitive fashion, for example, from the keys of dictionary (in case of column labels) or by using np.range(n) in the case of row labels, where n corresponds to the number of rows.

Q.22 Name some commonly used chart types.

Ans. Some commonly used chart types are line chart, bar chart, pie chart, scatter chart etc.

Q.23 What is histogram ? How is it useful?

Ans. A histogram is a statistical tool used to summarise discrete or continuous data. It provides a visual interpretation of numerical data by showing the number of data points that fall within a specified range of values (called "bins").


Q.24  Name the functions you will use to create a (i) line chart, (ii) bar chart. 

Ans. (i) matplotlib.pyplot.plot() (ii) matplotlib.pyplot.bar() 


Q.25 Compare bar() and barh() functions.

Ans.  The bar() function produces vertical bar chart by default. 

To produce the horizontal bar chart, barh() is used.


Q.26 What is a CSV file?

Ans. The acronym CSV is short for Comma-Separated Values, which refers to a tabular data saved as plain text where data values are separated by commas.


27.  What are advantages of CSV file formats ?

Ans. (i) CSV is a common format for data interchange. (ii) It can be opened in popular spreadsheet packages like MS-Excel, Calc etc.

28. Nam two functions provided by Pandas library that help you read and write to CSV files from Python code.

Ans. read_csv() for reading from a csv file from within Python code and to_csv() for writing onto a csv file from within Python code.

29. Which Pandas' data structure does the read_csv() function read the data into?

Ans. DataFrame


Link to Download Chapter 









ads2

Popular posts from this blog

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise or class wise.

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise  or class wise. Solution :-   # x-axis is shows the subject and y -axis # shows the markers in each subject # import pandas and matplotlib  import pandas as pd  import matplotlib.pyplot as plt # Simple Line Chart with setting of Label of X and Y axis, # title for chart line and color of line  subject = ['Physic','Chemistry','Mathematics', 'Biology','Computer'] marks =[80,75,70,78,82] # To draw line in red colour plt.plot(subject,marks,'r',marker ='*')     # To Write Title of the Line Chart plt.title('Marks Scored') # To Put Label At Y Axis plt.xlabel('SUBJECT')           # To Put Label At X Axis plt.ylabel('MARKS')             plt.show() Output :- 

Class 10th Chapter 7 Functions in Calc

   Functions in Calc Calc provide built-in standard functions for mathematical, logical, statistical, date and time, financial and other calculations on numbers and text. The process of inserting a function is similar for all functions.That is, to use a function we need to enter a correct spelling of the function along with necessary arguments. This is known as syntax of the functions. t is possible to loose the grip on it and easy to introduce errors. To avoid this, you may take help of function wizard. The Calc support some more functions that support logical decision making. These functions are AND, OR, and NOT. (1) In which of the following ways we can enter a function in Calc ? (a) Directly typing function name in a cell nan (b) Function wizard or selecting from tool bar (c) A and B both (d) Depends on functions (2) A function can start with which of the following options ? (a) '='sign (b) Alphabets (c) Numbers (d) Any of these (3) Which of the following is not a logical...

11. Write a Java program to input basic salary of an employee and calculate its Gross salary according to following:

    11. Write a Java program to input basic salary of an employee and calculate its Gross salary according to following: Basic Salary <= 10000 : HRA = 20%, DA = 80% Basic Salary <= 20000 : HRA = 25%, DA = 90% Basic Salary > 20000 : HRA = 30%, DA = 95% Static Solution :-  class salary {     public static void main(String args[])     {     double basic=20000.50,gross,da,hra;     if(basic <=10000)     {         da = basic * 0.8;         hra = basic *0.2;     }              else if(basic <=20000)     {         da = basic * 0.9;         hra = basic *0.25;     }     else     {         da = basic * 0.95; ...