Tuesday, October 12, 2021

General Questions of Computer - 2

1. Name of 5 Mobile Payment App

Popular online payment apps or payment apps or e - wallet list in India

·        Paytm.

·        Google Pay.

·        PhonePe.

·        BHIM.

·        Amazon Pay.

·        JIO Money.

·        Freecharge.

·        Yono SBI.

·        Airtel Money.

·        Payzapp.


2. Full form of:


BHIM - Bharat Interface for Money

YONO - You Only Need One

UPI - Unified Payments Interface

IFSC - Indian Financial System Code

NEFT - National Electronic Funds Transfer

RTGS - Real-Time Gross Settlement

MICR - Magnetic Ink Character Recognition

RAM - Random Access Memory

ROM - Read Only Memory

ASCII - American Standard Code For Information Interchange

UTF - Unicode Transformation Format

ISCII - Indian Script Code for Information Interchange

TFT - Thin Film Transistor

CRT – Cathode Ray Tube.

LCD - Liquid Crystal Display

LED – Light Emitting Diode

CPU - Central Processing Unit

CU – Control Unit

ALU - Arithmetic Logic Unit

OMR - Optical Mark Recognition

PS/2 - Personal System/2

XP - Experience


3. Name of 5 E-Commerce Website.

·        Amazon

·        Flipkart

·        Snapdeal

·        Myntra

·        PayTm

·        Shopclues

 

4. Name of 5 Educational Website.

·        W3 School

·        Byju’s

·        Unacademy

·        S P SHARMA CLASSES

·        Geeksforgeeks

·        Tutorialspoint

·        JavaTpoint

    ·        TgtPgtCS

    ·        GBSSS

5. Name of 5 Application Software.


Types of Application Software

 

Application Software Type

Examples

Word processing software

MS Word, WordPad and Notepad

Database software

MySql, Oracle, MS Access etc

Spreadsheet software

Apple Numbers, Microsoft Excel

Multimedia software

Real Player, VLC Media Player

Presentation Software

Microsoft PowerPoint, Keynotes

 

6. Name of 5 E-Mail Website

·        Gmail,

·        Yahoo

·        Outlook

·        AOL

·        Zoho

·        Mail.Com

·        ProtonMail.

 

7. Name of 5 Video Editing Apps

·        Magisto.

·        Hyperlapse.

·        Wondershare Filmora.

·        InShot.

·        WeVideo.

·        Splice.

·        Adobe Premiere Rush.

·        Blender.

 

8. Name of 5 Shorts Video Social Apps

·        Instagram

·        Josh

·        Moj

·        MX TakaTak

·        Chingari

·        Mitron

 

9. Name of 5 Computer Games

·        League of Legends

·        Counter-Strike: Global Offensive

·        GTA V (Grand Theft Auto V)

·        PUBG

·        Game of Thrones: Beyond the Wall


10. Name of 5 IT Companies of India

·        Tata Consultancy Services (TCS)

·        Infosys

·        Wipro

·        HCL Technologies

·        Tech Mahindra


Thursday, October 7, 2021

DataFrame iloc, loc, del, drop, pop in Python - 7

# Using loc and iloc 

 import pandas as pd

D={"Name":["Ram","Raj","Sam","John","Amit"],"Roll No.":[10,20,30,40,50], \

   "IP":[25,30,32,21,22]}

df=pd.DataFrame(D)

print(df)

print(df.iloc[1:3])

print(df.loc[1:3])


Output:

Name  Roll No.  IP

0   Ram        10  25

1   Raj        20  30

2   Sam        30  32

3  John        40  21

4  Amit        50  22

  Name  Roll No.  IP

1  Raj        20  30

2  Sam        30  32

   Name  Roll No.  IP

1   Raj        20  30

2   Sam        30  32

3  John        40  21



#Using of pop in DataFrame

import pandas as pd

D={"Name":["Ram","Raj","Sam","John","Amit"],"Roll No.":[10,20,30,40,50], \

   "IP":[25,30,32,21,22]}

df=pd.DataFrame(D)

