- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 19.2k
Closed
Labels
DeprecateFunctionality to remove in pandasFunctionality to remove in pandasIO CSVread_csv, to_csvread_csv, to_csv
Milestone
Description
I'm pretty sure you can do this directly with a .squeeze() afterwards.
The code does look pretty similar
squeeze()
Lines 979 to 985 in 5f648bf
| axis = range(self._AXIS_LEN) if axis is None else (self._get_axis_number(axis),) | |
| return self.iloc[ | |
| tuple( | |
| 0 if i in axis and len(a) == 1 else slice(None) | |
| for i, a in enumerate(self.axes) | |
| ) | |
| ] | 
vs
read_csv(squeeze=True)
pandas/pandas/io/parsers/readers.py
Lines 1063 to 1064 in 1530210
| if self.squeeze and len(df.columns) == 1: | |
| return df[df.columns[0]].copy() | 
Metadata
Metadata
Assignees
Labels
DeprecateFunctionality to remove in pandasFunctionality to remove in pandasIO CSVread_csv, to_csvread_csv, to_csv