Based on this post,extract column value based on another column pandas dataframe, I tried the following: Thanks for contributing an answer to Stack Overflow! To subscribe to this RSS feed, copy and paste this URL into your RSS reader. u'1976', u'1977', u'1978', u'1979', u'1980', u'1981', u'1982', u'1983', Alternatively, if you want to access the value of a cell using its row and column labels, use the at property. If you have a DataFrame with only one row, then access the first (only) row as a Series using iloc, and then the value using the column name: These are fast access methods for scalars: You can turn your 1x1 dataframe into a NumPy array, then access the first and only value of that array: Most answers are using iloc which is good for selection by position. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. u'2016'], While using reindex method on any dataframe why do original values go missing? MathJax reference. How do I select rows from a DataFrame based on column values? What's the cheapest way to buy out a sibling's share of our parents house if I have no cash and want to pay less than the appraised value? By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. Why the obscure but specific description of Jane Doe II in the original complaint for Westenbroek v. Kappa Kappa Gamma Fraternity? By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. The view object contains the values of the dictionary, as a list. df.loc[df["Condition_Column"] == 0, ("Column_1", "Column_2, "Column_3", "Column_4")] works for me. You can use the below code snippet to get a specific cell value. How to Get Cell Value from Pandas DataFrame? Now with 13.1, iloc[0]['label'] gets a single value array rather than a scalar. This is a quick and easy way to get columns. The value you want is located in a dataframe: df [*column*] [*row*] I am kind of getting stuck on extracting value of one variable conditioning on another variable. Note the square brackets here instead of the parenthesis (). values() is an inbuilt method in Python programming language that returns a view object. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. How to add condition to calculate missing value like this? dtype='object'). How to Add Amounts to Cell Values. Lets try this out by assigning the string Under 30 to anyone with an age less than 30, and Over 30 to anyone 30 or older. (Ep. Using the example below: df.loc [df ['B'] == 3, 'A'] Previous: It's easier for me to think in these terms, but borrowing from other answers.