pandas-in-action icon indicating copy to clipboard operation
pandas-in-action copied to clipboard

when transform the pandas.Series into pandas.DataFrame in chapter_03_series_methods.ipynb

Open huggingstar opened this issue 2 years ago • 2 comments

chapter_03_series_methods.ipynb the code in the In [4]

pd.read_csv("pokemon.csv", index_col = "Pokemon", squeeze = True)

will prompt like this:

FutureWarning: The squeeze argument has been deprecated and will be removed in a future version. Append .squeeze("columns") to the call to squeeze.

according to Pandas docs, in Pandas 1.4.0 and later, it should be revised as

pd.read_csv('pokemon.csv', index_col='Pokemon').squeeze(1)

huggingstar avatar Mar 17 '22 08:03 huggingstar

pd.read_csv('pokemon.csv', index_col='Pokemon').squeeze('columns') will work in pandas 1.4.0 and later

JPL-JUNO avatar Jun 11 '23 12:06 JPL-JUNO

what if i have a single column it's not working for single column @JPL-JUNO

AbChatterjee04 avatar Jun 16 '23 08:06 AbChatterjee04