Tuesday 16 March 2021

14 March 2021 Digital Electronics Test Result

 


S.No.

Name

Marks

1

Suruchi

41

2

Govind Yadav

41

3

Pritam Kumari

40

4

Salvi Vatsa

31

5

Meerayadav

31

6

Divya ..

30

7

Md Tehran

30

8

Ranjeet Yadav

30

9

Shehbaz

30

10

Lalit Gupta

30

11

Rohit Kumar

28

12

Ajay Gupta

28

13

Rakesh

27

14

Manish Kumar Garg

27

15

Vikas Patel

26

16

Surya

26

17

Jitender

26

18

Ankit Pandey

26

19

Chandan

24

20

Sandeep Kumar

24

21

Mukesh Roy

24

22

Akshay Sharma

24

23

Shefali Sharma

23

24

Ankur Bhardwaj

23

25

Sanjeev

23

26

Anuj Kashyap

23

27

Himanshu

23

28

Sanjay

22

29

Suhail Malik

22

30

Ajay Kumar

22

31

Pinki Rani

21

32

Sandee

21

33

Jyoti

20

34

Priyanka Arora

20

35

Rajesh Kumar

20

36

Hemant Kumar Singh

19

37

Vipin Kumar

19

38

Sonika

18

39

Amita

18

40

Annu

18

41

Monika Yadav

18

42

Shahib

17

43

Anil Yadav

17

44

Dilip Gupta

17

45

Piyush Kumar

17

46

Sandeep

16

47

Gopal Sharma

15

48

Gaurav Gahlot

14

49

Raj Kumar Gupta

14

50

Chirag Kashyap

14

51

Satyam

14

52

Priyanka Soni

13

53

Khushbu

12

54

Harshita

10

55

Shweta Sharma

10

56

Divya Mishra

8

57

Shivani Singh

8

58

Ankit Sandhilya

6

59

Sumit Chopra

3

60

Pragya Sharma

2

61

Lakshmi Nagakumari Velivela

1


Thursday 11 March 2021

Class 12 IP Practical - 15

 15. WAP to represent size and shape of the  DataFrame.


import pandas as pd

d={'Ritesh':{'English':85,'Bio':82,'Physics':35,'IP':95,'Chemistry':81}, \

   'Rishabh':{'English':55,'Bio':62,'Physics':55,'IP':85,'Chemistry':91}, \

   'Harshit':{'English':65,'Bio':72,'Physics':75,'IP':91,'Chemistry':71}, \

   'Krishan':{'English':25,'Bio':75,'Physics':45,'IP':93,'Chemistry':61}, \

   'Shailesh':{'English':75,'Bio':82,'Physics':65,'IP':97,'Chemistry':51}}

df1=pd.DataFrame(d)

print("DataFrame is:")

print(df1)

print("Size of DataFrame:")

print(df1.size)

print("Shape of DataFrame:")

print(df1.shape)



>>>

========= RESTART: C:/Program Files (x86)/Python38-32/Ip-15.py ========

DataFrame is:

           Ritesh  Rishabh  Harshit  Krishan  Shailesh

English        85       55       65       25        75

Bio            82       62       72       75        82

Physics        35       55       75       45        65

IP             95       85       91       93        97

Chemistry      81       91       71       61        51

Size of DataFrame:

25

Shape of DataFrame:

(5, 5)

>>> 








Class 12 IP Practical - 14

 14. WAP to show indexes and axes of a DataFrame.


 

import pandas as pd

d={'Ritesh':{'English':85,'Bio':82,'Physics':35,'IP':95,'Chemistry':81}, \

   'Rishabh':{'English':55,'Bio':62,'Physics':55,'IP':85,'Chemistry':91}, \

   'Harshit':{'English':65,'Bio':72,'Physics':75,'IP':91,'Chemistry':71}, \

   'Krishan':{'English':25,'Bio':75,'Physics':45,'IP':93,'Chemistry':61}, \

   'Shailesh':{'English':75,'Bio':82,'Physics':65,'IP':97,'Chemistry':51}}

