You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>>df=pd.DataFrame([1], columns=['A'])
>>>dfA01>>>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'parameterisnotsupportedinthepandasimplementationofsqueeze()
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 series01Name: A, dtype: int64>>>df.squeeze(axis=0)
A1Name: 0, dtype: int64
Output of pd.show_versions()
pandas: 0.19.0+416.ge1390cd
The text was updated successfully, but these errors were encountered:
@kernc how is this actually useful though? numpy needs this because of n-dim shrinking to a lower dim. pandas generally has 2-dim max so this is not so important.
Code Sample, a copy-pastable example if possible
Problem description
np.squeeze
supportsaxis
parameter and this comment in the source implies it should eventually be implemented.Expected Output
Output of
pd.show_versions()
pandas: 0.19.0+416.ge1390cd
The text was updated successfully, but these errors were encountered: