Consider the following python code and write the output for statement S1 import pandas as pd -Technology

1 Answer

Answer :

0.50 8.00.75 11.0

Related questions

Description : Consider a given Series , M1: Write a program in Python Pandas to create the series. -Technology

Last Answer : import pandas as pdm1=pd.Series([45,65,24,89],index=['term1','term2','t erm3','term4'])

Description : Write a program in Python Pandas to create the following DataFrame batsman from a Dictionary: B_NO Name Score1 Score2 -Technology

Last Answer : Alternative Answer

Description : Write a small python code to drop a row from data frame labeled as 0. -Technology

Last Answer : # Drop rows with label 0df = df.drop(0)print(df )

Description : Write a python code to create a data frame with appropriate headings from the list given below : -Technology

Last Answer : import pandas as pd# initialize list of listsdata = [['S101', 'Amy', 70], ['S102', 'Bandhi', 69], ['S104','Cathy', 75], ['S105', 'Gundaho', 82]]# Create the pandas DataFramdf = pd.DataFrame(data, columns = ['ID', 'Name', 'Marks'])# printdataframe. print(df )

Description : Write the code in python to read the contents of “number.csv” file consisting of data from a mysql table and print the data of the table -Technology

Last Answer : f = open('numbers.csv', 'r') with f:reader = csv.reader(f)for row in reader:for e in row:print(e)

Description : Given the following Series S1 and S2: Write the command to find the sum of series S1 and S2 -Technology

Last Answer : print(S1+S2)

Description : Python : Convert Pandas DataFrame to Dictionary -Web-Development

Last Answer : answer:

Description : Python : How to calculate the square root of all elements of a Pandas DataFrame -Web-Development

Last Answer : answer:

Description : Python: Replace all NaN elements in a Pandas DataFrame with 0s. -Web-Development

Last Answer : answer:

Description : Python: how to save a pandas dataframe in a compressed CSV file -Web-Development

Last Answer : answer:

Description : ...method in Pandas can be used to change the index of rows and columns of a Series or Dataframe : -Technology

Last Answer : Correct option(ii)reindex

Description : What is Pivoting? Name any two functions of Pandas which support pivoting. -Technology

Last Answer : Pivoting means to use unique values from specifiedindex/columns to form apex of the resulting dataframe.Pivot() and pivot_table() methods

Description : Given a Pandas series called Sequences, the command which will display the first 4 rows is .... (a) print(Sequences.head(4)) -Technology

Last Answer : (a) print(Sequences.head(4))

Description : In Pandas the function used to check for null values in a DataFrame is ..... -Technology

Last Answer : In Pandas the function used to check for null values in a DataFrame isisnull()

Description : Consider following schedules involving two transactions: S1: r1(X); r1(Y); r2(X); r2(Y); w2(Y); w1(X) S2: r1(X); r2(X); r2(Y); w2(Y); r1(Y); w1(X) Which of the following ... . (3) S1 is not conflict serializable and S2 is conflict serializable. (4) Both S1 and S2 are not conflict serializable.

Last Answer : S1 is not conflict serializable and S2 is conflict serializable.

Description : Consider the following table Furniture. Write SQL commands for the statements (i) to (viii) and write output for SQL queries (ix) and (x). -Technology

Last Answer : SQL commands for the given statements (i) to (viii) ;1. SELECT FCODE, NAME. PRICE FROM Furniture WHERE PRICE < 5000;2. SELECT NAME. PRICE FROM Furniture3.4. WHERE NAME LIKE %table% ;5. SELECT DISTINCT WCODE ... ;15.16. Output for SQL queries (ix) and (x)(ix)SUM(PRICE)6500(x)COUNT(DISTINCT PRICE)5

Description : Find the output of the following Java code snippet after execution of each java statement labelled -Technology

Last Answer : The output is:IN5inin5

Description : Consider the following graph . Write the code to plot it. -Technology

Last Answer : import matplotlib.pyplot as pltplt.plot([2,7],[1,6])plt.show()alternative answerimport matplotlib.pyplot as plta = [1,2,3,4,5,6]b = [2,3,4,5,6,7]plt.plot (a,b)

Description : Write a code to produce the following output. -Technology

Last Answer : ComputerAn electronic machineCPU Brain of computer

Description : Write the HTML code to generate the following output: -Technology

Last Answer : The HTML code isTableABD EG HI

Description : Write the output of the following code : -Technology

Last Answer : [10 12 16 20]

Description : Write a small python codeto create a dataframewith headings(a and b) from the list given below : [[1,2],[3,4],[5,6],[7,8]] -Technology

Last Answer : import pandas as pddf = pd.DataFrame([[1, 2], [3, 4]], columns = ['a','b'])df2 = pd.DataFrame([[5, 6], [7, 8]], columns = ['a','b'])df = df.append(df2)

Description : Import a user-defined module in python -Web-Development

Last Answer : answer:

Description : What is the output of the following piece of code when executed in Python shell? >>> a=("Check")*3 >>> a a) (‘Check’,’Check’,’Check’) b) * Operator not valid for tuples c) (‘CheckCheckCheck’) d) Syntax erro

Last Answer : c) (‘CheckCheckCheck’)

Description : What will be the output of the following Python code? >>> a={4,5,6}>>> b={2,8,6}>>> a+b a) {4,5,6,2,8} b) {4,5,6,2,8,6} c) Error as unsupported operand type for sets d) Error as the duplicate item 6 is present in both sets

Last Answer : Answer: c Explanation: Execute in python shell to verify.

Description : What will be the output of the following Python code? >>> a={5,4}>>> b={1,2,4,5}>>> a

