Question
Mr. Sharma is working on pandas series and he is facing some problem while working on Series. Help him with few concepts by answering the given question:
He has created the series:

(a) He wanted the given output, which command will be appropriate to do the sam(e)

(b) Which command will give him the output as 5.
(i) s.index
(ii) s.size
(iii) s.values
(iv) None of the mentioned
(c) Assuming the changed structure, answer the question.

Which command will display the given output?
(i) s.head (2) (ii) s.top(2)
(iii) s.head() (iv) s.first(2)
(d) Choose the write output for the given command:
>>>print(stud1.count())
(i) 4 (ii) 3
(iii) 5 (iv) Error
(e) What is the name of the above Series?
(i) Student (ii) s
(iii) int64 (iv) float64

Answer

(a) (iii) s.index=[‘Amit’,’Ramesh’,’Mahesh’,’ john’,’Abdul’](b) (ii) s.size
(c) (i) s.head(2)
(d) (i) 4
(e) (ii) s

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free

Similar questions

Pawan is confused in understanding Dictionary concept. Help him to understand the concept by choosing the appropriate answer.

(a) Which statement will display Not Available?

(i) Statement 9 (ii) Statement 10

(iii) Statement 11 (iv) Statement 13

(b) Choose the key from Dictionary.

(i) ADMNO (ii) ‘admno ’

(iii) 101 (iv) “Not Available ”

(c) Which statement will display None?

(i) Statement 9 (ii) Statement 10

(iii) Statement 11 (iv) Statement 13

(d) Which Statement will display Tejas?

(i) Statement 8 (ii) Statement 9

(iii) Statement 10 (iv) Statement 11

(e) Choose the identifier.

(i) ADMNO (ii) ‘admno ’

(iii) setdefault (iv) Not Available

With reference to the given data frame answer the questions given below:

id name host_id host_name neighbourhood_group neighbourhood latitude longitude
0 2539 Clean & quiet apt
home by the park
2787 John Brooklyn Kensignton 40.64749 -73.97237
1 2595 Skylit Midtown
Castle
2845 Jennifer Manhattan Midtown 40.75362 -73.98377
2 3647 The Village
Of Harlem ...
New York !
4632 Elisabeth Manhattan Harlem 40.80902 -73.94190
3 3831 Cozy Entire Floor
of Brownstone
4869 LisaRoxanne Brooklyn Clinton Hill 40.68514 -73,95976
4 5022 Entire Apt:
Spacious Studio/
Loft by central park
7192 Laura Manhattan East Harlem 40.79851 -73.94399
5 5099 Large Cozy 1BR
Apartment in
Midtown East
7322 Chris Manhattan Murray Hill 40.74767 -73.97500
6 5121 BlissArtsSpace! 7356 Garon Brooklyn Bedford-Stuyvesant 40.68688 -7395596
7 5178 Large Furnished
Room Near Bway
8967 Shunichi Manhattan Hell’s Kitchen 40.76489 -73.98493

Assuming that other file is stored in CSV format named “nysc.csv” Import pandas as pd

(i) To create the Data frame of the above data.

(ii) To print the first 10 records

(iii) To display the name and Id.

Consider the following tables GAMES and PLAYER. Write SQL commands for the statements (a) to (d) and give outputs for SQL queries (e1) to (e4)

Relation: GAMES

GCode Game Name Number Prize Money Schedule Date
101 Carom Board 2 5000 3-Jan-2004
102 Badminton 2 12000 12-Dec-2003
103 Table Tennis 4 8000 14-Feb-2004
105 Chess 2 9000 01-Jan-2004
108 Lawn
Tennis
4 25000 19-Mar-2004

Relation: PLAYER

PCode Name Gcode
1 Nabi Ahmad 101
2 Ravi Sahai 108
3 Jatin 101
4 Nazneen 103

(a) To display the name of all Games with their Gcodes

(b) To display details of those games which are having PrizeMoney more than 7000.

(c) To display the content of the GAMES table in ascending order of ScheduleDate.

