Page 111 - IPP-12-2024
P. 111
APPENDIX C
VIVA VOCE
1. What is Python? What are the benefits of using Python?
Ans. Python is a programming language with objects, modules, threads, exceptions and automatic memory
management. The benefits of using Python are that it is simple and easy, portable, extensible, has built-in
data structure and is open source.
2. How is Python interpreted?
Ans. Python is an interpreted language. Python program runs directly from the source code. It converts the
source code that is written by the programmer into an intermediate language, which is again translated
into the machine language that has to be executed.
3. What are NumPy arrays?
Ans. A NumPy array is a table of elements, all of the same type, indexed by a list/tuple of integers. NumPy arrays
are also called ndarrays.
4. Why are NumPy arrays used over lists?
Ans. NumPy arrays have contiguous memory allocation. Thus, same data elements in array stored as lists
require more space as compared to arrays.
• They are speedier to work with and, hence, more efficient than lists.
• They are more convenient to deal with.
5. What do you understand by Array slicing?
Ans. Array slicing refers to the process of extracting a subset of elements from an existing array and returning
the result as another array, possibly in a different dimension from the original.
6. Is Python NumPy better than lists?
Ans. Yes, NumPy arrays are better than lists. We use Python NumPy array instead of a list because of the
following three reasons:
(a) Less memory
(b) Fast
(c) Convenient
7. What is Pandas Series?
Ans. Pandas Series is a one-dimensional labelled data structure capable of holding data of any type (integer,
string, float, Python objects, etc.) accessed using respective data labels, called its index.
8. Who is the main author of Pandas?
Ans. Wes McKinney.
9. What is a Dataframe?
Ans. Dataframe is a two-dimensional data structure with heterogeneous data, usually represented in tabular
format. The data is represented in rows and columns. Each column represents an attribute and each row
represents a record. Features of dataframe are:
• Potentially, columns are of different types.
• Size is mutable.
• Labelled axes (rows and columns).
10. How is Dataframe different from a 2D array?
Ans. Dataframe can store data of any type whereas a NumPy 2D array can contain data of similar type.
Moreover, dataframe elements can be accessed by their default indexes for rows and columns along
with the defined labels whereas NumPy 2D array can be accessed using default index specifications only.
Dataframe is a data structure in the Pandas library having a simpler interface for operations like file loading,
plotting, selection, joining and group by, which come in handy in data processing applications.
11. How are Dataframes related to Series?
Ans. Dataframe and Series both are data structures in Pandas library. The individual columns of a dataframe can
be considered as a Series object.