Skip to content

Conversation

phofl
Copy link
Member

@phofl phofl commented Sep 29, 2022

@phofl phofl added Indexing Related to indexing on series/frames, not to indexes themselves Regression Functionality that used to work in a prior pandas version Copy / view semantics labels Sep 29, 2022
@phofl phofl added this to the 1.5.1 milestone Sep 29, 2022
@mroeschke mroeschke added the Warnings Warnings that appear or should be added to pandas label Sep 29, 2022
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
@mroeschke mroeschke merged commit 5a9de8b into pandas-dev:main Sep 29, 2022
@mroeschke
Copy link
Member

Thanks @phofl

@ryan-11055
Copy link

ryan-11055 commented Oct 4, 2022

I receive this warning

'''
FutureWarning: In a future version, df.iloc[:, i] = newvalswill attempt to set the values inplace instead of always setting a new array. To retain the old behavior, use eitherdf[df.columns[i]] = newvalsor, if columns are non-unique,df.isetitem(i, newvals)`
'''

when calling df.update(df2). I'm unclear if this issue (#48853) fixed the warning message and / or if there is a different method I should use to update my dataframe.

@rpkilby
Copy link

rpkilby commented Oct 26, 2022

@ryanlampkin are you using new-style/nullable-dtypes such as string or Int64? I've found that df.update loses the original dtype, demoting the column to object. I think this confuses some internal check in df.update, resulting in the df.loc assignment and this warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Copy / view semantics Indexing Related to indexing on series/frames, not to indexes themselves Regression Functionality that used to work in a prior pandas version Warnings Warnings that appear or should be added to pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: df.fillna(dict, inplace=True) triggers FutureWarning in 1.5.0rc0 when DataFrame is empty
4 participants