IpNotes
IpNotes
Data Visualization
Purpose of plotting; drawing and saving following types of plots using Matplotlib
– line plot, bar graph, histogram
Text functions: UCASE ()/UPPER (), LCASE ()/LOWER (), MID ()/SUBSTRING
()/SUBSTR (), LENGTH (), LEFT (), RIGHT (), INSTR (), LTRIM (), RTRIM (), TRIM ().
Date Functions: NOW (), DATE (), MONTH (), MONTHNAME (), YEAR (), DAY (),
DAYNAME ().
Aggregate Functions: MAX (), MIN (), AVG (), SUM (), COUNT (); using COUNT (*).
Querying and manipulating data using Group by, Having, Order by.
Introduction to Internet, URL, WWW, and its applications- Web, email, Chat, VoIP.
Web Browsers: Introduction, commonly used browsers, browser settings, add-ons and
plug-ins, cookies.
Unit 4: Societal Impacts (10)
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.
Unit-1
1) SEQUENCE
2) NDARRAY
3) DICTIONARY
4) SCALER VALUES
import numpy as np
import pandas as pd
s1=pd.Series([4,6,8,10])
print(s1)
0 4
1 6
2 8
3 10
dtype: int64
s2=pd.Series(["i","am","a","girl"])
print(s2)
0 i
1 am
2 a
3 girl
dtype: object
CREATING A SERIES USING A WORD
s3=pd.Series("hello")
print(s3)
0 hello
dtype: object
print(np1)
[ 3. 6.5 10. ]
s4=pd.Series(np1)
print(s4)
0 3.0
1 6.5
2 10.0
dtype: float64
s5=pd.Series(np.linspace(24,60,6))
print(s5)
0 24.0
1 31.2
2 38.4
3 45.6
4 52.8
5 60.0
dtype: float64
CREATING A SERIES HAVING REPETED VALUES N NO NUMBER OF
TIMES USING TILE FUNCTION
s6=pd.Series(np.tile([3,5],2))
print(s6)
0 3
1 5
2 3
3 5
dtype: int64
s7=pd.Series({'jan':31,'feb':28})
print(s7)
jan 31
feb 28
dtype: int64
s8=pd.Series(15,index=['a','b','c'])
print(s8)
a 15
b 15
c 15
dtype: int64
s9=pd.Series("hello",index=['a','b','c'])
print(s9)
a hello
b hello
c hello
dtype: object
print(s10)
a welcome
b welcome
c welcome
dtype: object
a=[30,29,38]
b=["j","k","l"]
s11=pd.Series(index=a,data=b)
print(s11)
30 j
29 k
38 l
dtype: object
b1=["j","k","l","m","n","o"]
a=[30,29,38]
s12=pd.Series(index=b1,data=a*2)
print(s12)
j 30
k 29
l 38
m 30
n 29
o 38
dtype: int64
CREATING A SERIES USING DATA WITH THE HELP OF ARANGE FUNCTION AND
SPECIFY THE INDEX AS WELL
a=np.arange(9,12)
b=["j","k","l"]
s13=pd.Series(index=a,data=b)
print(s13)
9 j
10 k
11 l
dtype: object
SERIES ATTRIBUTES
a=np.arange(9,12)
b=["j","k","l"]
s13=pd.Series(index=a,data=b)
print(s13)
9 j
10 k
11 l
dtype: object
print(s13.index)
Int64Index([9, 10, 11], dtype='int64')
print(s13.values)
['j' 'k' 'l']
TO GET THE DATATYEP OF SERIES
print(s13.dtype)
object
print(s13.shape)
(3,)
print(s13.nbytes)
24
print(s13.size)
3
print(s13.empty)
False
s14=pd.Series([6.5,np.NaN,2.34])
print(s14)
0 6.50
1 NaN
2 2.34
dtype: float64
WORKING/ PERFORMING OPERATIONS WITH SERIES
s14=pd.Series([6.5,np.NaN,2.34])
print(s14)
0 6.50
1 NaN
2 2.34
dtype: float64
print(s14[0])
6.5
print(s14[0:2])
0 6.5
1 NaN
dtype: float64
print(s14[0:3])
0 6.50
1 NaN
2 2.34
dtype: float64
print(s14[0::2])
0 6.50
2 2.34
dtype: float64
print(s14[: :-1])
2 2.34
1 NaN
0 6.50
dtype: float64
s14[1]=50
print(s14)
0 6.50
1 50.00
2 2.34
dtype: float64
s14.index=['a','b','c']
print(s14)
a 6.50
b 50.00
c 2.34
dtype: float64
s14[1:]=0
print(s14)
a 6.5
b 0.0
c 0.0
dtype: float64
print(s14.head(2))
a 6.5
b 0.0
dtype: float64
print(s14.head())
a 6.5
b 0.0
c 0.0
dtype: float64
print(s14.tail(2))
b 0.0
c 0.0
dtype: float64
print(s14)
a 6.5
b 0.0
c 0.0
dtype: float64
CHECK WHETHER ALL THE ELEMENTS OF A SERIES ARE GREATER THAN 5 OR NOT
print(s14>5)
a True
b False
c False
dtype: bool
print(s14[s14>5])
a 6.5
dtype: float64
s14[1]=20
print(s14)
a 6.5
b 20.0
c 0.0
dtype: float64
s14[2]=3
print(s14)
a 6.5
b 20.0
c 3.0
dtype: float64
a=[30,29,38]
b=["j","k","l"]
s11=pd.Series(index=b,data=a)
print(s11)
j 30
k 29
l 38
dtype: object
print(s11+2)
j 32
k 31
l 40
dtype: object
print(s11-2)
print(s11*2)
print(s11/2)
print(s14.sort_values())
c 3.0
a 6.5
b 20.0
dtype: float64
print(s14.sort_values(ascending=False))
b 20.0
a 6.5
c 3.0
dtype: float64
print(s14.sort_index(ascending=False))
c 3.0
b 20.0
a 6.5
dtype: float64
import pandas as pd
x2={'yrs1':{'q1':1000,'q2':2000,'q3':3000},'yrs2':{'q1':1500,'q2':1800,'q3':2300}}
df1=pd.DataFrame(x2)
print(df1)
print("\n")
x5={'yrs1':1000,'yrs2':1500}
x6={'yrs1':2000,'yrs2':1800}
x7={'yrs1':3000,'yrs2':2300}
lst2=[x5,x6,x7]
df3=pd.DataFrame(lst2,index=['q1','q2','q3'])
print(df3)
print("\n")
x3={'q1':1000,'q2':1500,'q3':1800}
x4={'q1':1200,'q2':1800,'q3':2000}
lst1=[x3,x4]
df2=pd.DataFrame(lst1)
print(df2)
q1 q2 q3
0 1000 1500 1800
1 1200 1800 2000
dict1={'yrs1':1500,'yrs2':1200}
dict2={'yrs1':800,'yrs4':500}
dict3={'i':dict1,'ii':dict2}
df4=pd.DataFrame(dict3)
print(df4)
i ii
yrs1 1500.0 800.0
print("\n")
x5={'name':['nidhi','kavita','sarita'],'section':['a','b','c']}
df4=pd.DataFrame(x5)
print(df4)
print("\n")
lst1=[[2,3],[3,4],[5,6]]
df7=pd.DataFrame(lst1,index=['row1','row2','row3'])
print(df7)
0 1
row1 2 3
row2 3 4
row3 5 6
print("creating a dataframe from a 2 D dict having values as list and given the
index as per user requirement")
x5={'name':['nidhi','kavita','sarita'],'section':['a','b','c']}
df5=pd.DataFrame(x5,index=[1001,1002,1003])
print(df5)
print("\n")
lst6=[[1,2],[3,4],[5,6]]
df6=pd.DataFrame(lst6)
print(df6)
print("\n")
creating a dataframe from a 2 D list
0 1
0 1 2
1 3 4
2 5 6
print("\n")
s1=pd.Series([10,20,30])
s2=pd.Series([30,60,70])
x8={'yrs1':s1,'yrs2':s2}
df7=pd.DataFrame(x8)
print(df7)
print("\n")
s1=pd.Series([10,20,30])
s2=pd.Series([14,15,16])
df10=pd.DataFrame(df9)
print(df10)
section 1 section 2
0 10 14
1 20 15
2 30 16
DATAFRAME ATTRIBUTES
import pandas as pd
lst1=[1500,1800,1200]
lst2=[1000,2000,3000]
lst3=[lst1,lst2]
df1=pd.DataFrame(lst3,columns=['yrs1','yrs2','yrs3'],index=['half','annual'])
print(df1)
yrs1 yrs2 yrs3
half 1500 1800 1200
annual 1000 2000 3000
print('\n')
print('indexs are')
print(df1.index)
indexs are
Index(['half', 'annual'], dtype='object')
print('\n')
print('columns are')
print(df1.columns)
columns are
Index(['yrs1', 'yrs2', 'yrs3'], dtype='object')
print('\n')
print('axes are')
print(df1.axes)
axes are
[Index(['half', 'annual'], dtype='object'),
Index(['yrs1', 'yrs2', 'yrs3'], dtype='object')]
print('\n')
print('datatypes are')
print(df1.dtypes)
datatypes are
yrs1 int64
yrs2 int64
yrs3 int64
dtype: object
print('\n')
print(len(df1))
length is= no of rows
2
print('\n')
print(df1.count())
print('\n')
print(df1.count(1))
count non nan values for each row
half 3
annual 3
dtype: int64
print('\n')
print('cols become rows and rows becomes cols')
print(df1.T)
cols become rows and rows becomes cols
half annual
yrs1 1500 1000
yrs2 1800 2000
yrs3 1200 3000
print('\n')
print(df1.yrs1)
print(df1['yrs1'])
print('\n')
print(df1[['yrs1','yrs2']])
print('\n')
print(df1.loc['half',:])
retrieve a particular row
yrs1 1500
yrs2 1800
yrs3 1200
Name: half, dtype: int64
print('\n')
print(df1.loc['half':'annual',:])
print('\n')
print(df1)
yrs1 yrs2 yrs3
half 1500 1800 1200
annual 1000 2000 3000
print('\n')
print(df1.loc[:,'yrs1':'yrs2'])
import pandas as pd
lst1=[1500,1800,1200]
lst2=[1000,2000,3000]
lst3=[lst1,lst2]
df1=pd.DataFrame(lst3,columns=['yrs1','yrs2','yrs3'],index=['half','annual'])
print(df1)
print('\n')
import pandas as pd
dict1={'Name':['somya','dharana','ishika'],'RollNo.':[20,25,30],'Section':['x','y','z']}
df1=pd.DataFrame(dict1,index=["qtr1","qtr2","atr3"])
print(df1)
qtr1 somya 20 x
qtr2 dharana 25 y
atr3 ishika 30 z
print(df1.Section)
qtr1 x
qtr2 y
atr3 z
print("\n")
print(df1[['Section','Name']])
Section Name
qtr1 x somya
qtr2 y dharana
atr3 z ishika
print(df1.loc["qtr1"])
print("\n")
Name somya
RollNo. 20
Section x
print(df1.loc["qtr1":"atr3",:])
print("\n")
qtr1 somya 20 x
qtr2 dharana 25 y
atr3 ishika 30 z
print(df1.loc["qtr1":"atr3"])
print("\n")
qtr1 somya 20 x
qtr2 dharana 25 y
atr3 ishika 30 z
retrieve all rows and all the specific columns as starting and ending column
print(df1.loc[:,"Name":"RollNo."])
print("\n")
Name RollNo.
qtr1 somya 20
qtr2 dharana 25
atr3 ishika 30
print(df1.loc["qtr1":"atr3","Name":"RollNo."])
print("\n")
Name RollNo.
qtr1 somya 20
qtr2 dharana 25
atr3 ishika 30
print(df1.iloc[0:2,1:3])
print("\n")
RollNo. Section
qtr1 20 x
qtr2 25 y
print(df1[0:2])
print("\n")
qtr1 somya 20 x
qtr2 dharana 25 y
print("\n")
ishika
print(df1.Name[1])
print("\n")
dharana
print(df1.at['atr3','Name'])
print("\n")
ishika
df1[df1[‘rollno’]==df1[‘rollno].max()]
print(df1[‘rollno].max())
print(df1[df[‘rollno’]>20])
retrieve the value of a particular cell using index (row and column)
print(df1.iat[2,2])
print("\n")
z
changing the value in a dataframe
df1['Name']="nidhi"
print(df1)
qtr1 nidhi 20 x
qtr2 nidhi 25 y
atr3 nidhi 30 z
print("\n")
df1["Name"]=["nidhi","kavita","sarita"]
print(df1)
print("\n")
qtr1 nidhi 20 x
qtr2 kavita 25 y
atr3 sarita 30 z
df1.loc[:,"Name"]=["ni","ki","sa"]
print(df1)
print("\n")
qtr2 ki 25 y
atr3 sa 30 z
df1.loc['qtr1',:]=[1,2,3]
print(df1)
print("\n")
qtr1 1 2 3
qtr2 ki 25 y
atr3 sa 30 z
df1.loc['qtr1','Section']=0
print(df1)
print("\n")
qtr1 1 2 0
qtr2 ki 25 y
atr3 sa 30 z
print("\n")
del df1['Section']
print(df1)
print("\n")
Name RollNo.
qtr1 1 2
qtr2 ki 25
atr3 sa 30
df2=df1.drop(['Name'],axis=1)
print(df2)
print("\n")
RollNo.
qtr1 2
qtr2 25
atr3 30
df2=df1.drop(['atr3'])
print(df2)
print("\n")
Name RollNo.
qtr1 1 2
qtr2 ki 25
df3=df2.rename(index={'qtr2':"full"})
print(df3)
Name RollNo.
qtr1 1 2
full ki 25
df2.rename(index={'qtr1':"name"},inplace=True)
print(df2)
Name RollNo.
name 1 2
qtr2 ki 25
print(row)
print(rowseries)
print('\n')
half
yrs1 1500
yrs2 1800
yrs3 1200
Name: half, dtype: int64
annual
yrs1 1000
yrs2 2000
yrs3 3000
Name: annual, dtype: int64
print(col)
print(colseries)
print('\n')
yrs1
half 1500
annual 1000
Name: yrs1, dtype: int64
yrs2
half 1800
annual 2000
Name: yrs2, dtype: int64
yrs3
half 1200
annual 3000
Name: yrs3, dtype: int64
lst1=[1500,1800,1200,1]
lst2=[1000,2000,3000,2]
lst3=[lst1,lst2]
df2=pd.DataFrame(lst3,columns=['yrs1','yrs2','yrs3','yrs4'],index=['half','annual'])
print('\n')
print(df1)
print('dataframe df2 is')
print(df2)
print('\n')
print(df1+df2)
dataframe df2 is
yrs1 yrs2 yrs3 yrs4
half 1500 1800 1200 1
annual 1000 2000 3000 2
lst1=[1500,1800,1200,1]
lst2=[1000,2000,3000,2]
lst3=[1,2,3,4]
lst4=[lst1,lst2,lst3]
df3=pd.DataFrame(lst4,columns=['yrs1','yrs2','yrs3','yrs4'],index=['half','annual','p
re'])
print('\n')
print(df1)
print('\n')
print(df1+df3)
dataframe df2 is
yrs1 yrs2 yrs3 yrs4
half 1500 1800 1200 1
annual 1000 2000 3000 2
pre 1 2 3 4
lst1=[1500,1800,1200,1]
lst2=[1000,2000,3000,2]
lst3=[1,2,3,4]
lst4=[lst1,lst2,lst3]
df3=pd.DataFrame(lst4,columns=['yrs1','yrs2','yrs3','yrs4'],index=['half','annual','p
re'])
print('\n')
print(df1)
print('dataframe df2 is')
print(df3)
print('\n')
print(df1.add(df3))
print('\n')
lst1=[1500,1800,1200,1]
lst2=[1000,2000,3000,2]
lst3=[1,2,3,4]
lst4=[lst1,lst2,lst3]
df3=pd.DataFrame(lst4,columns=['yrs1','yrs2','yrs3','yrs4'],index=['half','annual','p
re'])
print('\n')
print(df1)
print(df3)
print('\n')
print(df1.radd(df3))
print(df1-df2)
print(df1.sub(df2))
print(df1.rsub(df2))
same way we can do subtaction, multiplication and
division
yrs1 yrs2 yrs3 yrs4
half 0 0 0 NaN
annual 0 0 0 NaN
yrs1 yrs2 yrs3 yrs4
half 0 0 0 NaN
annual 0 0 0 NaN
yrs1 yrs2 yrs3 yrs4
half 0 0 0 NaN
annual 0 0 0 NaN
print('\n')
print(df1)
print("\n")
print(df1.mean())
dataframe df1 is
yrs1 yrs2 yrs3
half 1500 1800 1200
annual 1000 2000 3000
print(df1)
print("\n")
print(df1.mean(1))
dataframe df1 is
yrs1 yrs2 yrs3
half 1500 1800 1200
annual 1000 2000 3000
print('\n')
print(df1)
print("\n")
print(df1.mean(axis=1))
dataframe df1 is
yrs1 yrs2 yrs3
half 1500 1800 1200
annual 1000 2000 3000
lst1=[1000,1500,1200]
lst2=[1000,1500,1200]
lst3=[lst1,lst2]
df1=pd.DataFrame(lst3,columns=['yrs1','yrs2','yrs3'],index=['half','annual'])
print(df1)
print(df1)
print("\n")
print(df1.mode())
dataframe df1 is
yrs1 yrs2 yrs3
half 1000 1500 1200
annual 1000 1500 1200
print('\n')
lst1=[1000,1500,1200]
lst2=[1000,1800,1200]
lst3=[lst1,lst2]
df1=pd.DataFrame(lst3,columns=['yrs1','yrs2','yrs3'],index=['half','annual'])
print(df1)
print(df1)
print("\n")
print(df1.mode())
dataframe df1 is
yrs1 yrs2 yrs3
half 1000 1500 1200
annual 1000 1800 1200
print('\n')
print(df1)
print('\n')
print(df1.median())
print the medium value column wise
yrs1 1000.0
yrs2 1650.0
yrs3 1200.0
dtype: float64
print('\n')
print(df1)
print('\n')
print(df1.median(1))
print('\n')
print(df1)
print('\n')
print(df1.sum())
print(df1.sum(1))
print(df1.count())
print(df1.count(1))
half 3700
annual 4000
dtype: int64
yrs1 2
yrs2 2
yrs3 2
dtype: int64
half 3
annual 3
dtype: int64
import matplotlib.pyplot as pl
import numpy as np
a=[1,2,3,4]
b=[10,20,30,40]
pl.plot(a,b)
pl.show()
import matplotlib.pyplot as pl
import numpy as np
a=[1,2,3,4]
b=[10,20,30,40]
pl.plot(a,b,'r',linestyle='dashed',linewidth=5,marker='+',markeredgecolor='green',
markersize=10)
pl.xlabel('rollno')
pl.ylabel('marks')
pl.grid(True)
pl.title('class xii')
pl.show()
import matplotlib.pyplot as pl
import numpy as np
a=[1,2,3,4]
b=[10,20,30,40]
pl.bar(a,b)
pl.xlabel('rollno')
pl.ylabel('marks')
pl.grid(True)
pl.title('class xii')
pl.show()
import matplotlib.pyplot as pl
import numpy as np
a=[1,2,3,4]
b=[10,20,30,40]
pl.bar(a,b,color=['red','green','blue','black'],width=[0.5,1.0,1.0,0.5])
pl.xlabel('rollno')
pl.ylabel('marks')
pl.grid(True)
pl.title('class xii')
pl.show()
import matplotlib.pyplot as pl
import numpy as np
a=[1,2,3,4]
b=[10,20,30,40]
c=[5,8,4,5]
pl.bar(a,b)
pl.bar(a,c)
pl.xlabel('rollno')
pl.ylabel('marks')
pl.grid(True)
pl.title('class xii')
pl.show()
import matplotlib.pyplot as pl
import numpy as np
a=np.arange(4)
b=[10,20,30,40]
c=[5,8,4,5]
pl.bar(a+0.00,b,width=0.25)
pl.bar(a+0.25,c,width=0.25)
pl.xlabel('rollno')
pl.ylabel('marks')
pl.grid(True)
pl.title('class xii')
pl.show()
import matplotlib.pyplot as pl
import numpy as np
a=np.arange(4)
b=[10,20,30,40]
c=[5,8,4,5]
pl.bar(a+0.00,b,width=0.25,label='weekly1')
pl.bar(a+0.25,c,width=0.25,label='weekly2')
pl.xlabel('rollno')
pl.ylabel('marks')
pl.grid(True)
pl.title('class xii')
pl.legend()
pl.show()
Pandas:
• It is a package useful for data analysis and manipulation.
• Pandas provide an easy way to create, manipulate and wrangle the data.
• Pandas provide powerful and easy-to-use data structures, as well as the means to quickly perform
operations on these structures.
2. Data Frame
3. Panel
Series-
Series is a one-dimensional array like structure with homogeneous data, which can be used to handle
and manipulate data. It has two parts
✓ We can say that Series is a labeled one-dimensional array which can hold any type of data.
✓ But the size of Data of Series is always immutable, means it cannot be changed.
DATAFRAME-
It is a two-dimensional object that is useful in representing data in the form of rows and columns.
Once we store the data into the Dataframe, we can perform various operations that are useful in
analyzing and understanding the data.
1. A Dataframe has axes (indices)- ➢ Row index (axis=0) ➢ Column index (axes=1)
2. It is similar to a spreadsheet , whose row index is called index and column index is called column
name.
1. Series
2. Lists
3. Dictionary
4. A numpy 2D array
SERIES DATAFRAEME
1 DIMENSIONAL 2 DIMENSIONAL
ALL THE ELEMENTS MUST BE OF SAME DATA TYPE DATAFRAME OBJECTS CAN HAVE ELEMENTS OF
DIFFERENT DATATYEPE
NUMPY SERIES
IN NUMPY ARITHEMATIC OPERARTIONS ARE PERFORMED IN SERIES WE CAN PERFORM
IN NDARRARY INDEXES ARE ALWAYS NUMERIC IN SERIES WE CAN SPECIFY THE INDEX
AS PER OUR REQUIREMENT
Pyplot is a collection of methods within MATPLOT library (of Python) which allows user to
construct 2D plots easily and interactively
Line chart;-
Histogram:-
Bar chart;-
Sign()
Sqrt()
Select char(65); A
Select char(65.3) A
Select char(65,66); AB
Select char(97); a
OR
OR
Select length(ltrim(‘ nidhi‘)); 5(first ltrim will remove the left spaces and
then length will be counted)
Select length(rtrim(‘nidhi ‘)); 5(first rtrim will remove the right spaces
and then length will be counted)
Select length(trim(‘ nidhi ‘)); 5(first trim will remove the left and right
spaces and then length will be counted)
Select mod(3,2) 9
Select sqrt(16) 4
Select sign(13) 1
Select sign(-13) -1
Select sign(0) 0
Select pow(3,2) 9
Select power(3,2) 9
Select round(13.567) 14
Select round(13.223) 13
Select round(13.74,-1) 10
Select round(13.74,-2) 0
Select round(13.74,-3) 0
Select truncate(16.81,-1) 10
Select day(“2022-04-09”); 09
Select dayofmonth(“2022-04-09”); 09
Select dayofweek(“2022-04-09”); 02
Select dayofyear(“2022-04-09”); 99
Emp
X 1000 ganaur
Y - ganaur
Z 1200 sonipat
1100
1100
Select count(sal) from emp 2(no of salaries entered, nul will not be
counted)
Emp1
X 1000 accounts
Y 2000 accounts
Z 3000 sales
M 4000 marketing
3000
4000
3000 3000
4000 4000
Sales 3000
Marketing 4000
Sales 1
Marketing 1
Significance of group by
The group by clause combines all those records that have identical values in a
particular field or a group of fields. This grouping results into one summary record
per group if group functions are used with it.
The difference between where and having clause is that where conditions are
applicable on individual rows whereas having conditions are applicable on groups
as formed by group by clause.
1) After practicals, Atharv left the computer laboratory but forgot to sign off from his
email account. Later, his classmate Revaan started using the same computer.
He is now logged in as Atharv. He sends inflammatory email messages to few of
his classmates using Atharv’s email account. Revaan’s activity is an example of
which of the following cyber crime? Justify your answer.
a. Hacking
b. Identity theft – As he used someone’s account and sent inflammatory
email messages.
c. Cyber bullying
d. Plagiarism
2) Rishika 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 Rishika to do?
3) Suhana is down with fever. So, she decided not to go to school tomorrow. Next
day, in the evening she called up her classmate, Shaurya and enquired about the
computer class. She also requested him to explain the concept. Shaurya said,
“Mam taught us how to use tuples in python”. Further, he generously said, “Give
me some time, I will email you the material which will help you to understand
tuples in python”. Shaurya quickly downloaded a 2-minute clip from the Internet
explaining the concept of tuples in python. Using video editor, he added the text
“Prepared by Shaurya” in the downloaded video clip. Then, he emailed the
modified video clip to Suhana. This act of Shaurya is an example of —
o Fair use
o Hacking
o Copyright infringement
o Cybercrime
4) After a fight with your friend, you did the following activities. Which of these
activities is not an example of cyberbullying?
6) You got the below shown SMS from your bank querying a recent transaction.
Answer the following —
a) Will you SMS your pin number to the given contact number? – No, we should not
provide any confidential information like pin number or password to anyone.
b) Will you call the bank helpline number to recheck the validity of the SMS received? –
If it is required then otherwise ints not neccasary.
7) Preeti celebrated her birthday with her family. She was excited to share the
moments with her friend Himanshu. She uploaded selected images of her birthday
party on a social networking site so that Himanshu can see them. After few days,
Preeti had a fight with Himanshu. Next morning, she deleted her birthday
photographs from that social networking site, so that Himanshu cannot access
them. Later in the evening, to her surprise, she saw that one of the images which
she had already deleted from the social networking site was available with their
common friend Gayatri. She hurriedly enquired Gayatri “Where did you get this
picture from?”. Gayatri replied “Himanshu forwarded this image few minutes
back”.
Help Preeti to get answers for the following questions. Give justification for your
answers so that Preeti can understand it clearly.
a) How could Himanshu access an image which I had already deleted? – When you
perform any transaction on the internet it leaves a digital footprint. There few
websites and resources that can be access to get the deleted items.
b) Can anybody else also access these deleted images? Yes, all marked friends and
tagged individuals can see them.
c) Had these images not been deleted from my digital footprint? There are certain
data which remain in digital footprint even files are deleted, cannot be deleted from
my digital footprint.
8) The school offers wireless facility (wifi) to the Computer Science students of Class XI.
For communication, registered URL schoolwifi.edu. On 17 September 2017, the
following email was mass distributed to all the Computer Science students of Class XI.
The email claimed that the password of the students was about to expire. Instructions
were given to go to URL to renew their password within 24 hours.
a) Do you find any discrepancy in this email? – The general email format contains
sender information on top. This information contains sender’s name and sender’s e-mail
id. Then Subject line is missing.
b) What will happen if the student will click on the given URL? – It will redirect the user
to change the password. This is now a secure URL so the information can be open to
anyone so it can be hacked or stolen from the database.
c) Is the email an example of cybercrime? If yes, then specify which type of cybercrime
is it. Justify your answer. – Yes, it can be an example of cybercrime as it is a phishing
activity.
9) You are planning to go for a vacation. You surfed the Internet to get
answers for the following queries, Which of your above-mentioned actions
might have created a digital footprint?
a) Weather conditions – Weather conditions do not store the information related
to the user so do not create any digital footprint.
b) Availability of air tickets and fares – It will create a digital footprint because it
collects data related to customer and ticket details.
c) Places to visit – The places to visit on google map is creating a digital footprint
in your profile.
d) Best hotel deals – This will also ask data from user and create a digital
footprint.
10. How would you recognize if one of your friends is being cyberbullied?
a) Cite the online activities which would help you detect that your friend is being
cyberbullied? – If someone is causing humiliation to my friend through hateful
comments on the social networking sites then we know that he/she is being
bullied
b) What provisions are in IT Act 2000, (amended in 2008) to combat such
situations. – Section 66A in the amended IT Act deals with these crimes
11. If you plan to use a short text from an article on the web, what steps must
you take in order to credit the sources used?
You need to put citation specifying the website name from where the content has
been used.
12. Describe why it is important to secure your wireless router at home. Search
the Internet to find the rules to create a reasonably secure password.
Create an imaginary password for your home router. Will you share your
password for a home router with the following people. Justify your answer.
a) Parents
b) Friends
c) Neighbours
d) Home tutors
Other than parents the password should not be shared with anyone Rules to create
secure password:
b) smart and safe Internet surfing. – Visit only https sites, don’t remain login at all times,
antivirus updates, use of strong passwords, think twice before feeding in your personal
details on any web sites, do not open any mail from unknown sender etc
14 In the computer science class, Sunil and Jagdish were assigned the
following task by their teacher.
a) Sunil was asked to find information about “India, a Nuclear power”. He was asked to
use Google Chrome browser and prepare his report using Google Docs.
b) Jagdish was asked to find information about “Digital India”. He was asked to use
Mozilla Firefox browser and prepare his report using Libre Office Writer. What is the
difference between technologies used by Sunil and Jagdish?
Chrome and google docs are freewares Whereas Mozilla Firefox browser and libre
office are open source softwares. Refer the deferentiate question for more.
15 Cite examples depicting that you were a victim of following cyber crime.
Also, cite provisions in IT Act to deal with such a cyber crime.
a) Identity theft
b) Credit card account theft – Both Under section 66C of the IT Act 2000 Q20.
16Sumit got good marks in all the subjects. His father gifted him a laptop. He
would like to make Sumit aware of health hazards associated with inappropriate
and excessive use of laptop. Help his father to list the points which he should
discuss with Sumit.
4. Sumit must be made aware of the following points regarding the aftermath of
excessive use of technology:
a) Strained Vision
b) Muscle and joint pain
c) Too much co-dependence
d) Failing memory
e) Sleep deprivation
f) Internet is very distracting, eats away lot of time
Notes of networking
Question 60.
Freshminds University of India is starting its first campus Anna Nagar of South India
with its centre admission office in Kolkata. The university has three major blocks
comprising of Office Block, Science Block and Commerce Block in the 5 km area
campus.
As a network expert, you need to suggest the network plan as per (i) to (iv) to the
authorities keeping in mind the distance and other given parameters.
(i) Suggest the authorities, the cable layout amongst various blocks inside
university campus for connecting the blocks.
(ii) (Suggest the most suitable place (i.e. block) to house the server of this
university with a suitable reason.
(iii) Suggest an efficient device from the following to be installed in each of the
blocks to connect all the computers.
(a) Switch
(b) Modem
(c) Gateway
(iv) Suggest the most suitable (very high speed) service to provide data
connectivity between Admission Office located in Anna Nagar from the
following options:
(a) Telephone lines
(b) Fixed line dial-up connection
(c) Co-axial cable network
(d) GSM
(e) Leased lines
(f) Satellite connection (Delhi 2009)
Answer:
(i) The suggested cable layout amongst various blocks inside university campus for
connecting the blocks will be as follow:
Using Star Network:
(ii) The most suitable place (i.e. block) to house the server of this university is Science
Block, because in this block there are maximum number of computer and according to
80-20 rule 80% of traffic should be local.
(iii) The efficient device to be installed in each of the blocks to connect all the computers
is switch.
(iv) For very high-speed connectivity between Admission office located in Kolkata and
the campus office in Anna Nagar is satellite connection.
2)Eduminds University of India is starting its first campus in a small town Parampur of
central India with its centre admission office in Delhi. The university has three major
buildings comprising of Admin Building, Academic Building and Research Building in the
5 km area campus. As a network expert, you need to suggest the network plan as per
(i) to (iv) to the authorities keeping in mind the distances and other given parameters.
(i) Suggest the authorities, the cable layout amongst various buildings inside the
university campus for connecting the building.
(ii) Suggest the most suitable place (i.e. building) to house the server of this
organisation, with a suitable reason.
III) Suggest an efficient device from the following to be installed in each of the buildings
to connect all computers.
(a) Gateway
(b) Modem
(c) Switch
(iv) Suggest the most suitable (very high speed) service to provide data connectivity
between Admission Building located in Delhi and the campus located in Parampur from
the following options:
(a) Telephone line
(b) Fixed line dial-up connection
(c) Co-axial cable network
(d) GSM
(e) Leased line
(f) Satellite connection. (All India 2009; HOTS)
Answer:
(i) The suggested cable layout is as follows: Using Bus/Star Network
(v)
(ii) The most suitable place (i.e. block) to house the server of this university is
Academic Block, because there are maximum number of computers in this
block and according to 80-20 rule 80% of traffic in a network should be local.
(iii) The efficient device to be installed in each of the blocks to connect all the
computers is switch.
(iv) For very high-speed connectivity between Admission Building located in
Delhi and campus located in Parampur is satellite connection.
Question 62.
Bias Methodologies is planning to expand their network in India starting with
three cities in India to build infrastructure for research and development of
their chemical products. The company has planned to setup their main office
in Pondicherry at three different locations and have named their offices as
Back Office, Research Lab and Development Unit. The company has one
more research office namely Corporate Unit in Mumbai. A rough layout of the
same is as follows:
(i) Suggest the kind of network required (out of LAN, MAN, WAN) for
connection each of the following office unit
(a) Research Lab and Back Office
(b) Research Lab and Development Unit
(ii) Which of the following devices will you suggest for connecting all the
computers with each of their office units?
(a) Switch/Hub
(b) Modem
(c) Telephone
(iii) Which of the following communication media, will you suggest to be
procured by the company for connecting their local office units in Pondicherry
for very effective (high speed) communications?
(a) Telephone cable
(b) Optical fiber
(c) Ethernet cable
(iv) Suggest a cable/wiring layout for connecting the company’s local office
units located in Pondicherry. Also, suggest an effective method/technology for
connecting the company’s office located in Mumbai. (Delhi 2008)
Answer:
i) The type of network between the Research Lab and the Back Office is LAN
(Local Area Network). The type of network between Research Lab and Development
Unit is MAN (Metropolitan Area Network).
(ii) The suitable device for connecting all the computers within each of their office units
is switch/hub.
(iii) For connecting the local office units in Pondicherry for very effective (high speed)
communication is optical fiber.
(iv) The cable/wiring layout for connection is as follows:
Question 63.
China Middleton Fashion is planning to expand their network in India, starting with two
cities to provide infrastructure for distribution of their products. The company has
planned to setup their main office in Chennai at three different locations and have
named their offices as Production Unit, Finance Unit and Media Unit. The company has
its Corporate Unit in Delhi.
A rough layout of the same is as follows:
In continuation of the above, the company experts have planned to install the following
number of computers in each of their offices
(i) Suggest the kind of network required (out of LAN, MAN, WAN) for each of the
following units:
(a) Production Unit and Media Unit
(b) Production Unit and Finance Unit
(ii) Which of the following devices will you suggest for connecting all computers with
each of their office units?
(a) Switch/Hub
(b) Modem
(c) Telephone
(iii) Which of the following communication media, will you suggest to be procured by the
company for connecting their local office units in Chennai for very effective (high speed)
communication?
(a) Telephone cable
(b) Optical fiber
(c) Ethernet cable
(iv) Suggest a cable/wiring layout for connecting the company’s local office units located
in Chennai.
Also, suggest an effective method/technology for connecting the company’s office unit
located in Delhi. (All India 2008)
Answer:
(i) The type of network between the Production Unit and Media Unit is MAN
(Metropolitan Area Network). The type of network between Production Unit and Finance
Unit is LAN (Local Area Network).
(ii) The suitable device for connecting all the computers within each of their office units
is switch/hub.
(iii) For connecting the local office units in Chennai for very effective (high speed)
communication is optical fiber.
(iv) The cable/wiring layout for connection is as follows:
Question 64.
Bhartiya Connectivity Association is planning to spread their offices in four major cities
of India to provide regional IT infrastructure support in the field of education and culture.
The company has planned to setup their head office in New Delhi in three locations and
have named their New Delhi offices as Front Office, Back Office and Work Office. The
company has three more regional offices as three major cities of India. A rough layout of
the same is as follows:
Approximate distances between these offices as per network survey team is as follows:
In continuation of the above, the company experts have planned to install the following
number of computers in each of their offices:
i) Suggest the network type (out of LAN, MAN, WAN) for connecting each of the
following set of the their offices:
(a) Back Office and Work Office
(b) Back Office and South Office
(ii) Which device will you suggest to be procured by the company for connecting all the
computers with each of their offices out of the following devices?
(a) Switch/Flub
(b) Modem
(c) Telephone South Office, East Office and West Office located in other
(iii) Which of the following communication medium will you suggest to be procured by
the company for connecting their local offices in New Delhi for very effective and fast
communication?
(a) Telephone cable
(b) Optical fiber
c) Ethernet cable
(iv) Suggest the cable/wiring layout for connecting the company’s local offices located in
New Delhi. Also, suggest an effective method for connecting the company’s regional
offices East Office, West Office and South Office with offices located in New Delhi.
Answer:
(i) The type of network between the Back Office and the Work Office is LAN (Local Area
Network). The type of network between the Back Office and the South Office is WAN
(Wide Area Network).
(ii) The suitable device for connecting all the computers in each of their offices is
switch/hub.
(iii) For connecting local offices in New Delhi for very effective and fast communication
is optical fiber.
Question 66.
University of correspondence in Allahabad is setting up the network between its
different wings. There are four wings named as Science (S), Journalism (J), Arts (A)
and Home science(H). Distance between various wings are given below.
Number of computers:
Number of computers:
(i) Suggest a suitable topology for networking the computers of all wings.
(ii) Name the wing, where the server to be installed, justify your answer.
(iii) Suggest the placement of hub/switch in the network.
(iv) Mention an economic technology to provide Internet accessibility to all wings.
Answer:
(i) For connecting all the computers of all wings star topology can be used, because it is
most reliable. We can also set a bus network, if economy is main factor, because it is
most economical.
(ii) The server should be installed in Wing A, because there are maximum number of
computers. According to 80-20 rule 80% of the traffic should be local. By installing
server in Wing A, network traffic could be reduced.
(iii) The hub/switch must be placed in all the wings to connect all the computers of the
network.
(iv) To provide Internet accessibility to all wings economically, we can use a proxy
server in Wing A and we should connect the Internet through a dial-up network.
E.g., www.Mybook.com
A domain name contains three parts: