IP TERM-1 Study Material (Session 2021-22)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 84

STUDY MATERIAL FOR TERM - 1

Class XII
INFORMATICS PRACTICES (065)

Session 2021-22

KENDRIYA VIDYALAYA SANGATHAN


Regional Office AGRA
OUR MENTORS

Sh. C.S. Azad


Deputy Commissioner
KVS RO Agra Region

Sh. M.L.Mishra
Assistant Commissioner
KVS RO Agra Region

Co-ordinator
Mrs. Neetu Verma
Principal
K.V. NO. 3 Agra
TERM – 1
Syllabus
Informatics Practices (Code No. 065 )

CLASS XII
Session : 2021-22

Distribution of Theory Marks :

Unit No Unit Name Marks


01 Data Handling using Pandas and Data 25
Visualization
04 Societal Impacts 10
Total 35

Unit 1: Data Handling using Pandas and Data Visualization


Data Handling using Pandas -I
● Introduction to Python libraries- Pandas, Matplotlib.
● Data structures in Pandas - Series and dataframes. Series: Creation of series from dictionary,
scalar value; mathematical operations; series attributes, head and tail functions; selection,
indexing and slicing.
● Data Frames: creation of data frames from dictionary of series, list of dictionaries, text/CSV
files, display, and iteration. Operations on rows and columns: add (insert /append) , select,
delete (drop column and row), rename, Head and Tail functions, indexing using labels, Boolean
indexing.
● Data Visualization: Purpose of plotting, drawing and saving of plots using Matplotlib (line plot,
bar graph, histogram). Customizing plots:; adding label, title, and legend in plots.
Unit 4: Societal Impacts
● Digital footprint, net and communication etiquettes,
● Data protection, intellectual property rights (IPR), plagiarism, licensing and copyright,
● Free and open source software (FOSS),
● Cybercrime and cyber laws, hacking, phishing, cyber bullying, overview of Indian IT Act.
● E-waste: hazards and management. Awareness about health concerns related to the usage of
technology.
UNIT – 1 Data Handling using Pandas and Data Visualization

Introduction of Python Libraries

Pandas

Pandas is an open source, BSD library built for Python Programming language. Pandas
offers high- performance, easy to use data structure and data analysis tools. Work with pandas
we need to import pandas library in python environment using below syntax.

Import pandas as pd
OR
Import pandas

You can use this syntax in either in shell prompt or in your script file (.py).

Pandas is most popular library and capable to do many task as given:-

 It can read and write many different data formats (integer, float, double etc.).
 It can calculate in all the possible ways data is organised i.e. across rows and down
columns.
 It can easily select subsets of data from bulk data sets. It has functionality to find and
filled missing data.
 It allow to apply operations to independent group within data.
It supports reshaping of data in different formats.
 It support advanced time –series functionality
 It support visualization by integrating matplotlib library.

In other words Pandas is the best library at handling huge tabular data sets comprising different
data formats.

Matplotlib

Data Visualization basically refers to the graphical or visual representation of


information and data using visual elements like charts, graphs, maps and so on. For Data
visualization in python we use matplotlib library’s pyplot interface used.
The matplotlib is a python library that provides many interfaces and functionality for 2D-
graphics similar to MATLAB in various forms. MATLAB is high performance language for
technical computing. The matplotlib library offers many different named collections of
methods. PyPlot is one of such interface.
PyPlot is a collection of methods within matplotlib library which allow 2D plots easily
and interactively. For PyPlot interface first we install matplotlib library if it is not preinstalled in
your system.

 First download wheel package of matplotlib as per python version installed. For this go
to the link https://pupi.org/project/matplotlib/#files.

 Next you need to insatll it by giving following commands on CMD.


python -m pip install -U pip
python -m pip install -U matplotlib

Importing PyPlot
To use PyPlot first import it in your python environment using following commands:
import matplotlib.pyplot
OR
import matplotlib.pyplot as pl

Multiple Choice Questions

Q1 Missing data in pandas is represented through:


a) Null
b) None
c) Missing
d) NaN

Answer : d) NaN
Q2 Mr X sitting on hot seat of KBC game of Sony TV and Mr Amitabh Bachhan ask a question to
Mr X that one of the statement is not correct. You help to Mr X for finding the correct answer :
a) import matplotlib.pyplot
b) matplotlib.PyPlot as pl
c) import matplotlib.pyplot as plt
d) matplotlib.pyplot.plot(x,y)

Answer : b) matplotlib.PyPlot as pl
Q3 PANDAS stands for _____________
a) Panel Data Analysis
b) Panel Data analyst
c) Panel Data
d) Panel Dashboard

Ans. C) Panel Data

Q4 which of the following library in Python is used for plotting graphs and visualization.
a) Pandas
b) NumPy
c) Matplotlib
d) None of the above

Ans. C) Matplotlib

Q5 Read the following code: Identify the purpose of this code and choose the right option from
the following.

C:\Users\YourName\AppData\Local\Programs\Python\Python36-32\Scripts>pip – version

A. Check if PIP is Installed


B. Install PIP
C. Download a Package
D. Check PIP version

Answer : A) Check if PIP is Installed


Data Structures in Pandas- Series

Series is a data structure of pandas. It represents a 1D array of indexed data.

– It has two main components-


• An array of actual data.
• An associated array of indexes or data labels.

Eg-

Index Data
Jan 31
Feb 28
Mar 31
Apr 30

Series can be created using

1. Array
2. Dict
3. Scalar value or constant

There are many ways to create series type object.

1. Using Series ( )-

<Series Object> = pandas.Series( ) it will create an empty series

Non-empty series creation– Import pandas as pd

<Series Object> = pd.Series(data, index=idx) where data can be python


sequence, ndarray, python dictionary or scaler value.
Series Objects creation

1. Creation of series with Dictionary-

*Key will act as index


2. Creation of series with Scalar value-

Mathematical Operations on Series:


1. Vector Operations on Series Object: Vector operations means that if we apply a function
or expression then it is individually applied on each item of the object. E.g.
2. Arithmetic Operations on Series Object:
e.g.
import pandas as pd1
s = pd1.Series([1,2,3])
t = pd1.Series([1,2,4])

# Addition Operation
ua=s+t
print (ua)
0 2
1 4
2 7
dtype: int64
# Multiplication Operation
um=s*t
print (um)
0 1
1 4
2 12
dtype: int64
# Division Operation
>>> ud=s/t
>>> print(ud)
0 1.00
1 1.00
2 0.75
dtype: float64

# Subtraction Operation
>>> us=t-s
>>> print(us)
0 0
1 0
2 1
dtype: int64

# Modulus or Remender Operation


>>> u1=s%t
>>> print(u1)
0 0
1 0
2 3
dtype: int64

Series Object Attributes :


<series object>.<AttributeName>

Attribute Description

Series.index Returns index of the series


Series.values Returns ndarray
Series.dtype Returns dtype object of the underlying data
Series.shape Returns tuple of the shape of underlying data
Series.nbytes Return number of bytes of underlying data

Series.ndim Returns the number of dimention


Series.size Returns number of elements

Series.intemsize Returns the size of the dtype


Series.hasnans Returns true if there are any NaN

Series.empty Returns true if series object is empty

head() and tail () Function


1. head(<n> ) function fetch first n rows from a pandas object. If you do not provide any
value for n, will return first 5 rows.
2. tail(<n> ) function fetch last n rows from a pandas object. If you do not provide any
value for n, will return last 5 rows.
Accessing Series Object

OBJECT SLICING

For Object slicing, follow the following syntax-


<objectName>[<start>:<stop>:<step >]
To change value in a certain slice
Change indexing of Series object:
<series object>.<index] = <new_index_array>

Here, indexes got changed.


Selection in Pandas Series: Selection means accessing of elements in pandas series. To access
individual elements of series object, we can give its index in square brackets along with its name.
Syntax: <series object>[index]
>>> import pandas as pd
>>> s3=pd.Series([2,4,6,8,10,12,14,16,18,20])
>>> s3
0 2
1 4
2 6
3 8
4 10
5 12
6 14
7 16
8 18
9 20
dtype: int64
>>> s3[5]
12
>>> s3[8]
18
Retrieve Data Using Label as (Index)
e.g.
import pandas as pd1
s = pd1.Series([1,2,3,4,5],index = ['a','b','c','d','e'])
print (s[['c','d']])
Output
c3
d4
dtype: int64

Retrieve Data from selection


There are three methods for data selection:
 loc gets rows (or columns) with particular labels from the index.
 iloc gets rows (or columns) at particular positions in the index (so it only takes integers).
 ix usually tries to behave like loc but falls back to behaving like iloc if a label is not present in
the index.
ix is deprecated and the use of loc and iloc is encouraged instead
e.g.
>>> s=pd.Series([10,20,30,40,50,60,70,80,90,100],[49,48,47,46,45,1, 2,3,4,5])
>>> s.iloc[:3]
49 10
48 20
47 30
dtype: int64
>>> s.loc[:3] # slice up to and including label 3
49 10
48 20
47 30
46 40
45 50
1 60
2 70
3 80
dtype: int64

>>> s.ix[:3] # the integer is in the index so


# s.ix[:3] works like loc
49 10
48 20
47 30
46 40
45 50
1 60
2 70
3 80
dtype: int64
Accessing Data from Series with indexing and slicing:
s1 = pd1.Series([1,2,3,4,5],index = ['a','b','c','d','e'])
s1=
1 2 3 4 5
Forward indexing 0 1 2 3 4
-5 -4 -3 -2 -1 Backward indexing
Specified indexing ‘a’ ‘b’ ‘c’ ‘d’ ‘e’
Slicing- Slicing means extracting part of the series
Syntax: Series[starting: end: step]
e.g.
>>> print(s1[0])
1
>>> print(s1['a'])
1
>>> print(s1[:3])
a 1
b 2
c 3
dtype: int64
>>> print(s1[-3:])
c 3
d 4
e 5
dtype: int64
>>> print(s1[2:4:2])
c 3
dtype: int64

Multiple Choice Questions

Q1. Assertion (A): Empty series can be created by using Series () function.
Reason (R): Series () function can create empty series having no values.

a. (A) is False but (R) is True


b. (A) is True but (R) is False
c. Both are True and (R) is correct explanation of (A)
d. Both are True but (R) is not correct explanation of (A)

Q3. What will be output for the following code?

import pandas as pd
s = pd.Series([1,2,3,4,5],index = ['a','b','c','d','e'])
print s['a']
A. 1
B. 2
C. 3
D. 4

Q4. What will be correct syntax for pandas series?

A. pandas_Series( data, index, dtype, copy)


B. pandas.Series( data, index, dtype)
C. pandas.Series( data, index, dtype, copy)
D. pandas_Series( data, index, dtype)

Q5. What will be output for the following code?

import pandas as pd
import numpy as np
s = pd.Series(np.random.randn(2))
print (s.size)
A. 0
B. 1
C. 2
D. 3

Q6. What will be output for the following code?

import pandas as pd
import numpy as np
s = pd.Series(np.random.randn(4))
print(s.ndim)
A. 0
B. 1
C. 2
D. 3
Q7. Which of the following thing can be data in Pandas Series?
A. a python dict
B. an ndarray
C. a scalar value
D. all of the mentioned

