Jump to content

Accessing a value at a row-column position in Pandas DataFrame

Featured Replies

import numpy as np

import pandas as pd



df3 = pd.DataFrame([[0, 2, 3], [0, 4, 1], [10, 20, 30]],


index=[4, 5, 6], columns=['A', 'B', 'C'])


print(df3)

df3.at[4, 'B']

Following is the output:

Quote

    A   B   C
4   0   2   3
5   0   4   1
6  10  20  30

Somebody please guide me, how can i print the value of last statement?

 

I solved this problem:

print(df3.at[4, 'B'])

 

Zulfi.

Edited by zak100

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.