Pandas: Knowing when an operation affects the original dataframe

前端 未结 3 462
孤城傲影
孤城傲影 2020-12-23 02:04

I love pandas and have been using it for years and feel pretty confident I have a good handle on how to subset dataframes and deal with views vs copies appropriately (though

3条回答
  •  眼角桃花
    2020-12-23 02:25

    I have the same doubt, I searched for this response in the past without success. So now, I just certify that original is not changing and use this peace of code to the program at begining to remove warnings:

     import pandas as pd
     pd.options.mode.chained_assignment = None  # default='warn'
    

提交回复
热议问题