---
title: write (DataFrame)
description: "DataFrame.write property in PySpark: Interface for saving the content of the non-streaming DataFrame out into external storage."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/dataframe/write
---

# write (DataFrame)

Interface for saving the content of the non-streaming `DataFrame` out into external storage.

## Returns

`DataFrameWriter`

## Examples

```python
df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"])
type(df.write)
# <class '...readwriter.DataFrameWriter'>
```

Write the DataFrame as a table.

```python
df.write.saveAsTable("tab2")
```