(d) To display sum of PrizeMoney for each of the Number of participation groupings (as shown in column Number)

(e1) Select COUNT(DISTINCT Number) FROM GAMES;

(e2) Select MAX(ScheduleDate),MIN(ScheduleDate) FROM GAMES;

(e3) Select SUM(PrizeMoney) FROM GAMES;

(e4) Select DISTINCT Gcode FROM PLAYER;

What are the rules of Netiquettes?

Consider the table "Grocer "and write SQL queries for the tasks that follow:

Table: Charity

Item_Id ItemName UnitPrice Quantity (kg) Date_Purchase
1 Rice 52.50 80 2010-02-01
2 Wheat 25.40 50 2010-03-09
3 Corn 50.80 100 2010-03-11
4 Semolina 28.90 50 2010-01-15

(Unit Price is per kg. price)

(i) Display Item name, unit price along with Date of purchase for all the Items.

(ii) Display Item name along with Month (in number) when it was purchased for all the items.

(iii) Display Item name along with year in which it was purchased for all the items.

(iv) Display Item Id, Date of Purchase and day name of week (e.g. Monday) on which it was purchased for all the items.

(v) Display names of all the items that were purchased on Mondays or Tuesdays.

(vi) Display the day name of the week on which Rice was purchased.

(vii) Display the Item name and unit price truncated to integer value (no decimal digits) of all the items.

(viii) Display current date.

Write SQL commands for the following queries on the basis of Club relation given below:

Relation: Club

Coach-ID CoachName Age Sports date_of_app Pay Sex
1 Kukreja 35 Karate 27/03/1996 1000 M
2 Ravina 34 Karate 20/01/1998 1200 F
3 Karan 34 Squash 19/02/1998 2000 M
4 Tarun 33 Basketball 01/01/1998 1500 M
5 Zubin 36 Swimming 12/01/1998 750 M
6 Ketaki 36 Swimming 24/02/1998 800 F
7 Ankita 39 Squash 20/02/1998 2200 F
8 Zareen 37 Karate 22/02/1998 1100 F
9 Kush 41 Swimming 13/01/1998 900 M
10 Shailya 37 Basketball 19/02/1998 1700 F

(a) To show all information about the swimming coaches in the club.

(b) To list the names of all coaches with their date of appointment (date_of_app) in descending order.

(c) To display a report showing coach name, pay, age, and bonus (15% of pay) for all coaches.

(d) To insert a new row in the Club table with ANY relevant data:

(e) Give the output of the following SQL statements:

(i) Select COUNT(Distinct Sports) from Club;

(ii) Select Min(Age) from Club where SEX = “F”;

Answer the following question on the basis of given dataset:

a b c d
0 1 2 3 4
1 100 200 300 400
2 1000 2000 3000 4000

(i) To create the data frame for the above dictionary.

(ii) To print the dictionary.

(iii) To change the index of the above data frame 'a1','a2','a3'.

(iv) To change the columns headings to 'units','tens','hundred',' thousand'.

(v) To display the tens columns.

(vi) To create another datframe with values of thousand.

(vii) To use the iterrows() to display the complete records.

(viii) To display the column wise data using iteritems().

Write the output on the basis of the given data frame:

units tens hundred thousand
a1 1 2 3 4
a2 100 200 300 400
a3 1000 2000 3000 4000

The Teacher wrote the following code. Sanya was absent on the day when the topic was taught. Help her to complete the assignment. Choose the output on the basis of the above code.
(a) Which statement is used to display “HeLLo PyThon”?
(i) Statement 1 (ii) Statement 12
(iii)Statement 13 (iv) No Statement will display.
(b) Which statement will check for capital letters?
(i) Statement 6 (ii) Statement 7
(iii) Statement 8 (iv) Statement 9
(c) Which statement will convert it into capital letters?
(i) Statement 6 (ii) Statement 7
(iii) Statement 8 (iv) Statement 9
(d) Which is iterative Statement?
(i) Statement 5 (ii) Statement 6
(iii) Statement 8 (iv)There is No iterative Statement.
(e) What will be the output of Python code (Statement 1 to Statement 13)
(i) HeLLo PyThon (ii) No Output
(iii) hEllO pYtHON (iv) Hello Python

