persist(storageLevel: pyspark.storagelevel.StorageLevel = StorageLevel(True, True, False, True, 1)) → pyspark.sql.dataframe.DataFrame¶
Sets the storage level to persist the contents of the
DataFrameacross operations after the first time it is computed. This can only be used to assign a new storage level if the
DataFramedoes not have a storage level set yet. If no storage level is specified defaults to (MEMORY_AND_DISK_DESER)
The default storage level has changed to MEMORY_AND_DISK_DESER to match Scala in 3.0.