- DataFrame’s different columns can have data of:
- Different Type
- Same Type
- Both
- None of these
- DataFrame is :
- Value Mutable
- Size Mutable
- Both I & II
- Immutable
- A method that simply renames the index and/or column labels in DataFrame is called
- rename()
- reindex()
- reindex_like()
- None of these
- Fill the blank for getting the below output (consider all the necessary files are imported):
d1={'Turor':['Tahira','Gurjyot','Anusha','Jacob','Venkat'], 'Classes':[28,36,41,32,40], 'Country':['USA','UK','Japan','USA','Brazil'] } df1 = pandas.DataFrame(d1) df2=df1.pivot_table( ______________________________________ ) print(df2) Output: Country Brazil 40 Japan 41 UK 36 USA 60
- Write the output of the following (consider all the necessary files are imported):
df=pandas.DataFrame(['A',33,11,2,11,223,11,'A',11,11,11]) print(df) print(df.mode(numeric_only=True))
- Hitesh wants to display the last four rows of the dataframedf and has written the following code :
df.tail()
But last 5 rows are being displayed. Identify the error and rewrite the correct code so that last 4 rows get displayed. - Write the command using Insert() function to add a new column in the last place(3rd place) named “Salary” from the list Sal=[10000,15000,20000] in an existing dataframe named EMP already having 2 columns.
- Write a small python code to drop a row from dataframe labeled as 0.
No comments:
Post a Comment