Consider the table LOANS given below:

Table: LOANS

AccNo Name Loan Amt EMI IntRate Start Date Interest
1001 R.K. Gupta 300000 36 12.00 19-07-2009 1200
1002 S. P. Shanna 500000 48 10.00 22-03-2008 1800
1003 K.P. Jain 300000 36 NULL 08-03-2007 1600
1004 M.P. Yadav 800000 60 10.00 06-12-2008 2250
1005 S.P. Sinlia 200000 36 12.50 03-01-2010 4500
1006 P. Shanna 700000 60 12.50 05-06-2008 3500
1007 K.S. Dhall 500000 48 NULL 05-03-2008 3800

(a) State the command that will give the output as:

Name
S. P. Shanna
K.S. Dhall
M.P. Yadav
P. Shanna
K.S. Dhall

(i) Select name from LOANS where Name >‘D ’;

(ii) Select name from LOANS where AccNo >1001;

(iii) Select name from LOANS where Loan_Amt >= 500000;

(iv) Select name from LOANS where Loan_Amt >500000 order Loan_AmtDESC;

(b) What will be the output of the following command:

Select name, EMI from LOANS where Loan_Amt >500000 and Int_Rate is NULL;

(c) John has given the following command to display the count of all loan holders whose name ends with “Sharma ”:

Select count() from LOANS where Name like ‘Sharma%’;

But he is not getting the desired result. Help him by finding out the correct command fromthe followings:

(i) Select count(*) from LOANS where name Like ‘Sharma%’;

(ii) Select count(*) from LOANS where name Like ‘%Sharma ’;

(iii) Select count( ) from LOANS where name like ‘%sharma ’;

(iv) Select count(Name) from LOANS where name ‘Sharma%’;

(d) State the command to display the maximum Loan_Amt and Cust_Name :-

(i) Select Max(Cust_Name, Loan_Amt) from LOANS;

(ii) Select Cust_Name, max(LoanAmt) from LOANS;

(iii) Select Cust_Name, max(Loan_Amount) from LOANS;

(iv) Select Cust_name, max(Loan_Amt) from LOANS;

(e) Help Ramesh to display the count of all loan holders whose interest is NULL.

(i) Select Count(*) from LOANS where Int_Rate is NULL.

(ii) Select Count() from LOANS where Interest is NULL.

(iii) Select Count(*) from LOANS where Int_rate = NULL;

(iv) Select Count( ) from LOANS where Interest = NULL;

Web Server is an uncommon PC framework running on HTTP through website pages. The page is a medium to convey information starting with one PC framework then onto the next. The working of the webserver begins from the customer or client. The client sends their request through the web browser to the webserver. Web server takes this request, processes it, and then sends back processed data to the client. The server gathers all of our web page information and sends it to the user, which we see on our Computer System n the form of a web pag(e) When the client sends a request for processing to the web server, a domain name and IP address are important to the webserver. The domain name and IP address are used to identify the user on a large network.

(a) A piece of icon or image on a web page associated with another webpage is called ______

(i)URL (ii) Hyperlink(iii)Plugin(iv)Extension

(b) Web servers are:

(i)IP addresses

(ii)Computer systems

(iii)Webpages of a site

(iv)A medium to carry data from one computer to another.

(c) The _______ translates internet domain and host names to IP address.

(i)Domain name system

(ii)Routing information protocol

(iii)Google

(iv)Networktime protocol

(d) What does the webserver need to send back information to the user?

(i)Home address

(ii) Domain name

(iii)IP address

(iv)Both (ii) and (iii)

(e) What is the full form of HTTP?

(i)Hypertext Transfer Protocol

(ii)Hypertext Transfer Procedure

(iii)Hyperlink Transfer Protocol

(iv)Hyperlink Transfer Procedure