df1=pd.DataFrame(d)

print("DataFrame is:")

print(df1)

print("Index of DataFrame:")

print(df1.index)

print("Axis of DataFrame:")

print(df1.axes)

>>>

========= RESTART: C:/Program Files (x86)/Python38-32/IP-14.py ========

DataFrame is:

           Ritesh  Rishabh  Harshit  Krishan  Shailesh

English        85       55       65       25        75

Bio            82       62       72       75        82

Physics        35       55       75       45        65

IP             95       85       91       93        97

Chemistry      81       91       71       61        51

Index of DataFrame:

Index(['English', 'Bio', 'Physics', 'IP', 'Chemistry'], dtype='object')

Axis of DataFrame:

[Index(['English', 'Bio', 'Physics', 'IP', 'Chemistry'], dtype='object'), Index(['Ritesh', 'Rishabh', 'Harshit', 'Krishan', 'Shailesh'], dtype='object')]

>>> 

Class 12 IP Practical - 13

 13.  WAP to perform mathematical operation addition, subtraction and multiplication on two series.

 


import pandas as pd

d1=[10,20,30,40,50,60,70,80]

S1=pd.Series(d1)

d2=[1,2,3,4,5,6,7,8]

S2=pd.Series(d2)

print("First Series:")

print(S1)

print("2nd Series:")

print(S2)

print("Addition of S1+S2 Series:")

print(S1.add(S2))

print("Subtraction of S1-S2 Series:")

print(S1.sub(S2))

print("Multiplication of S1*S2 Series:")

print(S1.mul(S2))



>>>

========= RESTART: C:/Program Files (x86)/Python38-32/Ip-13.py ========

First Series:

0    10

1    20

2    30

3    40

4    50

5    60

6    70

7    80

dtype: int64

2nd Series:

0    1

1    2

2    3

3    4

4    5

5    6

6    7

7    8

dtype: int64

Addition of S1+S2 Series:

0    11

1    22

2    33

3    44

4    55

5    66

6    77

7    88

dtype: int64

Subtraction of S1-S2 Series:

0     9

1    18

2    27

3    36

4    45

5    54

6    63

7    72

dtype: int64

Multiplication of S1*S2 Series:

0     10

1     40

2     90

3    160

4    250

5    360

6    490

7    640

dtype: int64

>>> 


Class 12 IP Practical - 12

 12.  Create a Series and access the top 2 and last 2 elements using head() and tail() methods.


import pandas as pd

d=[10,20,30,40,50,60,70,80]

S=pd.Series(d)

print("Series:")

print(S)

print("Top 2 Elements of Series:")

print(S.head(2))

print("Last 2 Elements of Series:")

print(S.tail(2))



 

========= RESTART: C:/Program Files (x86)/Python38-32/IP-12.py ========

Series:

0    10

1    20

2    30

3    40

4    50

5    60

6    70

7    80

dtype: int64

Top 2 Elements of Series:

0    10

1    20

dtype: int64

Last 2 Elements of Series:

6    70

7    80

dtype: int64

>>>  

Class 12 IP Practical - 11

 11.  WAP in Python to sort the pandas DataFrame on the basis of a single column in ascending order.



 

import pandas as pd

d={'Ritesh':{'English':85,'Bio':82,'Physics':35,'IP':95,'Chemistry':81}, \

   'Rishabh':{'English':55,'Bio':62,'Physics':55,'IP':85,'Chemistry':91}, \

   'Harshit':{'English':65,'Bio':72,'Physics':75,'IP':91,'Chemistry':71}, \

   'Krishan':{'English':25,'Bio':75,'Physics':45,'IP':93,'Chemistry':61}, \

   'Shailesh':{'English':75,'Bio':82,'Physics':65,'IP':97,'Chemistry':51}}

