With the help panda library create a dataframe using the concept of dictionary of lists where Keys and Values of dictionary take the data as mention above in the figure and perform the following operations a) Print All columns name from the dataframe and change the b) Display top 7 and bottom 7 rows of first 3 and last 3 columns c) Write the python code statement to print the value “21-Jan-12” from dataframe. d) Write the python code statement to print the values 2nd,4th ,6th , 8th and 10th row for the column “No of Hours” e) Display the total sum of column total_payout.
import pandas as pd
# dictionary
details = {
'Ruiru' : 22,
'Pablo' : 21,
'hacker' : 23,
'Vicar' : 23
}
df = pd.DataFrame(list(details.items()))
df.columns = ['Name','scores']
print(df.columns)
Kindly, provide the dataset for this question
Comments
Leave a comment