Q8. What is correct syntax to add the labels “x”, “y” and “z” to a Pandas Series?
A. pd.Series(mylist, names = ["x", "y", "z"])
B. pd.Series(mylist, index = ["x", "y", "z"])
C. pd.Series(mylist, lables = ["x", "y", "z"])
D. pd.Series(mylist, renames = ["x", "y", "z"])
Q9. Best way to import the pandas module in your program ?
A. .import pandas
B. import pandas as p
C. from pandas import *
D. All of the above

Q10. Way to install the pandas library ?


A. install pandas
B. pandas install python
C. python install pandas
D. None of the above
Q11. Assertion (A): While creating Series by specifying data as scalar value, index must be
provided.

Reason(R): The scalar value repeated to match the length of index.

a) (A) is False but (R) is True


b) (A) is True but (R) is False
c) Both are True but (R) is not correct explanation of (A)
d) Both are True and (R) is correct explanation of (A)

Q12. Mathematical Operations on two Series object is done by matching………………

A. Values
B. Indexes
C. NaN
D. Data types

13. Find the output of given code-

>>> import pandas as pd


>>> s=pd.Series(['a','s','r'],index=[2,6,9])
>>> print(s>='s')
A. 2 False
6 False
9 True
B. 2 False
6 False
9 False
C. 2 False
6 True
9 False
D. 2 True
6 False
9 True

14. For given code:


>>> import pandas as pd
>>> s=pd.Series(['orange','banana','mango','apple'],['nagpur','bhusawal','banaras','jammu'])
Write command to display ‘orange’ using labelled index

A. print(s[‘nagpur’])
B. print(s[0’])
C. print(s[1])
D. None of the above
15. For given two sequences
x=[10,20,30,40]
y=[[‘M’,’N’,’O’,’P’]
to create a series which of the following is not correct?

A. S=pd.Series(data=x,index=y)
B. S=pd.Series(x,index=y)
C. S=pd.Series(x,y)
D. S=pd.Series(data=x,index=y,type=np.float64)

16. Assertion (A): While creating a series object then there is no compulsion for the
uniqueness of indexes.
Reason(R): Index label cannot be duplicate for a series object.

a. (A) is True but (R) is False.


b. (A) is False but (R) is True
c. Both are True but (R) is not correct explanation of (A)
d. Both are True and (R) is correct explanation of (A)

17. To display 2nd element of Series object s, we can use


A. s[2]
B. s[1]
C. s[:1]
D. s[:2]
18. Assertion (A): If Series is created by specifying integer and NaN value as:
S=pd.Series([5,6,np.NaN]) will produce S as

0 5.0
1 6.0
2 NaN

Reason(R): Pandas automatically convert integer to floating type as NaN is not supported by
integer type.

a. (A) is False but (R) is True


b. (A) is True but (R) is False
c. Both are True but (R) is not correct explanation of (A)
d. Both are True and (R) is correct explanation of (A)

19. Find the output of given code-

S= pd.Series([3,6,8])
print(S.index)
A. Index([0,1,2])
B. Int64Index([0,1,2], dtype=Int64)
C. RangeIndex(start=0,stop=3,step=1)
D. [0,1,2]

20. Shardul wants to display 10 values from the bottom/end of series ‘s2’. Mitali suggest him
to write following commands:
(i) print(s2.tail(10))
(ii) print(s2[s2.count()-10:])
What do you think about both the commands?

a. (i) True (ii) False


b. (i) False (ii) True
c. Both are True
d. Both are False

Consider the following case and answer the questions 21 to 25

Virat has created a Series ‘sale’ which stores sale of a week.


1 40.0
2 32.0
3 NaN
4 44.0
5 28.0
6 NaN
7 50
His boss asked him to do some task which are given below. Help him to write appropriate
command for them.

21. Count missing or unknown values.


a. sale.size-sale.count()
b. len(sale)-sale.count()
c. both a & b are correct
d. none of the above

22. Alter the index of sale to weekday names.


a. sale.rename(index=[‘mon’,tue’,’wed’,’thu’,’fri’,’sat’,’sun’])
b. sale.renameindex=[‘mon’,tue’,’wed’,’thu’,’fri’,’sat’,’sun’]
c. sale.index=[‘mon’,tue’,’wed’,’thu’,’fri’,’sat’,’sun’]
d. sale.index([‘mon’,tue’,’wed’,’thu’,’fri’,’sat’,’sun’])
23. Reset sale to 0
a. sale=0
b. sale[:]=0
c. sale[: :]=0
d. both b & c are correct

24. Rename sale to ‘weeklysale’


a. sale.name=’weelysale’
b. sale.name(‘weeklysale’)
c. sale.rename=’weeklysale’
d. sale.rename(‘weeklysale’)

25. Display the sale between Tuesday to Friday


a. print(sale[‘tue’:’fri’])
b. print(sale[‘tue’:])
c. print(sale[‘tue’:’sat’])
d. print(sale[‘tue’ to ‘fri’])
Answer Key:

Question Answer
1. C
2. A
3. A
4. C
5. C
6. B
7. D
8. B
9. D
10. D
11. d
12. B
13. C
14. A
15. D
16. a
17. B
18. D
19. C
20. c
21. c
22. c
23. d
24. a
25. a
Pandas Data Structure- DataFrames
DataFrames
• Dataframe is a two dimensional data structure that is like a two dimensional
ndarray but is more powerful than ndarrays.
• Like series dataframe is a labelled array where rows and columns both can have
labels as in series.
• Dataframe has two indexes or axis; row index (axis=0) and a column index
(axis=1)
• Every value stored in Dataframe is identified through both indexes i.e. row index
and column index (or labels if defined).
• Different columns can have the values from different data types but all values in
a single column will be of the same datatype.
• The values stored in a Dataframe can be changed i.e. it is value mutable.
• Rows or columns can be added in an existing Dataframe i.e. it is size-mutable.

Understanding DataFrame
Column Labels

Name English BST ECO ACC IP


0 Ajay 35 40 35 40 40
1 Richa 42 38 42 33 45
2 Joy 38 28 37 27 41
3 Pragya 29 32 40 23 43

Index

Creating Dataframes
• To create Dataframes Python Pandas library must be imported.
Syntax : import pandas as pd
 A Dataframe can be created using DataFrame() function in pandas library
 DataFrame can be created from objects of different datatype:
 From Two Dimensional Dictionaries i.e. dictionaries having lists or
 dictionaries or ndarrays or series etc.
 Two Dimensional Arrays
 Series type objects
 Another Dataframe objects
DataFrame() function in Pandas

• It has following syntax:

Syntax : pd.DataFrame(DataStructure, columns=<Col-labels>, index=<Row-labels>)

 Here the data structure can any of the following:


 From Two Dimensional Dictionaries i.e. dictionaries having lists or
 dictionaries or ndarrays or series etc.
 Two Dimensional Arrays
 Series type objects
 Another Dataframe objects
 Column and index sequence are optional and they can be given using list or tuple.

Creating Dataframe from 2-D Dictionary having values in List


Example:

d= {“NAME": ["Ajay","Richa","Pragya"], "BST":[42,45,39], "IP":[41,38,43] }


df = pd.DataFrame(d)
NAME BST IP
0 Ajay 42 41
1 Richa 45 38
2 Pragya 39 43

Creating Dataframe from 2-D Dictionary having values in dictionaries


Example:

IP={"Ajay":41, "Richa":38, "Pragya":42}


BST={"Ajay":42, "Richa":45, "Pragya":39}
d= {"IP":IP,"BST":BST}
df1=pd.DataFrame(d)
IP BST
Ajay 41 42
Richa 38 45
Pragya 42 39

Creating Dataframe from Dictionary of Series


Example:

names = pd.Series(['AJAY','RICHA','PRAGYA','MOHIT'])
bstscore =pd.Series([78,73,65,82])
ipscore= pd.Series([82,85,91,75])
df = pd.DataFrame({"NAME":names,"BST":bstscore,"IP":ipscore})
NAME BST IP
0 AJAY 78 82
1 RICHA 73 85
2 PRAGYA 65 91
3 MOHIT 82 75

Creating Dataframe from List of Dictionaries


Example:

d1 = {'NAME': 'AJAY','BST':78,'IP':82}
d2 = {'NAME': 'RICHA','BST':73,'IP':85}
d3 = {'NAME': 'PRAGYA','BST':65,'IP':91}
d4 = {'NAME': 'MOHIT','BST':82,'IP':75}
df = pd.DataFrame([d1,d2,d3,d4])
NAME BST IP
0 AJAY 78 82
1 RICHA 73 85
2 PRAGYA 65 91
3 MOHIT 82 75
Creating Dataframe from 2-D List
Example:

data = [ [41,42],[38,45],[42,39] ]
df=pd.DataFrame(data, columns=[“IP”,”BST”], index= [“Ajay”,”Richa”,”Pragya”])

IP BST
Ajay 41 42
Richa 38 45
Pragya 42 39

Displaying the contents of a DataFrame


Use print() statement :
Syntax : print(DataframeName)
Example: print(DFMarks)

DataFrame Attributes
Attribute : Attributes give the information about DataFrame. A few common attributes:

Syntax : DataframeName.attribute

• index - It returns the index/Row-labels for data stored in Dataframe


• columns - It returns the column labels for data stored in dataframe
• values - It returns numpy array of dataframe values
• dtype- It returns the datatype of each column of the dataframe
• axes - it returns a 2-D list containing both the axes rows & columns
• size - Returns total number of elements in dataframe(from all rows and columns).
• shape - It returns the number of rows and column as a tuple
• empty - Returns True if dataframe is empty false otherwise.
• ndim - Return the number of dimensions in dataframe
• T - Returns the transpose of dataframe
• empty - It returns true if the series contains no data

Selecting /Accessing a Column from the DataFrame

Use Any of the following ways:


Syntax : DataframeName[ColumnName]
Example: DFMarks.ENG

Syntax : DataframeName.ColumnName
Example: DFMarks[‘ENG’]

Selecting /Accessing Multiple Columns from the DataFrame

Use following statement:


Syntax : DataFrameName[ [list of columns ] ]
Example: DFMarks[[‘IP’, ‘ENG’, ‘ECO’]

Selecting /Accessing Subset of Rows &Columns from the DataFrame

To access through Row and Column Labels use following syntax:

Syntax : DataFrameName.loc [StartRow : EndRow, StartColumn : EndColumn]


Example: DFMarks.loc[‘RICHA’: ‘DAVID’] #only Rows selected with all columns
DFMarks.loc[‘RICHA’: ‘DAVID’, ‘ENG’: ‘ACC’] # Rows & Columns both
DFMarks.loc[:, ‘ENG’: ‘ACC’] #only columns selected with all rows

To access through Row and Column Index use following syntax:

Syntax : DataFrameName.iloc [StartRow : EndRow, StartColumn : EndColumn]


Example: DFMarks.iloc[0: 5] #only Rows 0 to 4 selected with all columns
DFMarks.loc[0:5, 0: 3] # Rows(0 to 4) & Columns( 0 to 2) both
DFMarks.loc[:, 0:3] #only Columns( 0 to 2) selected with all rows

By using the above syntax only rows or only columns can also be selected. A range of rows or
columns can be given or a list of row and column can be given

Modifying individual value from the DataFrame


The values stored in a dataframe can be modified using same syntax/methods we use to access
one or more values in dataframe as learned earlier. The only difference is that we have to
assign new values to this selection of values and the number of values and shape (i.e. Number
of rows and columns) of new values must match with the shape of values we are accessing at
the left hand side of assignment.

Syntax : DataFrameName.columnName[row label or index] = newvalue


DataFrameName [columnName] [row label or index] = newvalue

Iterating DataFrame over Rows (Row wise)


To iterate a Dataframe Row wise iterrows() function is used:
Example:

for (row,rowseries) in df.iterrows():


print(row)
print(rowseries)

NAME BST IP
0 AJAY 78 82
1 RICHA 73 85
2 PRAGYA 65 91
3 MOHIT 82 75

Output:
0
NAME AJAY
BST 78
IP 82
Name: 0, dtype: object
1
NAME RICHA
BST 73
IP 85
Name: 1, dtype: object
2
NAME PRAGYA
BST 65
IP 91
Name: 2, dtype: object
3
NAME MOHIT
BST 82
IP 75
Name: 3, dtype: object
Iterating DataFrame over Columns(Column wise)
To iterate a Dataframe Column wise iteritems() function is used:
Example:

for (col,colseries) in df.iteritems():


print(col)
print(colseries)
NAME BST IP
0 AJAY 78 82
1 RICHA 73 85
2 PRAGYA 65 91
3 MOHIT 82 75
Output:
NAME
0 AJAY
1 RICHA
2 PRAGYA
3 MOHIT
Name: NAME, dtype: object
BST
0 78
1 73
2 65
3 82
Name: BST, dtype: int64
IP
0 82
1 85
2 91
3 75
Name: IP, dtype: int64

Adding Columns and Rows in Dataframes


Use any of the following syntax to Add a column in the Dataframe:
Syntax : DataFrameName.at[:, NewcolumnName] = NewColumnValues
DataFrameName.loc[:, NewcolumnName] = NewColumnValues

Use any of the following syntax to add a row in the dataframe:


Syntax : DataFrameName.at[NewRowlabel] = value for new row
DataFrameName.loc[NewRowlable] = value for new row
Deleting Columns and Rows in Dataframes

Using del statement : It deletes one column at a time/ works on column only. It performs
operation in-place only.

Syntax : del DataFrameName[columnname]

Using drop() method of dataframe : It can delete multiple rows or columns at a time. It can
perform both way in-place or not in-place by specifying the value for argument inplace to True
or False.

Syntax: DataFrameName.drop(label, axis=0,index=“list”, columns=“list”, inplace=false)

Some Commonly Used Functions:

describe() : It gives the following details of data inside the dataframe


• Count of non-NaN values
• Mean for every column
• Std : Standard deviation of values in columns
• Min : Minimum value in columns
• 25%, 50% and 75% percentiles in columns
• Max : maximum value in columns

Syntax : DataFrameName.describe()

head(n): Returns the top n rows from the dataframe (by default n=5)

Syntax : Dataframe.head(n)

tail(n) : Returns the bottom n rows from the dataframe (by default n=5)
Syntax : Dataframe.tail(n)

Renaming Rows/Columns: Labels of all or selected rows and columns can be changed using
rename() function:

Syntax : Dataframe.rename(index=dictionary,columns=dictionary,inplace=True|False)

To rename rows index argument is to be specified while to rename columns, columns argument
is to be specified. The value of inplace argument if set to True specifies that the changes will
be made to original dataframe and if set to False the changes will be made but a new
dataframe will be returned and original dataframe will not be changed.
The index and columns both arguments can be specified if row and column labels both are to be
modified.
The values for index and columns arguments are to be specified a dictionary object in which the
old label of row column is specified as the key and the new name is specified as value. This
dictionary object can have as many key:value pairs as are to be renamed.

Indexing and Boolean Indexing

Indexing : Indexing in dataframe is a process of selecting some rows or columns or both from
data i.e. selecting a subset of dataframe. We have seen how to do this using .loc or .iloc. In
which we can select particular rows, columns or both by specifying their index/labels.

Boolean Indexing : Boolean indexing is also the process of selecting subset of dataframe but not
by specifying row or column index/labels. In boolean indexing we obtain subset of dataframe
based on some boolean expression (comparision) i.e. is based on the data stored inside
dataframe.
Operators for boolean indexing
Relational Operators: <, >, <=, >=, !=, ==
Logical Operators: & (and), |(or), ~ (not)

To increase precedence : use parenthesis whenever required and for clarity. Always use
parenthesis for each condition whenever combining multiple conditions with & or | as these
operators have higher precedence than relational operators.

Syntax : dataframe[ boolean expression on same dataframe]


Ex: dfData[ (dfData.age> 25 ) & (dfData.amount<25000)]

DataFrames and CSV Files


CSV Files are Comma Separated Value files. These files are normal text files that contains the data
in various rows each of which can have multiple values separated by commas.
Since CSV files are common data storage format they can be shared among different platforms.
We can create a DataFrame from a CSV File and create a CSV file from Dataframes.

Writing DataFrames to CSV Files


Use following statement:

Syntax : DataFrameName.to_csv(‘FilePath’)

Example: DataFrameName.to_csv(‘D:\\Mydata\\df.csv’)

Since \ is an escape sequence character we must use \\ in place of \ while specifying path
Creating DataFrames from CSV Files

Use following statement:

Syntax : DataFrameName = pd.read_csv(‘FilePath’, index_col=column’s index)


Example: DataFrameName = pd.read_csv(‘D:\\Mydata\\df.csv’, index_col=0)

index_col argument specifies which column from the CSV file will become the index(row index)
in the Dataframe being created. If it is not specified then pandas itself will create zero based index
for all rows and all columns in CSV file will become the column in the DataFrame.

Multiple Choice Questions

Q.1 Choose correct from the following:


i A column in Dataframe can have different data type for its values
ii Different columns of the dataframe can have different values
iii A column in the Dataframe can have only one datatype
iv ii and iii

Q.2 Which argument is mandatory argument in DataFrame function


i First argument specifying the data structure from which Dataframe will
receive data.
ii Arguments for specifying row and column labels
iii No argument is mandatory
iv i and ii

Q.3 Which function is used to iterate over all columns in the Dataframe?
i iterrows()
ii iteritems()
iii itercolumns()
iv itervertial()

Q.4 Consider the following code :


for (x,y) in df.iterrows():
print(x)
print(y)
What is the data type of y?
i Series
ii Dataframe
iii Tuple
iv List
Q.5 Dataframes can be created using:
i List
ii Series
iii Dictionary
iv All above

Q.6 Richa is analyzing Gross Enrolment Ratio in Higher Education of India in respect of
marginalized sections and created following Dataframe dfGER:
dfGER
SC ST
2015 19.10 13.70
2016 19.90 14.20
2017 21.10 15.40
2018 21.80 15.90
2019 23.00 17.20

a. She wants to add a column “All” with values 24.30,24.50,25.20,25.80, & 26.30
respectively for each year, which of the following should she use:
i. dfGER.addcolumn[“All”]= [24.30,24.50,25.20,25.80,26.30]
ii. dfGER[“All”]= [24.30,24.50,25.20,25.80,26.30]
iii. dfGER.All= [24.30,24.50,25.20,25.80,26.30]
iv. dfGER.column[“All”]= [24.30,24.50,25.20,25.80,26.30]

b. She wants to see the data in respect of years 2016,2017 & 2018, which of the
following statement should she use:
i. dfGER.iloc[‘2016’ : ’2018’]
ii. dfGER.iloc[:, ‘2016’ : ’2018’]
iii. dfGER.iloc[:, 1:4]
iv. dfGER.iloc[1:4]

c. Which of the following statement will give him the details of ST column only in
respect of all years:
i. dfGER.ST
ii. dfGER[“ST”]
iii. both i and ii
iv. None of these
d. Which of the following statement will be used to remove the row containing the
details of 2015 from the Dataframe.
i. d.drop(labels=2015,axis=0, inplace=False)
ii. d.drop(labels=2015,axis=0, inplace=True)
iii. d.del(labels=2015,axis=0, inplace=False)
iv. d.del(labels=2015,axis=0, inplace=True)
e. She wants to save the Dataframe for further use in a CSV file, identify correct
statement out of following:
i. pandas.to_csv(“GER.SCSV”)
ii. pandas.write_csv(“GER.SCSV”)
iii. pandas.save_csv(“GER.SCSV”)
iv. pandas.writeto_csv(“GER.SCSV”)
Q.7 a. (A) Assertion: Pandas series can not be used to create DataFrame
(R) Reason: Every column of DataFrame is a pandas series.
i. Both A and R are correct but R is not correct explanation of A
ii. Both A and R are correct and R is correct explanation of A
iii. R is correct but A is incorrect
iv. A is correct but R is Incorrect

b. (A) Assertion: Binary arithmetic operation cannot be performed between two


Dataframe of different shapes.
(R) Reason: Broadcasting is done when two Dataframe are not of same shape while
performing binary arithmetic operations in between them.
i. Both A and R are correct but R is not correct explanation of A
ii. Both A and R are correct and R is correct explanation of A
iii. R is correct but A is incorrect
iv. A is correct but R is Incorrect
c. (A) Assertion: del statement is used to remove a column from the Dataframe.
(R) Reason : drop method is used to remove one or more rows and/or columns from
the dataframe.
i. Both A and R are correct but R is not correct explanation of A
ii. Both A and R are correct and R is correct explanation of A
iii. R is correct but A is incorrect
iv. A is correct but R is Incorrect
d. (A) Assertion: Dataframes can be sliced horizontally and/or vertically to extract the
subset of DataFrame.
(R) Reason : extract() function is used to slice the dataframes.
i. Both A and R are correct but R is not correct explanation of A
ii. Both A and R are correct and R is correct explanation of A
iii. R is correct but A is incorrect
iv. A is correct but R is Incorrect
e. (A) Assertion: Keys of dictionary becomes the title of columns if Dataframe is created
from dictionary.
(R) Reason : Dictionary can not be used to create dataframes.
i. Both A and R are correct but R is not correct explanation of A
ii. Both A and R are correct and R is correct explanation of A
iii. R is correct but A is incorrect
iv. A is correct but R is Incorrect
Q.8 Anisha is a commerce teacher and working to analyze student’s data. She has create
a dataframe dfm as given below. Help her by answering the questions that follows:

DataFrame – dfm

a. Which of the following will be used to show the details of ACC column only:
i. dfm.acc
ii. dfm.ACC
iii. dfm[‘acc’]
iv. all of these

b. Which of the following will be used to show the details of DAVID only :
i. dfm.iloc[3]
ii. dfm.iloc[4]
iii. dfm.iloc[‘DAVID’]
iv. All of these

c. Which of the following will be used to show the marks of Amit in IP:
i. dfm.IP['AMIT']
ii. dfm[4,[‘IP’]]
iii. dfm["IP"]["AMIT"]
iv. i and iii
d. Which of the following will be used to show the columns of IP and BST only where
IP is first and then BST is second column:
i. dfm.iloc[:,3:1:-1]
ii. dfm.iloc[:,3:1:-2]
iii. dfm.iloc[:,3:0:-1]
iv. dfm.iloc[:,3:0:-2]

e. If the rows of ROHINI, AVIKA, DAVID are to be shown along with all subject columns
where the order of Rows should be ROHINI, AVIKA and DAVID what should be the
statement out of the following:
i. dfm.loc["ROHINI":"RICHA":-2]
ii. dfm.loc["ROHINI":"DAVID":-3]
iii. dfm.loc["ROHINI":"RICHA":-3]
iv. dfm.loc["ROHINI":"MANISH":-2]

f. Which of the following statement will be used to show the details of ENG, BST and
ECO columns.
i. dfm.iloc[:,'ENG','BST','ECO']
ii. dfm.iloc[:,0,1,4]
iii. dfm.iloc[:,[0,1,4]]
iv. dfm.iloc[:,1,2,5]

g. Which statement will be used to score of MANISH, AMIT and PRAGYA in subject
ENG, BST and IP.
i. dfm.iloc[[2,4,5],[0,1,3]]
ii. dfm.iloc[2,4,5: 0,1,3]
iii. dfm.iloc[[3,5,6],[1,2,4]]
iv. dfm.iloc[3,5,6: 1,2,4]

h. She wants to add on more record of DIVYA with score 92 in Economics, 63 in


Accountancy, 76 in English, 83 in IP and 88 in BST. Suggest her which of the following
statement will be used:
i. dfm.append["DIVYA"] = [76,88,63,83,92]
ii. dfm.loc["DIVYA"] = [76,88,63,83,92]
iii. dfm.append(“DIVYA”, [76,88,63,83,92])
iv. dfm.append( [76,88,63,83,92],”DIVYA”)
i. She wants to add the marks of Physical education also in the dataframe as another
column PE, these are 78,58,63,95,67,83,94,92,77,68 respectively. Suggest her which
of the following statement will be used.

i. dfm.loc[:,"PE"]=[78,58,63,95,67,83,94,92,77,68 ]
ii. dfm[“PE”]= [78,58,63,95,67,83,94,92,77,68 ]
iii. dfm.addcol(“PE”, [78,58,63,95,67,83,94,92,77,68 ])
iv. i and ii

j. She found later after creating dataframe that she has put marks wrongly in subjects
BST & Accountancy, to manage with mistake she wants to rename the columns of
BST as ACC and ACC as BST. Which statement should she use out of following:
i. dfm.rename(columns={'BST':'ACC','ACC':'BST'})
ii. dfm.rename(columns={'BST':'ACC','ACC':'BST'}, inplace=True)
iii. dfm.rename(columns={'BST':'ACC','ACC':'BST'}, inplace=False)
iv. dfm.rename(columns={'BST':'ACC','ACC':'BST'}, inplace=”True”)

Q.9 M/s ComTech Systems pvt. Ltd. is a company dealing in IT products, following
dataframe dfp is an extraction their database to be analyzed for making policy
decisions before actual analysis basic tasks are to be done. Answer following
questions to perform these basic tasks:

DataFrame : dfp
a. Which statement out of following will remove the column Model from the
dataframe:
i. del dfp.Model
ii. del dfp[“Model”]
iii. drop dfp.Model
iv. drop dfp[“Model”]

b. Select which statement will delete all the rows having label LAPTOP from the
existing dataframe:

i. dfp.drop(labels='LAPTOP',axis=0,inplace=True)
ii. dfp.drop(labels='LAPTOP',axis=1)
iii. dfp.drop(index='LAPTOP',inplace=True)
iv. i and iii
c. Which statement will give a new dataframe after renaming the column Brand as
Comp and Row label laptop as NBOOK:

i. dfp.rename(index={'LAPTOP':'NBOOK'}, columns={'Brand':"Comp"})
ii. dfp.rename(index={'LAPTOP':'NBOOK'}, columns={'Brand':"Comp"},
inplace= ‘True’)
iii. dfp.rename(index=['LAPTOP','NOTEBOOK'], columns=['Brand',"Company"])
iv. Two Separate statement will be required to rename columns and rows.

d. Which of the following statement is correct to get a new dataframe newdf after
deleting column Qty:

i. newdf= del dfp[“Qty”]


ii. newdf= del dfp.Qty
iii. newdf= dfp.drop(labels='Qty’,axis=1,inplace=True)
iv. newdf= dfp.drop(labels='Qty’,axis=1,inplace=False)

e. Which of the following is correct to Retrive the details of all products from Brand
KTEK and pricing more than 25000.
i. dfp[(dfp.Brand=="KTEK") and (dfp.Price>25000)]
ii. dfp[(dfp.Brand=="KTEK") & (dfp.Price>25000)]
iii. dfp[dfp.Brand=="KTEK" and dfp.Price>25000]
iv. dfp[ dfp.Brand=="KTEK" & dfp.Price>25000]
Answer Key

Q.1 iv
Q.2 iii
Q.3 ii
Q.4 i
Q.5 iv
Q.6
a. ii
b. iv
c. ii
d. ii
e. i
Q.7
a.b. iii
iiic. i
d. iv
e. Iv
Q.8
a. ii
b. i
c. iv
d. iv
e. ii
f. iii
g. i
h. ii
i. Iv
j. ii
Q.9
a. ii
b. iv
c. i
d. iv
e. Ii
Data Visualization

"A picture is worth a thousand words". Most of us are familiar with this statement. Data
visualization plays an essential role in the representation of both small and large-scale data. It
especially applies when trying to explain the analysis of increasingly large datasets.
Data visualization is the discipline of trying to expose the data to understand it by placing it in a
visual context. Its main goal is to distill large datasets into visual graphics to allow for easy
understanding of complex relationships within the data.
Several data visualization libraries are available in Python, namely Matplotlib, Seaborn, and
Folium etc.

Purpose of Data visualization:


o Better analysis
o Quick action
o Identifying patterns
o Finding errors
o Understanding the story
o Exploring business insights
o Grasping the Latest Trends
Plotting library :
Matplotlib is the whole python package/ library used to create 2D graphs and plots by using
python scripts. pyplot is a module in matplotlib, which supports a very wide variety of graphs and
plots namely - histogram, bar charts, power spectra, error charts etc. It is used along with NumPy
to provide an environment for MatLab.
Pyplot provides the state-machine interface to the plotting library in matplotlib. It means that
figures and axes are implicitly and automatically created to achieve the desired plot. For example,
calling plot from pyplot will automatically create the necessary figure and axis to achieve the
desired plot. Setting a title will then automatically set that title to the current axis object. The
pyplot interface is generally preferred for non-interactive plotting (i.e., scripting).
Matplotlib – pyplot features:

Following features are provided in matplotlib library for data visualization.


• Drawing – plots can be drawn based on passed data through specific functions.

• Customization – plots can be customized as per requirement after specifying it in the


arguments of the functions.Like color, style (dashed, dotted), width; adding label, title, and
legend in plots can be customized.

• Saving – After drawing and customization plots can be saved for future use.

Steps to plot in matplotlib:


• Install matplotlib by pip command - pip install matplotlib in command prompt

• Create a .py & import matplotlib library in it using - import matplotlib.pyplot as plt statement

• Set data points in plot() method of plt object

• Customize plot through changing different parameters

• Call the show() method to display plot

• Save the plot/graph if required

Types of plot using matplotlib


• LINE PLOT
• BAR GRAPH

• HISTOGRAM etc.

Line Plot:
A line plot/chart is a graph that shows the frequency of data occurring along a number line.
The line plot is represented by a series of datapoints connected with a straight line. Generally
line plots are used to display trends over time. A line plot or line graph can be created using the
plot() function available in pyplot library. We can, not only just plot a line but we can explicitly
define the grid, the x and y axis scale and labels, title and display options etc.
E.G.PROGRAM
import numpy as np
import matplotlib.pyplot as plt
year = [2014,2015,2016,2017,2018]
jnvpasspercentage = [90,92,94,95,97]
kvpasspercentage = [89,91,93,95,98]
plt.plot(year, jnvpasspercentage, color='g')
plt.plot(year, kvpasspercentage, color='orange')
plt.xlabel(‘Year')
plt.ylabel('Pass percentage')
plt.title('JNV KV PASS % till 2018')
plt.show()
Note:- As many lines required call plot() function multiple times with suitable arguments.

Line Plot customization


• Custom line color
plt.plot(year, kvpasspercentage, color='orange')
Change the value in color argument.like ‘b’ for blue,’r’,’c’,…..
• Custom line style
plt.plot( [1,1.1,1,1.1,1], linestyle='-' , linewidth=4).
set linestyle to any of '-‘ for solid line style, '--‘ for dashed, '-.‘ , ':‘ for dotted line
• Custom line width
plt.plot( 'x', 'y', data=df, linewidth=22)
set linewidth as required
• Title
plt.title('JNV KV PASS % till 2018') – Change it as per requirement
• Lable - plt.xlabel(‘Year') - change x or y label as per requirement

• Legend - plt.legend(('jnv','kv'),loc='upper right‘,frameon=False)


Change (),loc,frameon property as per requirement

Bar Graph
A graph drawn using rectangular bars to show how large each value is. The bars can be horizontal
or vertical. A bar graph makes it easy to compare data between different groups at a glance. Bar
graph represents categories on one axis and a discrete value in the other. The goal bar graph is
to show the relationship between the two axes. Bar graph can also show big changes in data over
time
e.g program
import matplotlib.pyplot as plt
import numpy as np
label = ['Anil', 'Vikas', 'Dharma', 'Mahen', 'Manish', 'Rajesh']
per = [94,85,45,25,50,54]
index = np.arange(len(label))
plt.bar(index, per)
plt.xlabel('Student Name', fontsize=5)
plt.ylabel('Percentage', fontsize=5)
plt.xticks(index, label, fontsize=5, rotation=30)
plt.title('Percentage of Marks achieve by student Class XII')
plt.show()
#Note – use barh () for horizontal bars

Bar graph customization


• Custom bar color
plt.bar(index, per,color="green",edgecolor="blue")
Change the value in color,edgecolor argument.like ‘b’ for blue,’r’,’c’,…..
• Custom line style
plt.bar(index, per,color="green",edgecolor="blue",linewidth=4,linestyle='--')
set linestyle to any of '-‘ for solid line style, '--‘ for dashed, '-.‘ , ':‘ for dotted line
• Custom line width
plt.bar(index, per,color="green",edgecolor="blue",linewidth=4)
set linewidth as required
• Title
plt.title('Percentage of Marks achieve by student Class XII')
Change it as per requirement
• Lable - plt.xlabel('Student Name', fontsize=5)- change x or y label as per requirement
• Legend - plt.legend(('jnv','kv'),loc='upper right‘, frameon=False)
Change (),loc,frameon property as per requirement

HISTOGRAM

A histogram is a graphical representation which organizes a group of data points into user-
specified ranges.
Histogram provides a visual interpretation of numerical data by showing the number of data
points that fall within a specified range of values (“bins”). It is similar to a vertical bar graph but
without gaps between the bars.

import numpy as np
import matplotlib.pyplot as plt
data = [1,11,21,31,41]
plt.hist([5,15,25,35,45, 55], bins=[0,10,20,30,40,50, 60], weights=[20,10,45,33,6,8],
edgecolor="red")
plt.show()
Customization of Histogram –
By default bars of histogram is displayed in blue color but we can change it to other color with
following code . plt.hist([1,11,21,31,41, 51], bins=[0,10,20,30,40,50, 60], weights=[10,1,0,33,6,8],
facecolor='y', edgecolor="red")
In above code we are passing ‘y’ as facecolor means yellow color to be displayed in bars.
To give a name to the histogram write below code before calling show()
plt.title("Histogram Heading")
Edge color and bar color can be set using following parameter in hist() method
edgecolor='#E6E6E6',color='#EE6666 .color value can be rgb in hexadecimal form
For x and y label below code can be written
plt.xlabel('Value')
plt.ylabel('Frequency')

For future use we have to save the plot.Tosave any plot savefig() method is used.plotscan be
saved like pdf,svg,png,jpgfile formats.
plt.savefig('line_plot.pdf')
plt.savefig('line_plot.svg')
plt.savefig('line_plot.png')
Parameter for saving plots .e.g.
plt.savefig('line_plot.jpg', dpi=300, quality=80, optimize=True, progressive=True)
Which Export Format to Use?
The export as vector-based SVG or PDF files is generally preferred over bitmap-based PNG or JPG
files as they are richer formats, usually providing higher quality plots along with smaller file sizes

Case Study Based MCQs

1. Consider the following program and answer any four question from (i) to (v) :

import _______ as plt


plt.bar ([2,3,4,8,1],[2,4,7,3,5], label= _____ )
plt.legend( )
plt.xlabel(____ )
plt.ylabel(‘Height’)
plt._______ (‘Vertical Bar Chart’)
(i) Which Module will be imported in Line 1 for above code ?
(a) matplotlib (b) matplotlib.pyplot
(c) plotlib (d) None of these
Ans: (b)
(ii) Name the label that can be used to represent the bar chart in Line 2 .
(a) Data (b) Data Values
(b) Values for X axix (d) All of these

Ans: (d)

(iii) Which message is best suited for xlabel ?


(a) X values (b) Y values
(c) Legend (d) Vertical
Ans: (a)
(iv) Which method will take place at Line 6 for setting heading on the top of Chart ?
(a) Title() (b) title()

(c) Head() (d) All of these.

Ans: (a)
(v) Choose the statement to be place at Line7 of the above code .
(a) Plt.print() (b) plt.show()

(c) Plt.display() (d) plot.show()

Ans: (b)
2. If you are given to plot a histogram using numpy array as per the code given below then
answer any of four question from (i) to (v)

from matplotlib import _____ as plt

import numpy as np

fig, ax = plt.______ (1, 1)


a= np.array([26,59,44,39,76,16,23,11,18,78])

ax.hist(a, bins=[0,10,20,30,40])

ax._____ (‘Histogram’)

ax.set_xticks ([0,10,20,30,40, ])

ax.set_xlabel(‘Percentage’)

ax._______ (‘Students’)

______

(i) Choose the correct option to import for given propgram:


(a) matplotlib (b) matplot

(c) pyplot (d) plot

Ans: (c)

(ii) Fill in the blank at Line 3


(a) subplots (b) subplot

(c) plot (d) subplt

Ans: (a)

(iii) Which statement is used to set title in Line 6 ?


(a) title (b) set_title

(c) set (d) Title

Ans: (b) set_title

(iv) How to set Y-axis label ?


(a) label() (b) set_y

(c) set_ylab () (d) set_ylabel

Ans: (d) set_ylabel


(v) To fill in blank on Line 10 for showing histogram what can bee used ?
(a) plt.show() (b) plt_show()

(c) plot_show() (d) plt.show

Ans: plt.show()
3. Consider the following case and answer the from (i) to (v)

import …………. as pd
import matplotlib. _____ as plt
data= {‘Name’ : [‘Karan’, ‘Adi’, ‘Abhinav’, ‘Kirti’, ‘Rahul’ ],
‘Height’ : [60,61,63,65,61],
‘Weight’ : [47,89,52,58,50,47]}
df=pd. _________ (data)
df._____ (Kind =’hist’, edgecolor = ‘Green’, linewidth =2, linestyle=’:’ , fill= False)
_____________

(i) Fill in the blank in Line 1.


(a) numpy (b) pandas

(c) Python (d) matplot

Ans: (b) pandas


(ii) Fill in the blank in Line 2.

(a) pyplot (b) plot

(c) pyp (d) None of these

Ans: (a) pyplot


(iii) Which of the following is used in Line 6 to represent the data ?

(a) Series (b) Matplot

(c) DataFrame (d) Plot

Ans: (c) DataFrame


(iv) For blank of Line 7 command used may be :

(a) plt (b) pyplot

(c) plot (d) figure

Ans: (c)plot

(v) To show the above graph , which statement is used in Line 8 ?

(a) plot.show (b) plot.show()

(c) plt.show (d) plt.show()

Ans: (d) plt.show()

1. What is true about Data Visualization ?

A. Data Visualization is used to communicate information clearly and efficiently to users by the
usage of information graphics such as tables and charts.
B. Data Visualization helps users in analyzing a large amount of data in a simpler way.
C. Data Visualization makes complex data more accessible, understandable, and usable.
D. All of the above

Ans : D

Explanation: Data Visualization is used to communicate information clearly and efficiently to


users by the usage of information graphics such as tables and charts. It helps users in analyzing
a large amount of data in a simpler way. It makes complex data more accessible,
understandable, and usable.

2. Which method is used to save the output of pyplot in the form of image file ?

A. savefig(‘filename’)
B. save_fig(‘filename)
C. save_figure(‘filename’)
D. save_img(‘filename’)

Answer : A
3. Data visualization is also an element of the broader _____________.

A. deliver presentation architecture


B. data presentation architecture
C. dataset presentation architecture
D. data process architecture

Answer : B

4. The command used to give a heading to a graph is _________


A. plt.show()
B. plt.plot()
C. plt.xlabel()
D. plt.title()

Answer: D

5. Common use cases for data visualization include?

A. Politics
B. Sales and marketing
C. Healthcare
D. All of the above

Answer: D

6. Which are pros of data visualization?

A. It can be accessed quickly by a wider audience.


B. It can misrepresent information
C. It can be distracting
D. None Of the above

Ans : A

Explanation: Pros of data visualization : it can be accessed quickly by a wider audience.

7. Which are cons of data visualization?

A. It conveys a lot of information in a small space.


B. It makes your report more visually appealing.
C. visual data is distorted or excessively used.
D. None Of the above

Ans : C
Explanation: It can be distracting : if the visual data is distorted or excessively used.

8. Which one of the following is most basic and commonly used techniques?

A. Line charts
B. Scatter plots
C. Population pyramids
D. Area charts

Answer: A

Explanation: Line charts. This is one of the most basic and common techniques used. Line charts
display how variables can change over time.

9. Which is a python package used for 2D graphics?

A. matplotlib.pyplot

B. matplotlib.pip

C. matplotlib.numpy

D. matplotlib.plt

ANS: A

10. Observe the output figure. Identify the coding for obtaining this output.

A. import matplotlib.pyplot as plt

plt.plot([1,2,3],[4,5,1])

plt.show()

B. import matplotlib.pyplot as plt

plt.plot([1,2],[4,5])

plt.show()

C. import matplotlib.pyplot as plt

plt.plot([2,3],[5,1])

plt.show()
D. import matplotlib.pyplot as plt

plt.plot([1,3],[4,1])

plt.show()

ANS: A

12. Identify the right type of chart using the following hints.

Hint 1: This chart is often used to visualize a trend in data over intervals of time.

Hint 2: The line in this type of chart is often drawn chronologically.

A. Line chart

B. Bar chart

C. Pie chart

D. Scatter plot

ANS: A

13. Which of the following method will be add inside the file to display plot?

A. show()

B. display()

C.plot()

D.execute()

ANS: show()

14. Which method is used to plot horizontal bar graph in pyplot ?

A. horizontal_bar()

B. barh()

C. hbar()

D. bar()
ANS: C

15. Which method is used to plot histogram in pyplot?

A. his()

B. hist()

C. Hist()

D.histogram()

ANS: B
UNIT – 4 SOCIETAL IMPACTS

Societal impacts
In the past few decades there has been a revolution in computing and communications, and all
indications are that technological progress and use of information technology will continue at a
rapid pace. Accompanying and supporting the dramatic increases in the power and use of new
information technologies has been the declining cost of communications as a result of both
technological improvements and increased competition. According to Moore’s law the processing
power of microchips is doubling every 18 months. These advances present many significant
opportunities but also pose major challenges. Today, innovations in information technology are
having wide-ranging effects across numerous domains of society, and policy makers are acting on
issues involving economic productivity, intellectual property rights, privacy protection, and
affordability of and access to information. Choices made now will have long lasting consequences,
and attention must be paid to their social and economic impacts. One of the most significant
outcomes of the progress of information technology is probably electronic commerce over the
Internet, a new way of conducting business. Though only a few years old, it may radically alter
economic activities and the social environment. Already, it affects such large sectors as
communications, finance and retail trade and might expand to areas such as education and health
services. It implies the seamless application of information and communication technology along
the entire value chain of a business that is conducted electronically. The following sections will
focus on the impacts of information technology and electronic commerce on business models,
commerce, market structure, workplace, labour market, education, private life and society as a
whole.
Digital Footprint
A digital footprint is data that is left behind when users have been online. There are two types of
digital footprints which are passive and active. A passive footprint is made when information is
collected from the user without the person knowing this is happening. An active digital footprint
is where the user has deliberately shared information about themselves either by using social
media sites or by using websites.
An example of a passive digital footprint would be where a user has been online and information
has been stored on an online database. This can include where they came from, when the
footprint was created and a user IP address. A footprint can also be analysed offline and can be
stored in files which an administrator can access. These would include information on what that
machine might have been used for, but not who had performed the actions.
An example of an active digital footprint is where a user might have logged into a site when editing
or making comments such as on an online forum or a social media site. The registered name or
profile can be linked to the posts that have been made and it is surprisingly easy to find out a lot
about a person from the trails you leave behind.
Net and Communication Etiquettes
1. Be respectful.
2. Be aware of how your comments might be read:
3. Be careful with humour and sarcasm
4. Think about who can see what you have shared.
5. Remember to check friend requests and group invites before accepting them.
6. Take time to have a read of the rules of conduct/ community standards.
7. Be forgiving.

Data Protection
Data protection is a set of strategies and processes you can use to secure the privacy, availability,
and integrity of your data. It is sometimes also called data security or information privacy. A data
protection strategy is vital for any organization that collects, handles, or stores sensitive data.

Data Protection vs Data Privacy

Although both data protection and privacy are important and the two often come together, these
terms do not represent the same thing.

One addresses policies, the other mechanisms

Data privacy is focused on defining who has access to data while data protection focuses on
applying those restrictions. Data privacy defines the policies that data protection tools and
processes employ.

Creating data privacy guidelines does not ensure that unauthorized users don’t have access.
Likewise, you can restrict access with data protections while still leaving sensitive data vulnerable.
Both are needed to ensure that data remains secure.

Another important distinction between privacy and protection is who is typically in control. For
privacy, users can often control how much of their data is shared and with whom. For protection,
it is up to the companies handling data to ensure that it remains private. Compliance regulations
reflect this difference and are created to help ensure that users’ privacy requests are enacted by
companies.

Data Protection Technologies and Practices that Can Help You Protect User Data

When it comes to protecting your data, there are many storage and management options you
can choose from. Solutions can help you restrict access, monitor activity, and respond to threats.
Here are some of the most commonly used practices and technologies:
1. Data loss prevention (DLP)—a set of strategies and tools that you can use to prevent data from
being stolen, lost, or accidentally deleted. Data loss prevention solutions often include several
tools to protect against and recover from data loss.
2. Storage with built-in data protection—modern storage equipment provides built-in disk
clustering and redundancy. For example, Cloudian’s Hyperstore provides up to 14 nines of
durability, low cost enabling storage of large volumes of data, and fast access for minimal RTO /
RPO.
3. Firewalls—utilities that enable you to monitor and filter network traffic. You can use firewalls to
ensure that only authorized users are allowed to access or transfer data.
4. Authentication and authorization—controls that help you verify credentials and assure that user
privileges are applied correctly. These measures are typically used as part of an identity and
access management (IAM) solution and in combination with role-based access controls (RBAC).
5. Encryption—alters data content according to an algorithm that can only be reversed with the
right encryption key. Encryption protects your data from unauthorized access even if data is
stolen by making it unreadable. Learn more in our article: Data Encryption: An Introduction.
6. Endpoint protection—protects gateways to your network, including ports, routers, and
connected devices. Endpoint protection software typically enables you to monitor your network
perimeter and to filter traffic as needed.
7. Data erasure—limits liability by deleting data that is no longer needed. This can be done after
data is processed and analyzed or periodically when data is no longer relevant. Erasing
unnecessary data is a requirement of many compliance regulations, such as GDPR. For more
information about GDPR, check out our guide: GDPR Data Protection.

Intellectual Property Rights


Property
The word property is generally used to mean a possession or, more specifically, something to
which the owner has legal rights

Intellectual Property
It refers to creations of the intellect used in commerce:
 Inventions
 Literary and Artistic work
 Symbols
 Names Images and designs

Copyright laws protect intellectual property

Copyright

It is a legal concept, enacted by most governments giving creator of original work exclusive
rights to it, usually for a limited period.

Plagiarism
It is stealing someone’s intellectual work and representing it as your own work without citing
the source of information.
Copying someone’s work and then passing it off as one’s own
 Act of stealing
 Copying information and not giving the author credit for it
 Copying programs written by other programmers and claiming them as your own
 Involves lying, cheating, theft and dishonesty

Measure to avoid Plagiarism?


 Plagiarism is a bad practice and should be avoided by the following measures:
 Use your own words and ideas.
 Always provide reference or give credit to the source from where you have received your
information.
 You must give credit whenever you use
 Another person’s idea, opinion, or theory.
 Quotations of another person’s actual spoken or written words
 Paraphrase of another person’s spoken or written words.

Licensing:
Software Licensing is the legal right to run or the privilege gives to you by a company to access
their application or program or software.
For example:
When we purchase for proprietary software such as Windows OS, then we must have noticed
that it comes with a license agreement which is to be read first and to be agreed upon for the
successful installation and usage of the software.

License agreements typically allow the software to run on a limited number


of computers and allow copies to be made only for backup purpose.
Licenses provide rules and guidelines for others to use your work.

Advantages of using Licensed software

1. By using licensed software, you are able to contribute to the further development of the
program you are using.
2. It comes with the outright support not found in “pirated” software.

Free and open-source software


Free and open-source software (FOSS) is software that can be classified as both free
software and open-source software. That is, anyone is freely licensed to use, copy, study, and
change the software in any way, and the source code is openly shared so that people are
encouraged to voluntarily improve the design of the software. This is in contrast to proprietary
software, where the software is under restrictive copyright licensing and the source code is
usually hidden from the users.
Free software
Free Software Foundation (FSF), defines free software as a matter of liberty not price, and it
upholds the Four Essential Freedoms.

Four essential freedoms of Free Software

 The freedom to run the program as you wishes, for any purpose (freedom 0).
 The freedom to study how the program works and change it so it does your computing as you
wish (freedom 1). Access to the source code is a precondition for this.
 The freedom to redistribute copies so you can help others (freedom 2).
 The freedom to distribute copies of your modified versions to others (freedom 3). By doing this
you can give the whole community a chance to benefit from your changes. Access to the source
code is a precondition for this.

Open Source Software


Open-source software is computer software that is released under a license in which the
copyright holder grants users the rights to use, study, change, and distribute the software and its
source code to anyone and for any purpose. Open-source software may be developed in a
collaborative public manner.

Case Based MCQs on Societal Impacts

Q1. Aniruddha is studying the concepts of digital footprints. Help him to clarify the concepts of
digital footprints.

(i) Digital footprints are also known as _____________

a. Digital data
b. Plagiarism
c. Digital tattoos
d. Digital print

(ii) Digital footprints are stored ______________

a. Temporarily (for few days)


b. Permanently
c. for 7 days only
d. for 3 days

(iii) Whenever we surf the Internet using smartphones we leave a trail of data reflecting the
activities performed by us online, which is our ___________

a. Digital footprint
b. Digital activities
c. Online handprint
d. Internet activities

(iv) There are _________ kinds of Digital footprints.

a. 1
b. 2
c. 3
d. 4

(v) Which is the correct type(s) of digital footprint?


a. Active digital footprint
b. passive digital footprint
c. Both a and b
d. None
Answer:- (i)- (ii)- (iii)- (iv)- (v)-

Q2. Pragya is a student of class XII. She is learning about safe internet surfing. Help him to understand
the concepts of digital footprint.

(i) Our digital footprint can be created by _______

a. visiting any website


b. sending email
c. posting online
d. All of the above

(ii) Which of the following activity is an example of leaving Active digital footprints?

a. Surfing internet
b. Visiting a website
c. Sending an email to friend
d. None of the above

(iii) The digital data trail we leave online intentionally is called _____

a. Active digital footprints


b. Passive digital footprints
c. Current digital footprints
d. None of the above

(iv) The digital data trail we leave online unintentionally is called _____

a. Active digital footprints


b. Passive digital footprints
c. Current digital footprints
d. None of the above

(v) Which of the following is type of Digital Footprints?

a. Active digital footprints


b. Passive digital footprints
c. Both of the above
d. None of the above
Answer:- (i)- (ii)- (iii)- (iv)- (v)-
Q3. Shobhit is eager to know the best way to behave on internet. Help him to know the
concepts of net and communication etiquettes.

(i) Digital communication includes ________


a. Email
b. Texting
c. Instant messaging
d. All of the above

(ii) _______ is a person who deliberately sows discord on the Internet by starting quarrels or
upsetting people, by posting inflammatory or off topic messages in an online community.

a. Netizen
b. Digital Citizen
c. Internet troll
d. None of the above

(iii) Online posting of rumours, giving threats online, posting the victim’s personal information,
comments aimed to publicly ridicule a victim is termed as __________

a. Cyber bullying
b. Cyber crime
c. Cyber insult
d. All of the above

(iv) Being a responsible digital citizen, we should ______

a. not use copyrighted materials


b. avoid cyber bullying
c. respect privacy of others
d. All of the above

(v) Which of the following is Net Etiquette?

a. Be Ethical
b. Be Respectful
c. Be Responsible
d. All of the above
Answer:- (i)- (ii)- (iii)- (iv)- (v)-
Q4. Amit is studying about data protection. Help him to understand following concepts.
Intellectual Property.

(i) Intellectual Property is legally protected through ____

a. copyright
b. patent
c. registered trademark
d. All of the above

(ii) The ____________ include right to copy (reproduce) a work, right to distribute copies of the
work to the public, and right to publicly display or perform the work.

a. Copyright
b. Patent
c. Create right
d. None of the above

(iii) A ______________ provide an exclusive right to prevent others from using, selling, or
distributing the protected invention

a. copyright
b. trademark
c. patent
d. All of the above

(iv) The name and logo of the software will be protected by ___________

a. copyright
b. patent
c. registered trademark
d. None of the above

(v) Code of the software will be protected by _____________

a. copyright
b. patent
c. registered trademark
d. None of the above
Answer:- (i)- (ii)- (iii)- (iv)- (v)-
Q5. Ravi is studying about different types of licences given creative work, software etc. He is
also learning by free and open source software. Help him to clarify his doubts.

(i) A ____________ is a type of contract between the creators of an original work permitting
someone to use their work, generally for some price.

a. Agreement
b. License
c. Patent
d. Copyright

(ii) Presenting someone else’s idea or work as one’s own idea or work is called ________

a. Plagiarism
b. Copyright infringement
c. Patent infringement
d. None of the above

(iii) CC (in reference to public license) stands for _____

a. Creative Commons
b. Carbon copy
c. Creative Comments
d. Creative Culture

(iv) GPL is primarily designed for providing public license to a ______

a. software
b. websites
c. literature
d. music

(v) FOSS stands for __________

a. For open source software


b. Free and open set software
c. Free and open source software
d. None of the above

Answer:- (i)- (ii)- (iii)- (iv)- (v)-


Intellectual Property Rights

What is Intellectual Property (IP)?


It is a property which is scientific, innovatory invention created by a person or group of
persons using their own intellect for ultimate use in commerce and which is already not
available in the public domain.
Following are examples of intellectual property :-
These are an invention relating to a product or any process, a new design, a literary or
artistic work and a trademark (a word, a symbol and /or a logo etc.),
Intellectual property (IP) is a term referring to a brand, invention, design or other kind of
creation, which a person or business has legal rights over. Almost all businesses own some
form of IP, which could be a business asset. Common types of IP include: y Copyright –
this protects written or published works such as books, songs, films, web content and
artistic works; y Patents – this protects commercial inventions, for example, a new
business product or process; y Designs – this protects designs, such as drawings or
computer models; y Trademarks – this protects signs, symbols, logos, words or sounds
that distinguish your products and services from those of your competitors. IP can be
either registered or unregistered
It is intellectual property rights is privileges of ownership of any and all rights associated
with intangible assets owned by a person or company and protected against use without
consent or license amount paid. All proprietary, shareware nagware software and
branded computer hardware are categorized under IPR.
These are certain rights or privileges granted for the owner ship of scholarly, intelligent,
knowledgeable logical work is referred as Proprietary when it becomes Copyrighted or
Registered.
Proprietary is synonyms for Trademarked, Branded, Patented or private operated usually
for commercial purposes.
 Antonym of proprietary is Generic.
 Work like registered Domain names, Industrial designs, confidential information,
Inventions, Program and Database rights and literacy works of authorship or recorded
performances in physical or abstract forms.
Patents may refer to permission granted to privilege the exclusive legal ownership of the
work as mentioned above.

Plagiarisms
It is presenting someone else's work in form of words, views, ideas, images, sounds or
the creative expression and performance as your own work in following ways:-
i. Whether it is an ideas or either published or unpublished material;
ii. Whether in hard copy manuscript, design or softcopy or electronic form;
iii. Whether with or without consent of the actual owner:
iv. It can be done by incorporating it into your work without full
acknowledgement.
It is an offence under IT Act - The Patents Act, 1970; The Trade Marks Act, 1999

Licensing and Copyrights

Licensing is the process by which the creator agrees to allow a third-party to use that
work product for specific purposes for an agreed upon fee.

Copyright basically means the right to make copies. A copyright is a legal arrangement or
procedure that prevents a third party from using a creator's work.

There should be no copyright violation during uploading media like audio, video or
images and creating content we should not use any material created by others without
their consent.

We should always try to make our own content or some time use loyalty free media
having creative commons free license to reuse them.

In India Patents Act of 1970 came into implement and in 2003 as Patent Rules came into
force then after in 2016 Patent Amendment Rules set out the law concerning patents.

Case Study Multiple Choice Questions… Topic - Intellectual Property Rights


1. Divyata seeking username, password, OTP etc. of her parents is a theft of personal
information in order to commit fraud is known as:-
i. Cracking ii. Identity Theft iii. Stalking iv. Hacking
Correct Answer: - ii. Identity Theft
2. Intellectual Property Rights protect the use of information and ideas that are of:
i. Ethical values ii. Commercial values
iii. Moral values iv. None
Correct Answer: - ii. Commercial values
3. Astha asked her elder sister about the IPR. She understood it but you may help her to find
examples of the Intellectual property from the following ;-
i. Invention ii. Logo iii. Brand Name iv. All of these
Correct Answer: - iv. All of these
4. Ms. Shahiba did patent. Which is best suitable for Shahiba compulsory licences of patents
are granted in form of ……………………
i. Voluntary ii. Implied
iii. Virtual iv. Statutory
Correct Answer: - iv. Statutory
5. The following item is excluded from IPR:-
i. Industrial Design ii. Invention
iii. Logical Program iv. Data
Correct Answer: - iv. Data

Case Study Multiple Choice Questions… Topic - Plagiarisms


1. Stealing someone’s intellectual work and representing it as your own like copy and paste
information from a Website is known as ________________.

i. Bullying ii. Cyber Stalking


iii. Identity Theft iv. Plagiarism
Correct Answer: - iv. Plagiarism
2. Statement i. E-waste recycler always used the old PC storage to retrieve data.
Statement ii. E-waste old Storage device may lead to plagiarism.
i. Statement i. is true ii. is false. ii. Statement ii is true and i. is false
iii. Statements i and ii both are true iv. Statement i and ii both are false.
Correct Answer: - ii. Statement ii is true and i. is false
3. Rahim download the pirated software and which is of any fraudulent business practice that
extracts money from an ignorant person is called as _________________________.
i. Scam ii. Cyber Crime
iii. Fraud iv. All of these
Correct Answer: - iv. All of these
4. Ms. Anamika, student of class X, send project of her brother to the class teacher online.
Which type of act it is out of following cases –
Case - 1. Violation of Copy Right and
Case – 2. Plagiarism.
i. Only Case 1 is true ii. Only Case 2 is true
iii. Both are True iv. Both are False
Correct Answer: - ii. Only Case 2 is true
5. Class XII student Pawan is made a recovery disk of his licensed Single User Operating System
and install in his friends PC. Choose best option on basis of following –
Case 1. - He can install the software in his PC
Case 2. - He is authorised to install the second copy to his friend’s PC
i. Case 1. is True ii. Case 2. Is True
iii. Both i and ii are True iv. Both i and ii are False
Correct Answer: - i. Case 1. is True

Case Study Multiple Choice Questions Topic - Licensing and Copyrights

1. IT Amendment Act, 2008 come into force from the year


i. 2009 ii. 2010 iii. 2011 iv. 2012
Correct Answer:- i. 2009
2. Ankit made a ERP - Enterprise resource planning solution for a renowned university and
registered and Copyrights for the same. Which of the most important option; Ankit got the
copyrights.
i. To get society status ii. To get community welfare
iii. To get Fame iv. To secure finance protection
Correct Answer: - iv. To secure finance protection
3. Innovative, creative creations or designs of mind such as patents, trademarks and copyright
are ___________________ property.
i. Digital Property ii. Intellectual Property
iii. Both of these iv. None of these
Correct Answer: - iii. Both of these
4. John created 1. Send E Mail message and 2. You-Tube Channel that exists in digital form are
considered as digital property becomes copyright automatically
i. Only first is Copyright ii. Only second is Copyright
iii. Both are automatic copyright iv. None of These
Correct Answer:- iii. Both are automatic copyright
5. Students save money by installing pirated software in their PC. Which of following is true
i. Software Piracy ii. Violation of IPR
iii. Violation of Copy Right iv. All of these
Correct Answer: - iv. All of these

Digital Society and Netizen:


As our society is inclined towards using more and more digital technologies, we end up
managing most of our tasks digitally. In this era of digital society, our daily activities like
communication, social networking, banking, shopping, entertainment, education,
transportation, etc., are increasingly being driven by online transactions.
Digital society thus reflects the growing trend of using digital technologies in all spheres of
human
activities. But while online, all of us need to be aware of how to conduct ourselves, how best to
relate with others and what ethics, morals and values to maintain. Anyone who uses digital
technology along with Internet is a digital citizen or a netizen. Being a good netizen means
practicing safe, ethical and legal use of digital technology. A responsible netizen must abide by
net etiquettes, communication etiquettes and social media etiquettes.

Intellectual Property Right (IPR):


When someone owns a house or a motorcycle, we say that the person owns that property.
Similarly, if someone comes out with a new idea, this original idea is that person’s intellectual
property. Intellectual Property refers to the inventions, literary and artistic expressions, designs
and symbols, names and logos. The ownership of such concepts lies with the creator, or the
holder of the intellectual property. This enables the creator or copyright owner to earn
recognition or financial benefit by using their creation or invention.
Intellectual Property is legally protected through copyrights, patents, trademarks, etc.
Plagiarism:
With the availability of Internet, we can instantly copyor share text, pictures and videos.
Presenting someone else’s idea or work as one’s own idea or work is called
plagiarism. If we copy some contents from Internet, but do not mention the source or the
original creator, then it is considered as an act of plagiarism. Further, if someone derives an
idea or a product from an already existing idea or product, but instead presents it as a new
idea, then also it is plagiarism. It is a serious ethical offense and sometimes considered as an act
of fraud.
Even if we take contents that are open for public use, we should cite the author or source to
avoid plagiarism
Cyber Crime:
Criminal activities or offences carried out in a digital environment can be considered as cyber
crime. In such crimes, either the computer itself is the target or the computer is used as a tool
to commit a crime. Cyber crimes are carried out against either an individual, or a group, or an
organisation or even against a country, with the intent to directly or indirectly cause physical
harm, financial loss or mental harassment. A cyber criminal attacks a computer or a network to
reach other computers in order to disable or damage data or services.
Apart from this, a cyber criminal may spread viruses and other malwares in order to steal
private and confidential data for blackmailing and extortion. A computer virus is some lines of
malicious code that can copy itself and can have detrimental effect on the computers, by
destroying data or corrupting the system. Similarly, malware is a software designed to
specifically gain unauthorised access to computer systems. The nature of criminal activities are
alarmingly increasing day-by-day, with frequent reports of hacking, ransomware attacks, denial-
of-service, phishing, email fraud, banking fraud and identity theft.
Hacking:
Hacking is the act of unauthorised access to a computer, computer network or any digital
system. Hackers usually have technical expertise of the hardware and software.
They look for bugs to exploit and break into the system. Hacking, when done with a positive
intent, is called ethical hacking. Such ethical hackers are known aswhite hat hackers. They are
specialists in exploring any vulnerability or loophole by during testing of the software. Thus,
they help in improving the security of a software. An ethical hacker may exploit a website in
order to discover its security loopholes or vulnerabilities. He then reports his findings to the
website owner. Thus, ethical hacking is actually preparing the owner against any cyber attack.
Phishing and Fraud Emails:
Phishing is an unlawful activity where fake websites or emails that look original or authentic are
presented to the user to fraudulently collect sensitive and personal details, particularly
usernames, passwords, banking and credit card details. The most common phishing method is
through email spoofing where a fake or forged email address is used and the user presumes it
to be from an authentic source. So you might get an email from an address that looks similar to
your bank or educational institution, asking for your information,
Identity Theft:
Identity thieves increasingly use personal information stolen from computers or computer
networks, to commit fraud by using the data gained unlawfully. A user’s identifiable personal
data like demographic details, email ID, banking credentials, passport, PAN, Aadhaar number
and various such personal data are stolen and misused by the hacker on behalf of the victim.
This is one type of phishing attack where the intention is largely for monetary gain.
Indian Information Technology Act (IT Act):
With the growth of Internet, many cases of cyber crimes, frauds, cyber attacks and cyber bullying
are reported. The nature of fraudulent activities and crimes keeps changing. To deal with such
menaces, many countries have come up with legal measures for protection of sensitive personal
data and to safeguard the rights of Internet users. The Government of India’s The Information
Technology Act, 2000 (also known as IT Act), amended in 2008, provides guidelines to the user
on the processing, storage and transmission of sensitive information .

Question 1:Namita has recently shifted to new city and new school. She does not know many
people in her new city and school. But all of a student, someone is posting negative, demeaning
comments on her social networking profile, school site’s forum etc.
She is also getting repeated mails from unknown people. Every time she goes online, she finds
someone chasing her online.

a) What is this happening to Namita?


i. Namita has become a victim of cyber bullying and cyber stalking.
ii. Eaves dropping
iii. Scam
iv. Violation of IPR

b) What action should be taken by her to stop them?


i. Discuss with Parents
ii. Discuss in peer group
iii. Hide and get herself emotionally hurt
iv. She must immediately bring it to the notice of her parents and school
authorities.
And she must report this cybercrime to local police with the help of her
parents.

c)The act of fraudulently acquiring someone’s personal and private information, such as
online account names, login information and passwords is called as __________.
i. Phishing
ii. Fraud
iii. Scam
iv. Plagiarism

d) Namita needs to protect her personal information or data from unintentional and
intentional attacks and disclosure which is termed as ____________.
i.Digital right
ii. Copyright
iii. Privacy
iv. Intellectual property
e) A set of moral principles that governs the behaviour of a group or individual and
regulates the use of computers.
i.Copyright
ii.Computer ethics
iii.Property rights
iv.Privacy law

Solution:
a) i. Namita has become a victim of cyber bullying and cyber stalking.
b) iv. She must immediately bring it to the notice of her parents and
school authorities. And she must report this cybercrime to local police with
the help of her parents.
c) i. Phishing
d) iii. Privacy
e) ii. Computer Ethics
Question 2.
a) Ambika has been given a task of writing a poem for a reputed national magazine.
She surfs the internet and downloads a poem from another author. She then submits
it for the magazine as her work. What sort of crime has she committed?
i) Cyber bullying
ii) Plagiarism
iii) Phishing
iv) Pharming
b) I can keep you signed in. I can remember your site preferences. I can give you
locally relevant content. Who am I?
i) Cookies
ii) Trails
iii) History
iv) Ghost

c) A malicious individual or group of individuals who scam users by sending emails


or creating web pages that are designed to access an individual’s online bank
credit card, or other login information is called _____________.
i) Cyber bullying
ii) Phishing
iii) Cyber Trolling
iv) None of the above

. d) After practicals, Ambika left the computer laboratory but forgot to sign off from
her email account. Later, her classmate Revaan started using the same computer.
She is now logged in as Ambika. He sends inflammatory email messages to few of
his classmates using Ambika’s email account. Revaan’s activity is an example of
which of the following cyber crime? Justify your answer.
i) Hacking
ii) Identity theft
iii) Cyber bullying
iv) Plagiarism
e) Ambika found a crumpled paper under her desk. She picked it up and opened
it. It contained some text which was struck off thrice. But she could still figure out
easily that the struck off text was the email ID and password of Garvit, her
classmate. What is ethically correct for Ambika to do?
i) Inform Garvit so that he may change his password.
ii) Give the password of Garvit’s email ID to all other classmates.
iii) Use Garvit’s password to access his account.
iv) None of the above
Solution:
a) ii) Plagiarism
b) i) Cookies
c) ii) Phishing
d) ii) Identity theft
e) i) Inform Garvit so that he may change his password.

Question 3: a) Nitish received an email warning him of closure of his bank accounts if he
did not update his banking information as soon as possible. He clicked the
link in the email and entered his banking information. Next he got to know
that he was duped. This is an example of __________ .
i. Online Fraud
ii. Identity Theft
iii. Phishing

