[Python] Make a copy of a pandas series whose elements contain class objects and update only...

Discussão em 'Python' iniciado por Stack, Setembro 15, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to create a copy of a pandas series whose elements contain instances of a given class. I do so with the following command

    duplicateSeries = originalSeries.copy()


    Now, when i go to make changes in the elements of the duplicateSeries, such as changes in a series within a class instance, the corresponding elements of the originalSeries also gets updated.

    How can I prevent this from happening?

    Continue reading...

Compartilhe esta Página