Viva Voce
Viva Voce
Appendices A.17
12. What do you understand by the size of (i) a Series, (ii) a Dataframe?
Ans. Size attribute gives the number of elements present in Series or Dataframes.
13. What type of error is returned when the length of index and the length of data in Series() function is not
same?
Ans. ValueError
14. How can we fill missing values in dataframe?
Ans. For filling missing values, we can use fillna() method. For example,
df = df1.fillna(0)
15. Which is the standard data missing marker used in Pandas?
Ans. NaN
16. Which method is used to add a new row and change the data values of a row in a DataFrame ‘df1’?
Ans. df1.loc[ ] method
17. What will the following statement do?
Df1 = df.drop(['Name','Class','Rollno'],axis = 1)#Df1 is a dataframe object
Ans. It will delete three columns having labels ‘Name’, ‘Class’ and ‘Rollno’ from the dataframe df.
18. Which parameter is used to specify row or column in rename() function of dataframe?
Ans. index
19. Define the following terms:
(i) Median
(ii) Standard deviation
(iii) Variance
Ans. (i) Median: Median refers to the middle value of a given data set.
(ii) Standard deviation: It is measured as the spread of data distribution in the given data set. The built-in
function std() is used for calculating the standard deviation for a given data set.
(iii) Variance: It is the average of squared deviations from the mean.
20. What difference do we see in deleting with del and pop methods?
Ans. del method does not display the contents of the column deleted whereas pop() method deletes an existing
column as well as displays the contents of the deleted column.
21. Does drop() function delete the column permanently from a dataframe? If not, how can we do that?
Ans. No, drop() function does not delete the content until and unless we use inplace=True argument as it makes
permanent changes.
22. Which library is used for plotting in Python language?
Ans. Matplotlib is the library used for plotting in Python language.
23. Explain reindexing in Pandas.
Ans. Reindexing means to conform dataframe to a new index placing NA/NaN in locations having no value in
the previous index. It changes the row labels and column labels of a dataframe.
24. What is Pandas used for?
Ans. Pandas library is written for Python programming language for performing operations like data
manipulation, data analysis, etc. The library provides various operations as well as data structures to
manipulate time series and numerical tables.
25. How can we create an empty dataframe?
Ans. By using the function DataFrame().
26. Which attribute is used to check if the Series object contains NaN values?
Ans. hasnans
27. Which object in Pandas cannot grow in size?
Ans. Series
Appendices A.19
38. Which function is used to draw a histogram?
Ans. hist()
39. What is a CSV file?
Ans. Comma Separated Values (CSV) file is a type of plain text file that is the simplest way to store/arrange
tabular data. It must be saved with the .csv file extension. It can store numbers as well as text. Each line
represents a record wherein the data corresponding to every field is separated or delimited by comma.
40. Which Pandas method is used to send content of a dataframe to CSV file?
Ans. to_csv() method
41. Which Pandas method is used to read CSV file?
Ans. read_csv()
42. Which argument is to be given in read_csv() method to suppress first row as header?
Ans. header = None
43. Define a network. Why is it needed?
Ans. A network is an interconnected collection of autonomous computers that can share and exchange
information.
Need for networking:
(i) Resource sharing: Resources are shared by all computers over the network for effective utilization.
(ii) File sharing: A file in a network can be accessed from anywhere.
44. What are the various types of networks?
Ans. A network is an interconnection of several nodes through some communication media with the goal of
sharing data, files and resources. There are three types of networks:
(i) Local Area Network (LAN) (ii) Metropolitan Area Network (MAN)
(iii) Wide Area Network (WAN)
45. Which of the network topologies should be preferred for a company that would like to keep adding more
and more computers to the topology economically as it grows?
Ans. Tree/Star
46. What is meant by topology? Name some popular topologies.
Ans. Topology is the arrangement by which computers are connected to each other, either physically or
logically. The popular topologies are:
(i) Bus or Linear Topology (ii) Ring Topology
(iii) Star Topology (iv) Tree Topology
47. What is TCP/IP?
Ans. TCP/IP (Transmission Control Protocol/Internet Protocol) is a protocol for communication between
computers used as a standard for transmitting data over networks and is the basis for standard internet
protocols. It is also responsible for assembling packets at the receiver’s side.
48. Define the following data communicating devices:
(i) Repeater (ii) Bridge
(iii) Router (iv) Gateway
Ans. (i) Repeater: It is a device that amplifies and restores the signal before it gets degraded and transmits the
original signal back to the destination. A repeater is a regenerator and not an amplifier.
(ii) Bridge: A bridge is a device designed to connect two LAN segments. The purpose of a bridge is to filter
traffic on a LAN. Bridge relays frames between two originally separate segments. When a frame
enters a bridge, the bridge not only regenerates the signal but also checks the physical address of the
destination and forwards the new copy only to that port.
(iii) Router: Routers operate in the physical, data link and network layers of the OSI model. They decide the
path a packet should take. A router is a networking device whose software and hardware are usually
tailored to the tasks of routing and forwarding data packets across the network.
(iv) Gateway: A gateway operates on all the seven layers of OSI model. A network gateway is a computer
which has internet-working capability of joining together two networks that use different base
protocols. Gateway converts one protocol to another and can, therefore, connect two dissimilar
networks.
A.20 Informatics Practices with Python–XII
49. What is primary key?
Ans. Primary key is a combination of columns that uniquely identifies a row in a relational table.
50. What is candidate key?
Ans. All possible combinations of columns that can possibly serve as the primary key are called candidate keys.
51. What is foreign key?
Ans. A combination of columns where values are derived from primary key of some other table is called the
foreign key of the table in which it is contained.
52. What is alternate key?
Ans. A candidate key that is not serving as a primary key is called an alternate key.
53. What is MySQL?
Ans. MySQL is an open-source RDBMS that relies on SQL for processing the data in the database. The database
is available for free under the terms of General Public Licence (GPL).
54. What is RDBMS?
Ans. Relational Database Management System (RDBMS) facilitates access, security and integrity of data and
eliminates data redundancy. For example, MySQL, Oracle, Microsoft SQL Server, etc.
55. What is the use of DROP TABLE command?
Ans. DROP TABLE command is used to delete tables. For example, DROP TABLE Orders; will delete the table
named ‘Orders’.
56. What do you understand by NOT NULL constraint?
Ans. This constraint ensures that the null values are not permitted on a specified column. This constraint can be
defined at the column level and not at the table level.
57. What is the significance of COUNT?
Ans. It is used to count the number of values in a given column or number of rows in a table, for example,
SELECT COUNT(RollNo) FROM Students;
58. What is the importance of cyber laws?
Ans. Communication technology uses several means of transferring textual messages, pictures, etc., via
internet. Each time there may be a number of threats on either the sender’s or the receiver’s side
which create a bridge between networking communication. To sort out these problems, cyber laws exist
that touch almost all aspects of transactions and activities on the internet. Cyber laws are used to protect
people from online frauds.
59. Explain phishing.
Ans. Phishing is the fraudulent attempt to obtain sensitive information such as usernames, passwords and
credit card details, often for malicious reasons, by disguising as a trustworthy entity in an electronic
communication. Phishing is typically carried out by email spoofing or instant messaging and it often
directs users to enter personal information at a fake website, the look and feel of which is identical to the
legitimate one, the only difference being the URL of the website in question.
60. What is cyber stalking?
Ans. Cyber stalking is defined as the unlawful act of harassing a person or collecting an individual’s private
information using electronic network.
61. What are digital footprints?
Ans. Digital footprints are the trail of data we leave behind when we visit any website or use any online
application or portal to fill in data or perform any transaction.
62. What is identity theft?
Ans. Identity theft involves obtaining personal or financial information of another person and using their identity
to commit fraud, such as making unauthorised transactions or purchases. Identity theft is committed in
many different ways and its victims suffer damage to their reputation as well as financial loss.
Appendices A.21