iv.Plagarism
b) Someone steals Nitish’s personal information to commit theft or fraud, it
is called ____________
i.Online Fraud
ii. Identity Theft

iii. Phishing
iv.Plagarism
c) Nitish is receiving Unsolicited commercial emails is known as …………..?
i.Spam
ii.Malware
iii.Virus
iv. Worms
d) Nitish’s Online personal account, personal website are the examples of?
i. Digital wallet
ii. Digital property

iii.Digital certificate
iv.Digital signature

e) Sending mean texts, posting false information about a person online, or


sharing embarrassing photos or videos to harass, threaten or humiliate a target
person, is called ____________.
i.Eavesdropping
ii.Cyberbullying
iii.Spamming
iv.Phishing
Solution:
a) iii.Phishing
b) ii.Identity theft
c) i.spam
d) ii.Digital Property
e) ii.Cyberbullying

Question 4: Identify the type of cybercrime for the following situations:


a) A person complains that Rs. 4.25 lacs have been fraudulently stolen from
his/her account online via some online transactions in two days using NET
BANKING.
i. Identity theft
ii. Bank Fraud
iii. Cyber theft
iv. Cyber Crime

b) A person complains that his/her debit/credit card is safe with him still
somebody has done shopping /ATM transaction on this card.
i. Identity theft
ii. Bank Fraud
iii. Cyber theft
iv. Cyber Crime
c) A person complains that somebody has created a fake profile of Facebook
and defaming his/her character with abusive comments and pictures.
i. Cyber bullying
ii. Cyber stalking
iii. Cyber theft
iv. Cyber Crime