print(df)

print (df.pop('IP'))



Output:

Name  Roll No.  IP

0   Ram        10  25

1   Raj        20  30

2   Sam        30  32

3  John        40  21

4  Amit        50  22

0    25

1    30

2    32

3    21

4    22

Name: IP, dtype: int64


#Using drop in DataFrame

import pandas as pd

D={"Name":["Ram","Raj","Sam","John","Amit"],"Roll No.":[10,20,30,40,50], \

   "IP":[25,30,32,21,22]}

df=pd.DataFrame(D)

print(df)

print (df.drop('Name',axis=1))



Output:


Name  Roll No.  IP

0   Ram        10  25

1   Raj        20  30

2   Sam        30  32

3  John        40  21

4  Amit        50  22

Roll No.  IP

0        10  25

1        20  30

2        30  32

3        40  21

4        50  22


#Using del in DataFrame

import pandas as pd

D={"Name":["Ram","Raj","Sam","John","Amit"],"Roll No.":[10,20,30,40,50], \

   "IP":[25,30,32,21,22]}

df=pd.DataFrame(D)

print(df)

del df['Name']

print(df)



Output:


Name  Roll No.  IP

0   Ram        10  25

1   Raj        20  30

2   Sam        30  32

3  John        40  21

4  Amit        50  22

Roll No.  IP

0        10  25

1        20  30

2        30  32

3        40  21

4        50  22

Wednesday, October 6, 2021

DataFrame in Python - 6

1.

 #Add New Column in DataFrame using df['columnname']

import pandas as pd

D={"Name":["Ram","Raj","Sam","John","Amit"],"Roll No.":[10,20,30,40,50]}

df=pd.DataFrame(D)

print(df)

df["IP"]=[25,30,32,21,22]

df["Maths"]=[22,20,22,31,32]

df["Total"]=df["IP"]+df["Maths"]

df["Pecentage"]=df["Total"]*100/70

print(df)


Output:


   Name  Roll No.
0   Ram        10
1   Raj        20
2   Sam        30
3  John        40
4  Amit        50
   Name  Roll No.  IP  Maths  Total  Pecentage
0   Ram        10  25     22     47  67.142857
1   Raj        20  30     20     50  71.428571
2   Sam        30  32     22     54  77.142857
3  John        40  21     31     52  74.285714
4  Amit        50  22     32     54  77.142857



2.
#Add New Column in DataFrame using insert() function

import pandas as pd
D={"Name":["Ram","Raj","Sam","John","Amit"],"Roll No.":[10,20,30,40,50]}
df=pd.DataFrame(D)
print(df)
df.insert(2,"IP",[25,30,32,21,22])
df.insert(3,"Maths",[22,20,22,31,32])
df["Total"]=df["IP"]+df["Maths"]
df["Pecentage"]=df["Total"]*100/70
print(df)


Output:


   Name  Roll No.
0   Ram        10
1   Raj        20
2   Sam        30
3  John        40
4  Amit        50
   Name  Roll No.  IP  Maths  Total  Pecentage
0   Ram        10  25     22     47  67.142857
1   Raj        20  30     20     50  71.428571
2   Sam        30  32     22     54  77.142857
3  John        40  21     31     52  74.285714
4  Amit        50  22     32     54  77.142857



3.
Access a column from DataFrame using df['columnname'] and df.columnname

import pandas as pd
D={"Name":["Ram","Raj","Sam","John","Amit"],"Roll No.":[10,20,30,40,50], \
   "IP":[25,30,32,21,22]}
df=pd.DataFrame(D)
print(df)
print(df['IP'])
print(df.IP)


Output:


   Name  Roll No.  IP
0   Ram        10  25
1   Raj        20  30
2   Sam        30  32
3  John        40  21
4  Amit        50  22
0    25
1    30
2    32
3    21
4    22
Name: IP, dtype: int64
0    25
1    30
2    32
3    21
4    22
Name: IP, dtype: int64




4.
#selecting a column from a DataFrame using iloc

