Here is how I encountered the warning:
df.loc[a_list][df.a_col.isnull()]
The type of a_list
is Int64Index
, it contains a list of row indexes. All of these row indexes belong to df
.
The df.a_col.isnull()
part is a condition I need for filtering.
If I execute the following commands individually, I do not get any warnings:
df.loc[a_list]
df[df.a_col.isnull()]
But if I put them together df.loc[a_list][df.a_col.isnull()]
, I get the warning message (but I can see the result):
Boolean Series key will be reindexed to match DataFrame index
What is the meaning of this warning message? Does it affect the result that it returned?