d) Sending mean texts, posting false information about a person online, or


sharing embarrassing photos or videos to harass, threaten or humiliate a
target person, is called__________.
i. Identity theft
ii. Online Fraud
iii. Cyber theft
iv. Cyber Crime

e) To prevent unauthorized access to and / or from the network, a system known as


____________, can be implemented by hardware and / or software.
i.Cookies
ii.Firewall
iii.DoS
iv.Digilocker
Solution:

a) ii.Bank Fraud
b) i.Identity theft
c) ii.Cyber Stalking
d) ii.Online Fraud
e) ii.Firewall

Question 5: a) A trail of information that people leave online or using communication


devices is referred to as:
i) Digilocker
ii) Digital Remarks
iii) Digital Footprints
iv) Digital Traces
b) Which of these is not a cyber crime:
i) Cyber stalking
ii) Cyber trolling
iii) Copyright
iv) Cyber bullying

c) A mail or message sent to a large number of people indiscriminately


without their consent is called ______________.
i) Spam
ii) Cookies
iii)Adware
iv)Malware

d) To prevent unauthorized access to and / or from the network, a system


known as__________ , can be implemented by hardware and / or software.

i.Firewall
ii.antivirus
iii.Cookies.
iv.Text files

e) The practice of taking confidential information from you through and original
looking site and URL is known as _______________