import pandas as pd
D={"Name":["Ram","Raj","Sam","John","Amit"],"Roll No.":[10,20,30,40,50], \
   "IP":[25,30,32,21,22]}
df=pd.DataFrame(D)
print(df)
print(df['IP'])
print(df['Roll No.'])
print (df.iloc[:,[1,2]])


Output

 ==========
   Name  Roll No.  IP
0   Ram        10  25
1   Raj        20  30
2   Sam        30  32
3  John        40  21
4  Amit        50  22
0    25
1    30
2    32
3    21
4    22
Name: IP, dtype: int64
0    10
1    20
2    30
3    40
4    50
Name: Roll No., dtype: int64
   Roll No.  IP
0        10  25
1        20  30
2        30  32
3        40  21
4        50  22

Tuesday, October 5, 2021

DataFrame in Python - 5

1. 

Add New Row in DataFrame 

import pandas as pd

D={'Name':['ritu','ajay','pankaj','aditya'],'English':[67,78,75,88],'Bio':[78,67,89,90],'Physics':[34,45,67,78],'Chem':[23,32,67,87]}

df=pd.DataFrame(D)

print(df)

#Add New Row in DataFrame

df.loc['4']={'Name':'udai','English':55 ,'Bio':98,'Physics':89 ,'Chem':56}

print(df)


Output:


========== RESTART: C:\Users\acer\AppData\Local\Programs\Python\Python39\DF4.py ==========
     Name  English  Bio  Physics  Chem
0    ritu       67   78       34    23
1    ajay       78   67       45    32
2  pankaj       75   89       67    67
3  aditya       88   90       78    87
     Name  English  Bio  Physics  Chem
0    ritu       67   78       34    23
1    ajay       78   67       45    32
2  pankaj       75   89       67    67
3  aditya       88   90       78    87
4    udai       55   98       89    56



2. 
Modify the row in DataFrame


import pandas as pd
D={'Name':['ritu','ajay','pankaj','aditya'],'English':[67,78,75,88],'Bio':[78,67,89,90],'Physics':[34,45,67,78],'Chem':[23,32,67,87]}
df=pd.DataFrame(D)
print(df)
#modify the row
df.loc[1]=["ajay",61,62,63,64]
print(df)


Output:



 ==========
     Name  English  Bio  Physics  Chem
0    ritu       67   78       34    23
1    ajay       78   67       45    32
2  pankaj       75   89       67    67
3  aditya       88   90       78    87
     Name  English  Bio  Physics  Chem
0    ritu       67   78       34    23
1    ajay       61   62       63    64
2  pankaj       75   89       67    67
3  aditya       88   90       78    87
>>> 



3.
Rename the column in DataFrame

import pandas as pd
D=[10,20,30,40,50]
df=pd.DataFrame(D)
print(df)
df.columns=["Roll No."]
print(df)



Output:

    0
0  10
1  20
2  30
3  40
4  50
   Roll No.
0        10
1        20
2        30
3        40
4        50


4. 
Rename Multiple columns in DataFrame


import pandas as pd
D={"Name":["Ram","Raj","Sam","John","Amit"],"Roll No.":[10,20,30,40,50]}
df=pd.DataFrame(D)
print(df)
df.columns=["Std_Name","Std_id"]
print(df)

Output:


   Name  Roll No.
0   Ram        10
1   Raj        20
2   Sam        30
3  John        40
4  Amit        50
  Std_Name  Std_id
0      Ram      10
1      Raj      20
2      Sam      30
3     John      40
4     Amit      50





import pandas as pd
D={"Name":["Raju","Raj","Ram"],"IP":[30,32,28],"Bio":[25,28,32]}
df=pd.DataFrame(D)
print(df)
df.rename(columns={"Bio":"Biology","IP":"Informatics Practices"},inplace=True)
print(df)



   Name  IP  Bio
0  Raju  30   25
1   Raj  32   28
2   Ram  28   32
   Name  Informatics Practices  Biology
0  Raju                     30       25
1   Raj                     32       28
2   Ram                     28       32


Monday, October 4, 2021

