jupyter里导入csv文件后电脑里的源文件可以删除吗
时间: 2023-10-07 09:09:47 浏览: 186
在 Jupyter Notebook 中导入 CSV 文件后,导入的数据将会存储在内存中而不是硬盘上,因此您可以在电脑中删除源文件而不影响已经导入的数据。但是,如果您希望在以后继续使用这些数据,建议您将其保存到另一个文件中以备后用。您可以使用 Pandas 库中的 `to_csv()` 方法将数据保存到 CSV 文件中,例如:
```python
import pandas as pd
# 从 CSV 文件中读取数据
data = pd.read_csv('example.csv')
# 对数据进行处理
# 将处理后的数据保存到 CSV 文件中
data.to_csv('processed_data.csv', index=False)
```
在执行上述代码后,处理后的数据将会保存到 `processed_data.csv` 文件中,您可以随时使用该文件中的数据而不必担心源文件的丢失。
阅读全文
相关推荐















