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:
In [3]: sub_df
Out[3]:
A B
2 -0.133653 -0.030854
In [4]: sub_df.iloc[0]
Out[4]:
A -0.133653
B -0.030854
Name: 2, dtype: float64
In [5]: sub_df.iloc[0]['A']
Out[5]: -0.13365288513107493
Related Contents:
- Pandas conditional creation of a series/dataframe column
- Multiple aggregations of the same column using pandas GroupBy.agg()
- How to replace NaN values by Zeroes in a column of a Pandas Dataframe?
- How to add pandas data to an existing csv file?
- Error: pandas hashtable keyerror
- Writing a pandas DataFrame to CSV file
- Convert Pandas column containing NaNs to dtype `int`
- Efficient way to unnest (explode) multiple list columns in a pandas DataFrame
- Why isn’t my Pandas ‘apply’ function referencing multiple columns working? [closed]
- How can I split a column of tuples in a Pandas dataframe?
- Reshape wide to long in pandas
- Shuffle DataFrame rows
- What is the fastest way to upload a big csv file in notebook to work with python pandas?
- Reversing ‘one-hot’ encoding in Pandas
- How to deal with multi-level column names downloaded with yfinance
- Find maximum value of a column and return the corresponding row values using Pandas
- Pandas DataFrame stack multiple column values into single column
- Group duplicate column IDs in pandas dataframe
- Convert pandas Series to DataFrame
- Row-wise average for a subset of columns with missing values
- Pandas split column into multiple columns by comma
- How do I count the NaN values in a column in pandas DataFrame?
- pandas groupby without turning grouped by column into index
- Pandas select rows and columns based on boolean condition
- Extract column value based on another column in Pandas
- Get total of Pandas column
- Python Pandas: Get index of rows where column matches certain value
- Get column index from column name in python pandas
- How to merge multiple dataframes
- return max value from pandas dataframe as a whole, not based on column or rows
- Pandas: Shift down values by one row within a group
- Pandas compare next row
- vectorize conditional assignment in pandas dataframe
- UnicodeDecodeError when reading CSV file in Pandas
- Shift column in pandas dataframe up by one?
- How can I use cumsum within a group in Pandas?
- Python Pandas How to assign groupby operation results back to columns in parent dataframe?
- Subtract two columns in dataframe
- Selecting/excluding sets of columns in pandas [duplicate]
- Writing large Pandas Dataframes to CSV file in chunks
- Pandas won’t fillna() inplace
- Python Pandas: Convert “.value_counts” output to dataframe
- pandas – find first occurrence
- Convert Pandas Series to DateTime in a DataFrame
- Dynamically filtering a pandas dataframe
- Extracting dates that are in different formats using regex and sorting them – pandas
- Remove NaN/NULL columns in a Pandas dataframe?
- Python pandas: how to remove nan and -inf values
- Pretty print a pandas dataframe in VS Code
- How to calculate mean values grouped on another column