WAP in Python to create a calculator

#WAP in Python to create a calculator

a=int(input("Enter First Number: "))

b=int(input("Enter Second Number: "))

sum=a+b

sub=a-b

pro=a*b

div=a/b

fdiv=a//b

exp=a**b

rem=a%b

print("Sum=",sum)

print("Difference=",sub)

print("Product=",pro)

print("Division=",div)

print("Floor Division=",fdiv)

print("Exponational=",exp)

print("Modulus=",rem)


Output



Enter First Number: 22
Enter Second Number: 5
Sum= 27
Difference= 17
Product= 110
Division= 4.4
Floor Division= 4
Exponational= 5153632
Modulus= 2


2.
#WAP in Python to calculate simple interest
P=float(input("Enter the principal amount: "))
R=float(input("Enter rate of interest Yearly: "))
T=int(input("Enter the number of year: "))
SI=P*R*T/100
print("Simple Interest=",SI)


Output:

Enter the principal amount: 5000
Enter rate of interest Yearly: 24
Enter the number of year: 5
Simple Interest= 6000.0

Thursday, September 30, 2021

DataFrame in Python Class - 4

1

 #Sort the values of DataFrame

import pandas as pd

I=['IP','Bio','Chemistry','Physics','English']

D={"2018":[50,60,70,80.5,90],"2019":[40,35,45,55,32], \

   "2020":[65,75,85,45,52],}

df=pd.DataFrame(D,I)

print(df)

print(df.sort_values(by=["2019"]))

    

print(df.sort_values(by=["2019"],ascending=True))

print(df.sort_values(by=["2019"],ascending=False))




Output:


           2018  2019  2020
IP         50.0    40    65
Bio        60.0    35    75
Chemistry  70.0    45    85
Physics    80.5    55    45
English    90.0    32    52
           2018  2019  2020
English    90.0    32    52
Bio        60.0    35    75
IP         50.0    40    65
Chemistry  70.0    45    85
Physics    80.5    55    45
           2018  2019  2020
English    90.0    32    52
Bio        60.0    35    75
IP         50.0    40    65
Chemistry  70.0    45    85
Physics    80.5    55    45
           2018  2019  2020
Physics    80.5    55    45
Chemistry  70.0    45    85
IP         50.0    40    65
Bio        60.0    35    75
English    90.0    32    52



2.
#Create a DataFrame using Dictionary and default index
import pandas as pd

D={"Name":["Ram","Raj","Sam","John"],"CS":[50,75,55,82], \
   "Maths":[40,35,45,55], \
   "IP":[65,75,85,45]}
df=pd.DataFrame(D)
print(df)



   Name  CS  Maths  IP
0   Ram  50     40  65
1   Raj  75     35  75
2   Sam  55     45  85
3  John  82     55  45



3.
#Create a DataFrame using Dictionary of Series
import pandas as pd
n=pd.Series(["Ram","Raj","Sam","John"])
cs=pd.Series([50,75,55,82])
maths=pd.Series([40,35,45,55])
ip=pd.Series([65,75,85,45])
data={"Name":n,"CS":cs,"Maths":maths,"IP":ip}
df=pd.DataFrame(data)
print(df)


Output:

  Name  CS  Maths  IP
0   Ram  50     40  65
1   Raj  75     35  75
2   Sam  55     45  85
3  John  82     55  45



4.
#Create a DataFrame using Dictionary of Series by directly passing the values to the dictionary  
import pandas as pd
data={"Name":pd.Series(["Ram","Raj","Sam","John"]),
      "CS":pd.Series([50,75,55,82]),
      "Maths":pd.Series([40,35,45,55]),
      "IP":pd.Series([65,75,85,45])}
df=pd.DataFrame(data)
print(df)

Output:

   Name  CS  Maths  IP
0   Ram  50     40  65
1   Raj  75     35  75
2   Sam  55     45  85
3  John  82     55  45