i)Spamming
ii.Drafts
iii.Phishing
iv.Identity theft
Solution: a)iii.Digital Footprints
b)iii.Copyright
c)i.Spam
d)i.Firewall
e)iii.Phishing
ASSERTION AND REASONING BASED QUESTIONS
1. Assertion :( A) Intellectual Property Rights are the rights of the owner of information to
decide how much information is to be exchanged.
Reason: (R) The owner has the right to protect his/her intellectual property.

a) Both A and R are true and R is the correct explanation of A.


b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.
e) Both A and B are false.
Ans: a) Both A and R are true and R is the correct explanation of A.

2. Assertion: ( A) Phishing is the practice of attempting to acquire sensitive information from


individuals over the internet,by means of deception.
Reason: ( R) It is a criminal offense.
a) Both A and R are true and R is the correct explanation of A.
b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.
e) Both A and B are false.
Ans: a) Both A and R are true and R is the correct explanation of A.

3. Assertion:( A) Plagiarism is stealing someone else’s intellectual work and representing it


as
your own work.
Reason : (R) Using someone else’s work and giving credit to the author or creator.

a) Both A and R are true and R is the correct explanation of A.


b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.
e) Both A and B are false
Ans: c) A is true but R is false.

4. Assertion: ( A) Cyber stalking is a kind of Online harassment wherein the victim is


