0

I have an csv file like CSV File

I want to get values based on row and column names . For example if I pass C2 & T2 , I should be able to fetch respective value = 6. How this can be done in pandas.

Bharat Sharma
  • 1,081
  • 3
  • 11
  • 23
  • did u try this? http://pythonhow.com/accessing-dataframe-columns-rows-and-cells – MSD Mar 10 '17 at 05:04
  • For your case, it would be - `df.at['T2','C2']` (or) `df.get_value('T2','C2')` – Nickil Maveli Mar 10 '17 at 05:25
  • Adding to @NickilMaveli 's answer, for that to work, your index has to be the Ts column. From the image you provided, that column has no name. You could add Ts or T or something like that in the first cell so that it won't be unnamed and then do `df = pd.read_csv('yourfile.csv', index_col='Ts')`. – sbacarob Mar 10 '17 at 05:31

0 Answers0