Skip to content

Where are the docs for idiots like me? #62243

@hunterhogan

Description

@hunterhogan
c:\apps\mapFolding\mapFolding\algorithms\mmPandas.py:48: FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
A typical example is when you are setting values in a column of a DataFrame, like:

df["col"][row_indexer] = value

Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`.

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

  dataframeCurveLocations['analyzed'] = 0

Ok, df.loc[row_indexer, "col"] = values. I can do that. I don't have a row indexer, so it's easy: dataframeCurveLocations.loc['analyzed'] = 0.

...
TypeError: Cannot perform 'and_' with a dtyped [float64] array and scalar of type [bool]

I don't have float or scalar bool in the module, so I got the wrong cow.

I'll read the documentation in the error message.

Compare these two access methods:

dfmi['one']['second']
Out[384]: 
0    b
1    f
2    j
3    n
Name: second, dtype: object
dfmi.loc[:, ('one', 'second')]
Out[385]: 
0    b
1    f
2    j
3    n
Name: (one, second), dtype: object 

I don't know what to compare between the two. They look the same to me.

These both yield the same results...

So they are the same?

Why does assignment fail when using chained indexing?

I don't even know what chained indexing means. I thought the topic was "Returning a view versus a copy." In dataframeCurveLocations['analyzed'] = 0, how does 0 have a view or a copy?

Image

Nah, man. If I were in the mood to be abused and told that if I really needed help, I would have done things the right way, I would call one of my parents: I don't need StackOverflow for that.

profile for hunterhogan on Stack Exchange, a network of free, community-driven Q&A sites

So, where are the stupid-people docs? After three days of trying, I don't understand. Copilot in VS Code doesn't understand: Claude Sonnet 4, GPT-5 (Preview), MCP context7, weblinks to pandas.pydata.org. I don't get it.

I don't want help fixing this warning. I have tons of problems, so I need the dumbed-down docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions