[Solved] Write a code statement to list the value of a cell in the 5th row and “item”column from a dataframe “sales”.

   RSS

1
Topic starter

Write a code statement to list the value of a cell in the 5th row and “item”column from a dataframe “sales”.

This topic was modified 1 year ago by CodeWithBishal-admin
1 Answer
1
Topic starter
import pandas as pd

salesDict = {
    'item':["A","B","C","D","E","F"],
    'sales':[10,12,50,10,5,90]
}

sales = pd.DataFrame(salesDict)

print(sales.item[4]) #for fifth row
This post was modified 1 year ago 3 times by CodeWithBishal-admin