5.
#Create a DataFrame by passing a list of dictionaries
import pandas as pd
data=[{"Ram":45,"Raj":43,"Sam":27,"John":50},
      {"Ram":40,"Raj":35,"Sam":45,"John":30},
      {"Ram":65,"Raj":75,"Sam":60,"John":55}]
df=pd.DataFrame(data)
print(df)

Output:

   Ram  Raj  Sam  John
0   45   43   27    50
1   40   35   45    30
2   65   75   60    55



6.
#Create a DataFrame from numpy ndarray
import pandas as pd
import numpy as np
array=np.array([[67,77,75,78],
        [67,78,75,88],
        [78,67,89,90],
        [78,88,98,90]])
column_values=['English','Economics','IP','Accounts']
df=pd.DataFrame(array,columns=column_values)
print(df)

Output:

   English  Economics  IP  Accounts
0       67         77  75        78
1       67         78  75        88
2       78         67  89        90
3       78         88  98        90



7.
#To display records from the first to the third row
import pandas as pd
D={'Name':['ritu','ajay','pankaj','aditya'],'English':[67,78,75,88],'Bio':[78,67,89,90],'Physics':[34,45,67,78],'Chem':[23,32,67,87]}
df=pd.DataFrame(D)
print(df)
print(df[1:3])

Output:
     Name  English  Bio  Physics  Chem
0    ritu       67   78       34    23
1    ajay       78   67       45    32
2  pankaj       75   89       67    67
3  aditya       88   90       78    87
     Name  English  Bio  Physics  Chem
1    ajay       78   67       45    32
2  pankaj       75   89       67    67




8.
#To create an indexed DataFrame using list
import pandas as pd
D={'Name':['ritu','ajay','pankaj','aditya'],'English':[67,78,75,88],'Bio':[78,67,89,90],'Physics':[34,45,67,78],'Chem':[23,32,67,87]}
df=pd.DataFrame(D, index=['S1','S2','S3','S4'])
print(df)
print(df[1:3])


Output:

      Name  English  Bio  Physics  Chem
S1    ritu       67   78       34    23
S2    ajay       78   67       45    32
S3  pankaj       75   89       67    67
S4  aditya       88   90       78    87
   




9.
#To change the index column (set the DataFrame Column as Index) of DataFrame
import pandas as pd
D={'Name':['ritu','ajay','pankaj','aditya'],'English':[67,78,75,88],'Bio':[78,67,89,90],'Physics':[34,45,67,78],'Chem':[23,32,67,87]}
df=pd.DataFrame(D)
print(df)
df.set_index('Name',inplace=True)
print("New DataFrame:")
print(df)


Output:

 ==========
     Name  English  Bio  Physics  Chem
0    ritu       67   78       34    23
1    ajay       78   67       45    32
2  pankaj       75   89       67    67
3  aditya       88   90       78    87
New DataFrame:

        English  Bio  Physics  Chem
Name                               
ritu         67   78       34    23
ajay         78   67       45    32
pankaj       75   89       67    67
aditya       88   90       78    87



10. 
Reset the Index column of a DataFrame i.e. Reset to the original DataFrame

import pandas as pd
D={'Name':['ritu','ajay','pankaj','aditya'],'English':[67,78,75,88],'Bio':[78,67,89,90],'Physics':[34,45,67,78],'Chem':[23,32,67,87]}
df=pd.DataFrame(D)
print(df)
df.set_index('Name',inplace=True)
print("New DataFrame:")
print(df)
df.reset_index(inplace=True)
print("Original DataFrame:")
print(df)



Output:


    Name  English  Bio  Physics  Chem
0    ritu       67   78       34    23
1    ajay       78   67       45    32
2  pankaj       75   89       67    67
3  aditya       88   90       78    87
New DataFrame:
        English  Bio  Physics  Chem
Name                               
ritu         67   78       34    23
ajay         78   67       45    32
pankaj       75   89       67    67
aditya       88   90       78    87
Original DataFrame:
     Name  English  Bio  Physics  Chem
0    ritu       67   78       34    23
1    ajay       78   67       45    32
2  pankaj       75   89       67    67
3  aditya       88   90       78    87