I am importing a csv file as a pandas DataFrame. That DataFrame then gets updated and I am trying to write that information back to the original csv file by overwriting the file. After my code completes, I can see the file save time has updated, so it appears to have saved a new version. However, when I open the file, nothing has changed. I have run print statements to ensure that the DataFrame's values have in fact been updated and they appear to be correct. Why would to_csv not send the updated DataFrame?
self.site_data=pandas.read_csv("site_data.csv",index_col=0, keep_default_na=False)
self.site_data.loc[location,"ADDRESS"] = self.location_details["site_address"]
print(self.site_data.loc[location,"ADDRESS"])
self.site_data.to_csv("site_data.csv", encoding="latin")