0% found this document useful (0 votes)
20 views5 pages

Ip

It's ip project for class 12 with all details

Uploaded by

kj946326
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
20 views5 pages

Ip

It's ip project for class 12 with all details

Uploaded by

kj946326
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
31 d. None of the above Which of the followin a, import pandas b. import pandas as pd ¢. import pandas as pds d._all of the above Fill in the blanks to get the output as 3 >>>import pandas as pnd correct? >>>s1=pnd.Series({1, 2, 3, 4], index=['a’, 'b’, ‘c’,‘d’]) >>>print(s1L_)) b 4. All of these We can access elements in the Series by using index and __ index. ‘a, Numeric, labelled b. Positional, ©. Positional, labelled d. None of these Write the output of the following code: import pandas as pd s1=pd.Series({'New Delhi’, ‘WashingtonDe’, ‘London’, ‘Par '), index=[India’ print(s1 India’ a. India NewDelhi UK London dtype‘object b, India NewDelhi UK Washingthon dtype: object ©. Error d. None of the mentioned $1.Values will return all the values of the series $1 in a. List b. Tuple ¢. Dictionary 4. String Prodict the output >>> import pandas as pd >>> s1=pd.Series( >>> pds vries(),empty a. True b. False ¢. Error d. None Predict the output >>>import pandas as pd 35 36 39 40 Al) >>> sl=pd Series (lL >>> s2=pd Seriest{7,8) >>> aSeslts2 >>> print(s3.size b. a. 2 4 6 Error Which method is used to add two series in pandas? a. sum() b, addition() c. add) d. none When an operation is carried out on every value of Series Object is called. a. Scalar operation b, Vector operation c. Both d. none What is the index of 81 in given series $1? >>>import pandas as pd >>> s1=pd Series({1,2,31 4], index=la’, b,c, a’) b.2 c. Both d. None Following two statement will produce same output >>> 2a] is a list >>>s]*2its1 is a series a, True b. False c. On d. Off Minimum number of argument we require to pass in pandas series? a. 0 b. 1 ce 2 a3 Choose the correct function to rename city column to location using rename( function. a. dfrename(eolumns: location’) ‘location’}) c. dfrenameCeity’ = ‘loc d. rename(city=location) Choose the right way to install pandas library: a install pandas b, pandas install python c. python install pandas d. none A Dataframe df already exists, choose the correct code to add a column marks with values [56,76, a. difmarks]=156, 76, 82] b, df-marks c. marks . none Write a code statement to list the value of a cell in 5" vow and ‘item column from a a. Sales.item|4] b. sales.item[5) c. sales.itemsl] d. none ‘The functions to iterate over DataFrames a. for, while b. iterrows0. Iteritems( ©. for, iter d. none Point out the correct statement: a. if data isa list, if index is passed the values in data corresponding to the labels in the index will be pulled out. b. NaN is the standard missing data marker used in pandas. ¢. Series acts very similar to array . None of the mentioned A panel is container of data. a, 1D b. 2D ce. 3D d. infinite Which of the following is true: a. if data is an ndarray, index must be the same length as data, bs, Series is a one-dimensional labelled array capable of holding any data type. c. Both aand b d. None Directions: ‘Two statements A and R are given. Read the statements and choose the correct option a. Both A and R are true and R is the correct explanation of A b, Both A and R are true but R is not the correet explanation o! c. Ais true but R is false d. Ais false but R is True Assertion A: Pandas is a popular data-science library of Python. Reason R: A series is a Pandas data structure that represents data. Assertion A: In a DataFrame Axis=1 represents the column elements. Reason R: To access values using row labels you cam use DE.open. Assertion A: While series is a one-dimensional data structure object, DataFrame is a multi-dimensional data structure. Reason R: A series object is value mutable. Assertion A: To get the number of dimensions of a Series object, ndim attribute is displayed. Reason R: To get the size of the datatype of the items in series object, you can display index attribute. Assertion A: The axis 0 identifies a DataFrame's rows. Reason R: The axis 1 identifies a DataFrames’s columns. Case Study: Pandas Data Structure: A data structure is a particular way of storing and organising data in a computer to suit a specific purpose so that it can be accessed and worked with in appropriate ways. Pandas offer many data structures to handle a variety of data. At very basic level, Pandas dat structure can be thought of somewhat as enhanced version of Numpy structured arrays in which the rows and columns can be identified and accessed with labels rather than simple integer indices. Out of many data structures of Pandas, 2 basic data structure and are universally popular for their dependability. i.” Series, dataframe ii, 1d array and 2D array DataFrame is a data structure of Python Pandas. i 1-Dimensioan! ii. 2-Dimensional When numeri indexes can depict positions of data in the objects (e.g. when indexes go as 0, 1 ), they are called. i, Labelled indexes ii, Positional indexes iii Both i and ii iv. None Mr. Ankit is working in an organisation as data analyst. He uses Python Pandas and Matplotlib for the same, He got a dataset of the passengers for the year 2010 to 2012 for January, March and December. His manager wants certain information from him, but he is facing some problems. Help Year Month Passengers him by 2010 Jan 25 answering Mar few Jon 30 questions Dee 5 given Dee 5 below: Code to create the above dataframe: import pandas as fistatement 1 data= {"Year": [2010, 2010, 2012, 2010, 2012], “Month”: [Jan’ Mar’, ‘Jan’, ‘Dee’, ‘Dec'], “Passengers”: [25, 50, 35, 55, 65 Yd. (data) #statement print(d) a. Choose the right code from the following for statement 1 Choose the right code for statement 2 i, DataArray ii, DataFrame iv. Dictionary Choose the correct statement/method for the required output: (5,3) i. df.index ii df.shapeQ iii, df.shape iv. dfsize

You might also like