Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The problem with slicing a dataframe using a single label for both the row and column is that it may return a scalar value instead of a dataframe. This is because pandas will interpret the single label as a request for a single value, rather than a subset of the dataframe. If the label is not present in the dataframe, it will raise a KeyError.