subjected to a barrage of online messages and emails.
Reason: (R) Stalkers keep on sending repeated e-mails asking for various kinds of favors
or threaten the victim.

a) Both A and R are true and R is the correct explanation of A.


b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.
e) Both A and B are false
Ans: a)Both A and R are true and R is the correct explanation of A.

5. Assertion: ( A) Scams committed over the Internet are called Online scams.
Reason:( R) It is a fraudulent business practice that extracts money from an
unsuspecting,ignorant person called a Scam.

a) Both A and R are true and R is the correct explanation of A.


b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.
e) Both A and B are false
Ans: a)Both A and R are true and R is the correct explanation of A.
E-waste broadly covers waste from all electronic and electrical appliances and comprises of
items such as computers, mobile phones, digital music recorders/players, refrigerators,
washing machines, televisions (TVs) and many other household consumer items.

E-Waste Hazards
 Mostly all electronic waste comprises of toxic chemicalssuch as lead, beryllium,
mercury etc.

 Improper disposing of gadgets and devices increases the amount of these toxic
chemicals thus contaminated the soil, causing air and water pollution.
 The contaminated water which is highly polluted it thusmaking it harmful for drinking
purposes.
 Improper e-waste recycling, such as by open burning and acid baths creates hazardous
and toxic compounds like- dioxins, furans and acids.

 Damage to the immune system

 Skin disease.

 Multi ailments.

 Skin problems

E-Waste Management

E-waste management requires proper recycling and recovery of the disposed material.
The recycling and recovery process includes following steps-

1. Dismantling:- removal of parts containing valuable items such as- copper, silver,
gold, steel and removalof parts containing dangerous substance like- mercury, lead,
Beryllium etc.

2. Separation metal and plastic

3. Refurbishment and reuse: it means used electrical and electronic items that can be
easily remodel to make it’s to reuse.

4. Recovery of valuable materials


5. Disposal of dangerous materials like- mercury, lead, Beryllium etc and disposed off
in underground landfill sites.

Awareness about health concerns related to the use of Technology


Today, computer technologies provide people with many benefits, educational activities
can be designed, online shopping is available, it is possible to get in touch with people
overseas and to chat with them. It is possible to search for anything and sometimes. It
is even possible to do one’s job at home without going to his or her office. If these
technologies, which dominate our lives more each passing day, are not used carefully.

Then it is inevitable for people to end up with certain illnesses like-

1. Neck strain

2. Vision Problem

3. Sense of isolation

4. Sleeping disorder

5. Stress

6. Loss of attention
7. Problem in social relationships of individuals.
8. Computer anxiety
9. Internet addiction etc.

In order to avoid these problems-

 One should learn how to use these technologies without experiencing any
problem rather than avoiding using them.
 Some of the users of computer technologies are not even aware of their health-
related problems that they have.

CASE STUDY BASED QUESTIONS

Q1: Nisha’s computer and smartphone is not working properly, computer expert told her that
now it won’t repair so she is in dilemma where to dispose these electronic items now help Nisha
to understand the concept of e waste management & help Nisha to answer these questions.
1. E-waste stands for ______
a. Electrical waste
b. Electronic waste
c. Electricity waste
d. E-waste

Answer
Ans. b. Electronic waste

2. Which of the following constitute e-waste?

a. discarded computers
b. damaged printers
c. useless CDs
d. All of the above

Answer
Ans. d. All of the above

3 What is hazardous pollutant released from mobile phone ?


a. Lithium
b. Barium
c. Lead
d. Copper

Answer
a. Lithium

4. When can we classify waste as hazardous ?


a. When waste cause any mortality
b.When waste increase mortality.
c. when waste decrease mortality
d. When waste decompose itself without any aid

Answer
b. When waste increase mortality

5. Nisha’s PC is no longer functional .How would you suggest to dispose of this PC.

a. Give electronic to certified E waste Cycler


b. Give to scrape dealer
c. Scavenge usable part from the e waste
d. Throw in Dustbin
Answer
a. Give electronic to certified E waste Cycler
c. Scavenge usable part from the e waste

Q2 Jatin UPS is no longer functional. What issue can de caused if we throw the UPS without
following proper e waste management protocols, help jatin to follow the proper protocol.

1. What happen if we throw acid batteries in empty landfills? What kind of pollution it can
cause.
a. Can cause Soil and water pollution
b. It will harm environment
c. Can cause Noise and Air pollution
d. It will not harm environment

Answer

a. Can cause Soil and water pollution


b. It will harm environment

2. Where we can get a radioactive wastes?

a. Small scale Industries


b. Houses
c. Nuclear power plant
d. Vehicular waste
Answer
a. Nuclear Power Plant

3. e-waste is responsible for the degradation of our environment.(T/F)

a. True
b. False

Answer
a. True

4. e-waste is very healthy for human being.(T/F)

a. True
b. False

Answer
b. False
5. e-waste is responsible for air, water and land pollution.(T/F)

a. True
b. False

Answer
a. True

Q3. Radhika attended the lecture on E waste management now her friends call her asking
question help radhika to answer the questions.

1. Which of the following are feasible methods of e-waste management?

a. Reduce
b. Reuse
c. Recycle
d. All of the above

Answer
d. All of the above

2. The process of re-selling old electronic goods at lower prices is called ____
a. refurbishing
b. recycle
c. reuse
d. reduce

Answer
a. refurbishing

3. What are the things that we should not do while disposing e waste .
a. We should not dump them
b. We should not burn them
c. All of above

Answer
c. All of the above
4. What are the items that fall under e waste .
a. Mobile phones
b. Acid Batteries
c. All of above
d. None of these

Answer
A,b

5. What do with E Waste ?


a. Give your electronic to _________________recycler.
b. ____________your outdate technology.

i. Certified E Waste , Donate


ii. Ewaste ,throw
iii. Certified E Waste , Throw
iv. E Waste ,Donate

Answer
Ans. i. Certified E Waste , Donate.
CONTENT DEVELOPMENT TEAM

SNo. Name of the Name of Content developed


Teacher the KV
1 Mr. Tarachand Talbhet Introduction of Python libraries – Pandas, Matplotlib
Meena

2 Mr. J P Joshi No 1 Data Structures in Pandas- Series


Jhansi
3 Mr. Santosh Lalitpur Data Structures in Pandas- DataFrames
Kumar Nema
4 Mr. Himanshu No 1 AFS Data Visualization
Agra
5 Mr. Deepak Kr No 2 Agra Societal Impacts - Digital Footprint, net and
Sharma Cantt communication etiquettes, Data protection, Free and
Open source software
6 Mr. Pawan Kr MRN Societal Impacts - Intellectual property rights ,
Dixit Mathura Plagiarism, licensing and copyright
7 Ms. Reetu Randev Noida Societal Impacts-Hacking, phishing cyber bullying
Shift I Cybercrime and cyber laws, Overview of IT Act
8 Ms. Rachna Noida Societal Impacts – E waste: hazard and management.
Katiyar Shift II Awareness about health concerns related to usage of
technology

Content Compilation by:


Meetu Singhal
PGT (Computer Science)
KV NO 3 Agra

You might also like