Informatics Practices

Write code statements to list the following, from a dataframe namely sales:

(a) List only columns 'Item' and 'Revenue'.

(b) List rows from 3 to 7.

(c) List the value of cell in 5th row, 'Item' column.

Python Pandas

8 Likes

Answer

(a)

>>> sales[['Item', 'Revenue']]

(b)

>>> sales.iloc[2:7]

(c)

>>> sales.Item[4]

Answered By

3 Likes


Related Questions