diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 9d50627934bcb..97288c7a6719b 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3939,13 +3939,8 @@ def to_csv( Create 'out.csv' containing 'df' without indices >>> df = pd.DataFrame( - ... { - ... { - ... "name": ["Raphael", "Donatello"], - ... "mask": ["red", "purple"], - ... "weapon": ["sai", "bo staff"], - ... } - ... } + ... [["Raphael", "red", "sai"], ["Donatello", "purple", "bo staff"]], + ... columns=["name", "mask", "weapon"], ... ) >>> df.to_csv("out.csv", index=False) # doctest: +SKIP