A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/15339 below:

df.squeeze() doesn't support axis parameter · Issue #15339 · pandas-dev/pandas · GitHub

Code Sample, a copy-pastable example if possible
>>> df = pd.DataFrame([1], columns=['A'])

>>> df 
   A
0  1

>>> df.squeeze()
1

>>> type(df.squeeze())
numpy.int64

>>> df.squeeze(axis=1)  # Only want to squeeze a single dimension, i.e. into a series
...
ValueError: the 'axis' parameter is not supported in the pandas implementation of squeeze()
Problem description

np.squeeze supports axis parameter and this comment in the source implies it should eventually be implemented.

Expected Output
>>> df.squeeze(axis=1)  # Squeeze a single dimension, i.e. into a series
0    1
Name: A, dtype: int64

>>> df.squeeze(axis=0)
A    1
Name: 0, dtype: int64
Output of pd.show_versions()

pandas: 0.19.0+416.ge1390cd


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4