Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

Why does feature created in a temp dataframe get created in original dataframe as well

$
0
0

@mohitlearns wrote:

Hello,

I am using the following technique to add a new Feature/ Field.

for temp_df in full_data_df:
temp_df[“Family”] = temp_df[“Sibsp”]+temp_df[“Parch”]+1

full_data_df- exist already.

My questions:

  1. why does Family feature/field gets added to full_data_df as well since I am only adding it to temp_df

  2. how to check if a dataframe is a reference to the original object

  3. in the for loop does dataframe (full_data_df) pass the data in temp_df one series at a time

thanks

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles