From c5a0db057d44f278fe5d4d8dcb2573eb5ff961f0 Mon Sep 17 00:00:00 2001 From: taytzehao Date: Sun, 8 Nov 2020 16:34:55 +0800 Subject: [PATCH] dataclass comment --- pandas/core/frame.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index bfb633ae55095..7543ea177d58c 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -360,8 +360,8 @@ class DataFrame(NDFrame, OpsMixin): Parameters ---------- - data : ndarray (structured or homogeneous), Iterable, dict, or DataFrame - Dict can contain Series, arrays, constants, dataclass or list-like objects. If + data : ndarray (structured or homogeneous), Iterable, dict, dataclass or DataFrame + Dict can contain Series, arrays, constants, or list-like objects. If data is a dict, column order follows insertion-order. .. versionchanged:: 0.25.0 @@ -426,8 +426,9 @@ class DataFrame(NDFrame, OpsMixin): >>> from dataclasses import make_dataclass >>> Point = make_dataclass("Point", [("x", int), ("y", int)]) - >>> pd.DataFrame([Point(0, 0), Point(0, 3), Point(2, 3)]) - x y + >>> df3 = pd.DataFrame([Point(0, 0), Point(0, 3), Point(2, 3)]) + df3 + x y 0 0 0 1 0 3 2 2 3