英文:
Recover CSV-File in Jupyter that was overwritten
问题
我使用JupyterLab,不小心覆盖了环境中的现有CSV文件。
在我的环境中,一开始有一个名为"data.csv"的文件,我已将其上传到我的环境。现在我不小心在Jupyter笔记本中执行了以下行:
df.to_csv("data.csv")
因此,"data.csv"文件被覆盖为"df"变量(错误的数据框架)的内容。有办法恢复到"data.csv"文件的旧版本吗,还是这个数据集现在丢失了?
谢谢!
英文:
I work with JupyterLab and have accidentally overwritten an existing CSV-File in my environment.
In my environment, there was a "data.csv"-file at first which I have uploaded to my environment.
Now I accidentally executed the following line in my Jupyter-Notebook:
df.to_csv("data.csv")
So the "data.csv"-File was overwritten with the content of the "df" variable (the wrong dataframe).
Is there a way to get back the old version of the "data.csv" file or is this dataset now lost?
Thanks in advance!
答案1
得分: 1
这取决于您的系统设置,而不是 Jupyter。如果您的文件夹是通过 OneDrive 等同步的,可能会有可用的文件历史记录,您可以还原。
我假设该文件不是 Git 存储库的一部分。如果是的话,那将是明显的解决方案。
英文:
This depends not on Jupyter but on your system setup. If your folder was synchronized in, for example, OneDrive there will probably be a file history available which you can restore.
I assume that the file was not part of a Git repo. If so, that would be the obvious solution.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论