|
22 | 22 | "using 'df.method({col: value}, inplace=True)' instead, to perform "
|
23 | 23 | "the operation inplace on the original object.\n\n"
|
24 | 24 | )
|
25 |
| - |
26 |
| - |
27 |
| -_chained_assignment_warning_msg = ( |
28 |
| - "ChainedAssignmentError: behaviour will change in pandas 3.0!\n" |
29 |
| - "You are setting values through chained assignment. Currently this works " |
30 |
| - "in certain cases, but when using Copy-on-Write (which will become the " |
31 |
| - "default behaviour in pandas 3.0) this will never work to update the " |
32 |
| - "original DataFrame or Series, because the intermediate object on which " |
33 |
| - "we are setting values will behave as a copy.\n" |
34 |
| - "A typical example is when you are setting values in a column of a " |
35 |
| - "DataFrame, like:\n\n" |
36 |
| - 'df["col"][row_indexer] = value\n\n' |
37 |
| - 'Use `df.loc[row_indexer, "col"] = values` instead, to perform the ' |
38 |
| - "assignment in a single step and ensure this keeps updating the original `df`.\n\n" |
39 |
| - "See the caveats in the documentation: " |
40 |
| - "https://pandas.pydata.org/pandas-docs/stable/user_guide/" |
41 |
| - "indexing.html#returning-a-view-versus-a-copy\n" |
42 |
| -) |
43 |
| - |
44 |
| -_chained_assignment_warning_method_msg = ( |
45 |
| - "A value is trying to be set on a copy of a DataFrame or Series " |
46 |
| - "through chained assignment using an inplace method.\n" |
47 |
| - "The behavior will change in pandas 3.0. This inplace method will " |
48 |
| - "never work because the intermediate object on which we are setting " |
49 |
| - "values always behaves as a copy.\n\n" |
50 |
| - "For example, when doing 'df[col].method(value, inplace=True)', try " |
51 |
| - "using 'df.method({col: value}, inplace=True)' or " |
52 |
| - "df[col] = df[col].method(value) instead, to perform " |
53 |
| - "the operation inplace on the original object.\n\n" |
54 |
| -) |
0 commit comments