從快取中移除 DataFrame
你已經完成對 departures_df DataFrame 的分析任務,但接下來還有其他處理要做。你想把這個 DataFrame 從快取中移除,以免叢集占用過多記憶體。
DataFrame departures_df 已為你定義並且事先放入快取。
本練習屬於課程
使用 PySpark 清理資料
練習說明
- 檢查
departures_dfDataFrame 的快取狀態。 - 將
departures_dfDataFrame 從快取中移除。 - 再次驗證快取狀態。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# 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" % ____)