Python Forum
Copy a column from one dataframe to another dataframe
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Copy a column from one dataframe to another dataframe
#13
You are correct and I am wrong. I earned the way t copy a dataframe (deep copy actually) and have it stand alone and not be changed, by any
changes to the original template.

It works perfectly.


However, the final command which was given to me in this series of posts it still throwing errors. The error is:

Error:
ndexError Traceback (most recent call last) Input In [14], in <cell line: 1>() ----> 1 df["machine_status"] = df1["machine_status"] IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
I am still not getting the line to work. What is the cause of this error?

Thanks in advance.

Respectfully,

LZ
Reply


Messages In This Thread
RE: Copy a column from one dataframe to another dataframe - by Led_Zeppelin - Jul-08-2022, 02:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Most efficient way to roll through a pandas dataframe? sawtooth500 1 130 Jun-07-2024, 03:37 AM
Last Post: sawtooth500
  FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries sawtooth500 14 1,434 Apr-24-2024, 01:42 AM
Last Post: sawtooth500
  Why is the copy method name in python list copy and not `__copy__`? YouHoGeon 2 407 Apr-04-2024, 01:18 AM
Last Post: YouHoGeon
  Elegant way to apply each element of an array to a dataframe? sawtooth500 7 655 Mar-29-2024, 05:51 PM
Last Post: deanhystad
  Dataframe copy warning sawtooth500 4 519 Mar-25-2024, 11:38 PM
Last Post: sawtooth500
  FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries i sawtooth500 3 2,723 Mar-22-2024, 03:08 AM
Last Post: deanhystad
  Adding PD DataFrame column bsben 2 437 Mar-08-2024, 10:46 PM
Last Post: deanhystad
  Python Alteryx QS-Passing pandas dataframe column inside SQL query where condition sanky1990 0 845 Dec-04-2023, 09:48 PM
Last Post: sanky1990
  Comparing Dataframe to String? RockBlok 2 522 Nov-24-2023, 04:55 PM
Last Post: RockBlok
  Filter data into new dataframe as main dataframe is being populated cubangt 8 1,221 Oct-23-2023, 12:43 AM
Last Post: cubangt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020