Skip to content

Commit f0b6b90

Browse files
mzeitlin11feefladder
authored andcommitted
ERR: clarify PerformanceWarning for fragmented frame (pandas-dev#42942)
1 parent 163249a commit f0b6b90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/internals/managers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1178,8 +1178,8 @@ def insert(self, loc: int, item: Hashable, value: ArrayLike) -> None:
11781178
warnings.warn(
11791179
"DataFrame is highly fragmented. This is usually the result "
11801180
"of calling `frame.insert` many times, which has poor performance. "
1181-
"Consider using pd.concat instead. To get a de-fragmented frame, "
1182-
"use `newframe = frame.copy()`",
1181+
"Consider joining all columns at once using pd.concat(axis=1) "
1182+
"instead. To get a de-fragmented frame, use `newframe = frame.copy()`",
11831183
PerformanceWarning,
11841184
stacklevel=5,
11851185
)

0 commit comments

Comments
 (0)