df1=pd.DataFrame(d)

print("DataFrame is:")

print(df1)

print("Sorted DataFrame w.r.t. IP is:")

print(df1.sort_values('Harshit',axis=0))

                                         



 

>>>

========= RESTART: C:/Program Files (x86)/Python38-32/IP-11.py ========

DataFrame is:

           Ritesh  Rishabh  Harshit  Krishan  Shailesh

English        85       55       65       25        75

Bio            82       62       72       75        82

Physics        35       55       75       45        65

IP             95       85       91       93        97

Chemistry      81       91       71       61        51

Sorted DataFrame w.r.t. IP is:

           Ritesh  Rishabh  Harshit  Krishan  Shailesh

English        85       55       65       25        75

Chemistry      81       91       71       61        51

Bio            82       62       72       75        82

Physics        35       55       75       45        65

IP             95       85       91       93        97

>>>  

Class 12 IP Practical - 08

 

#8 - Write a program to plot a bar chart from the medals won by the four countries. Make sure that bars are separately visible.                                  

Country

Gold

Silver

Bronze

Total

India

26

20

20

66

Australia

80

59

59

198

England

45

45

46

136

Canada

10

12

14

36

  

import matplotlib.pyplot as plt

import numpy as np

info=['Gold','Silver','Bronze','Total']

India=[26,20,20,66]

Australia=[80,59,59,198]

England=[45,45,46,136]

Canada=[10,12,14,36]

plt.figure(figsize=(10,7))

x=np.arange(len(info))

plt.bar(info,India,width=0.15,label="India")

plt.bar(x+0.15,Australia,width=0.15,label="Australia")

plt.bar(x+0.30,England,width=0.15,label="England")

plt.bar(x+0.45,Canada,width=0.15,label="Canada")

plt.xlabel("Medal Type")

plt.ylabel("Number of Medals won")

plt.title("Medal Tally Bar Chart")

plt.legend()

plt.show()

 





Class 12 IP Practical - 07

 

#7 - Given a series nfib that contains reversed Fibonacci numbers with Fibonacci numbers as show below:

[0, -1, -1, -2, -3, -5, -8, -13, -21, -34, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34]

 Write a program to plot nfib with following specifications:                

 (a)    The line color should be magenta

 (b)   The marker edge color should be black with size 5

 (c)    Grid should be displayed


import matplotlib.pyplot as plt

import numpy as np

nfib=[0,-1,-1,-2,-3,-5,-8,-13,-21,-34,0,1,1,2,3,5,8,13,21,34]

plt.plot(range(-10,10),nfib,'mo',markersize=5,linestyle='solid',markeredgecolor='k')

plt.grid(True)

plt.xlabel("X Axis")

plt.ylabel("Y Axis")

plt.title("Reversed Fibonacci Numbers with Fibonacci Series")

plt.legend()

plt.show()







Class 12 IP Practical - 06

 

#6 - First 10 terms of Fibonacci series are stored in a list namely fib:          

 

fib = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]

 

Write a program to plot Fibonacci terms and their square-roots with two separate lines on the same plot.

(a)    Series should be plotted as a cyan line with ‘o’ markers having size as 5 and edge-color as red.

(b)   The square-root series should be plotted as a black line with ‘+’ markers having size as 7 and edge-color as red.

 

 

import matplotlib.pyplot as plt

import numpy as np

fib=[0,1,1,2,3,5,8,13,21,34]

sqfib=np.sqrt(fib)

plt.plot(range(1,11),fib,'co',markersize=5,linestyle='solid',markeredgecolor='r',label="fib")

plt.plot(range(1,11),sqfib,'k+',markersize=7,linestyle='solid',markeredgecolor='r',label="sqfib")

plt.xlabel("X Axis")

plt.ylabel("Y Axis")

plt.title("Fibonacci Series")

plt.legend()

plt.show()