From 1f1d903ebf6424ed74980209647ca2174219d815 Mon Sep 17 00:00:00 2001 From: YeahNew <15927907987@163.com> Date: Thu, 2 Dec 2021 15:11:00 +0800 Subject: [PATCH 1/2] Added the note of class DataFrame --- pandas/core/frame.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 12c6eaa86552f..cf9294628586a 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -472,7 +472,9 @@ class DataFrame(NDFrame, OpsMixin): data : ndarray (structured or homogeneous), Iterable, dict, or DataFrame Dict can contain Series, arrays, constants, dataclass or list-like objects. If data is a dict, column order follows insertion-order. If a dict contains Series - which have an index defined, it is aligned by its index. + which have an index defined, it is aligned by its index.For best performance, + iterable objects, such as a Pytorch Tensor, that can efficiently be converted to a Numpy Array, + should be converted before passing it to pd.DataFrame. .. versionchanged:: 0.25.0 If data is a list of dicts, column order follows insertion-order. From ca65305c93ccf5ff500ae619006062e9cb73e35c Mon Sep 17 00:00:00 2001 From: YeahNew <15927907987@163.com> Date: Thu, 2 Dec 2021 15:36:31 +0800 Subject: [PATCH 2/2] modify the note of class DataFrame --- pandas/core/frame.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index cf9294628586a..e7e0856b564a7 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -473,8 +473,8 @@ class DataFrame(NDFrame, OpsMixin): Dict can contain Series, arrays, constants, dataclass or list-like objects. If data is a dict, column order follows insertion-order. If a dict contains Series which have an index defined, it is aligned by its index.For best performance, - iterable objects, such as a Pytorch Tensor, that can efficiently be converted to a Numpy Array, - should be converted before passing it to pd.DataFrame. + iterable objects, such as a Pytorch Tensor, that can efficiently be converted + to a Numpy Array,should be converted before passing it to pd.DataFrame. .. versionchanged:: 0.25.0 If data is a list of dicts, column order follows insertion-order.