df.drop(..., inplace=True) does modify df inplace, but due to the
way inplace operations are implemented in Pandas, there is no real
advantage to doing this over the more straight-forward reassignment to
variable names. Personally I prefer functions that return values over
functions that modify values, since with the former the assignment
syntax makes it utterly clear what is getting modified.
您可以将^{} 用于就地操作:
但这可能无济于事。根据@unutbu's comment:
这将在Jeff's answer中进一步解释。你知道吗
此外,请注意,此方法不适用于重复索引。你知道吗
相关问题 更多 >
编程相关推荐