Last Answer : Answer: b Explanation: a

Description : What will be the output of the following Python code? nums = set([1,1,2,3,3,3,4,4])print(len(nums)) a) 7 b) Error, invalid syntax for formation of set c) 4 d) 8

Last Answer : Answer: c Explanation: A set doesn’t have duplicate items.

Description : What will be the output of the following Python code? >>>t = (1, 2) >>>2 * t a) (1, 2, 1, 2) b) [1, 2, 1, 2] c) (1, 1, 2, 2) d) [1, 1, 2, 2]

Last Answer : Answer: a Explanation: * operator concatenates tuple.

Description : What will be the output of the following Python code? d = {"john":40, "peter":45} d["john"] a) 40 b) 45 c) “john” d) “peter”

Last Answer : Answer: a Explanation: Execute in the shell to verify.

Description : What will be the output of the following Python code? >>>t = (1, 2, 4, 3, 8, 9) >>>[t[i] for i in range(0, len(t), 2)] a) [2, 3, 9] b) [1, 2, 4, 3, 8, 9] c) [1, 4, 8] d) (1, 4, 8)

Last Answer : Answer: c Explanation: Execute in the shell to verify.

Description : What will be the output of the following Python code? >>>t=(1,2,4,3) >>>t[1:-1] a) (1, 2) b) (1, 2, 4) c) (2, 4) d) (2, 4, 3)

Last Answer : Answer will be (2,)

Description : What will be the output of the following Python code? >>>t=(1,2,4,3) >>>t[1:3] a) (1, 2) b) (1, 2, 4) c) (2, 4) d) (2, 4, 3)

Last Answer : Answer: c Explanation: Slicing in tuples takes place just as it does in strings.

Description : What will be the output of the following Python code snippet? d1 = {"john":40, "peter":45} d2 = {"john":466, "peter":45} d1 > d2 a) True b) False c) Error d) None

Last Answer : Answer: c Explanation: Arithmetic > operator cannot be used with dictionaries.

Description : What will be the output of the following Python code snippet? d1 = {"john":40, "peter":45} d2 = {"john":466, "peter":45} d1 == d2 a) True b) False c) None d) Error

Last Answer : Answer: b Explanation: If d2 was initialized as d2 = d1 the answer would be true.

Description : What will be the output of the following Python code snippet? d = {"john":40, "peter":45} "john" in d a) True b) False c) None d) Error

Last Answer : Answer: a Explanation: In can be used to check if the key is int dictionary.

Description : What will be the output of the following Python code snippet? d = {"john":40, "peter":45} a) “john”, 40, 45, and “peter” b) “john” and “peter” c) 40 and 45 d) d = (40:”john”, 45:”peter”)

Last Answer : Answer: b Explanation: Dictionaries appear in the form of keys and values.

Description : Consider the following statements for priority queue: S1: It is a data structure in which the intrinsic ordering of the elements does determine the result of its basic operations. S2: The elements of a priority queue ... . (C) SI is incorrect and S2 is correct. (D) Both S1 and S2 are correct.

Last Answer : (D) Both S1 and S2 are correct.

Description : Consider the following statements S1 and S2 : S1 : A hard handover is one in which the channel in the source cell is retained and used for a while in parallel with the channel in the target cell. S2 : A soft handover ... and S2 is true. (C) Both S1 and S2 are true. (D) Both S1 and S2 are not true.

Last Answer : (D) Both S1 and S2 are not true.

Description : Consider the following statements : S1: A queue can be implemented using two stacks. S2: A stack can be implemented using two queues. Which of the following is correct ? (A) S1 is correct and S2 is not correct. ( ... S2 is correct. (C) Both S1 and S2 are correct. (D) Both S1 and S2 are not correct.

Last Answer : (C) Both S1 and S2 are correct.

Description : With the inputs shown below, what will be the output of S1, S2, and C2?

Last Answer : MSD of the sum.

Description : Consider the following database: Product Code Product Name Date of sale QtySold Customer Name Amount -Technology

Last Answer : 1. Qty Sold and Amount fields2. ProductCode field3. Date/Time data type4. ProductCode, ProductName and CustomerName fields5. 6 fields and 5 records6. Validation Rule

Description : What is the output of the following segment of the HTML code? -Technology

Last Answer : Output• MANGO• APPLE• GRAPES

Description : Will the output from the following two code be any different? -Technology

Last Answer : Yes it will be different as in First Code there will be no output while in Second Code the output will be 2 because in while loop condition is false in the beginning so control will not come inside ... once while in do while loop, loop will be executed at least once even if the condition is false.

Description : Predict the output of the following code: -Technology

Last Answer : The Output is:05

Description : What will be an output of the following code if value of variable application is 1? switch(application) -Technology

Last Answer : The output is:OS

Description : Predict the output displayed in text fields named jTextField2 and jTextField3 after running the above code. -Technology

Last Answer : (i) GREEN WORLD, CLEAN WORLD76 more characters can be entered(ii)length(),toUpperCase()

Description : Find the output of the following code -Technology

Last Answer : a bfirst 10 20second 6 32a b1first 10 NaNsecond 6 NaN

Description : Will the output from the following two code be any different? -Technology

Last Answer : Yes it will be different as in First Code there will be no output while in Second Code the output will be 2 because in while loop condition is false in the beginning so control will not come inside ... once while in do while loop, loop will be executed at least once even if the condition is false.

Description : Predict the output of the following code: -Technology

Last Answer : Output:05

Description : Find output of the following Java code snippet : -Technology

Last Answer : OutputDelhi 110001 10001