开始使用免费开始使用

从缓存中移除 DataFrame

您已经完成了对 DataFrame departures_df 的分析任务,但还有其他处理要做。您希望将该 DataFrame 从缓存中移除,避免在集群上占用多余内存。

DataFrame departures_df 已为您定义并完成缓存。

本练习是课程的一部分

使用 PySpark 进行数据清洗

查看课程

练习说明

  • 检查 departures_df DataFrame 的缓存状态。
  • departures_df DataFrame 从缓存中移除。
  • 再次验证其缓存状态。

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Determine if departures_df is in the cache
print("Is departures_df cached?: %s" % departures_df.____)
print("Removing departures_df from cache")

# Remove departures_df from the cache
____

# Check the cache status again
print("Is departures_df cached?: %s" % ____)
编辑并运行代码