Selecting a categorial column returns a DataFrame #12998
Labels
Bug
Categorical
Categorical Data Type
Duplicate Report
Duplicate issue or pull request
Indexing
Related to indexing on series/frames, not to indexes themselves
I am not 100% sure if this is a bug, but it generates very unexpected behaviour!
Essentially, if columns are of type Categorical, selecting a single one using df[column_name] a DataFrame is returned, unlike for columns of other types, for which a Series would be returned.
Code Sample, a copy-pastable example if possible
produces
Expected Output
output of
pd.show_versions()
pandas: 0.18.0
The text was updated successfully, but these errors were encountered: