Question: I have two DataFrame A and B as-

```
table_a = pd.DataFrame({
    'unique_id':[3823762,3976695,4199277,4201777,4202712],
    'full_name':['A','B','C','D','E'],
    'freq_match_it':[np.NaN,np.NaN,np.NaN,np.NaN,np.NaN],
    'address':['hyd','jgl','krmr','wl','ktk']
})

```

```
table_b = pd.DataFrame({
    'unique_id':[419434,4201777,784744,4202712,10000],
    'freq_match_it':[12,15,8,5,100]

})

```

Here I would like to fill in `freq_match_it` column in `table_a` whose `unique_id`s exist in `table_b` using a left join in pandas as

```
pd.merge(table_a,table_b,how='left',on='unique_id')

```

it shows as-

[![enter image description here](https://i.stack.imgur.com/It0OP.png)](https://i.stack.imgur.com/It0OP.png)

Here it has created an extra column `freq_match_it_y` and I want to fill in the already existing column `freq_match_it` rather than create an additional column.

The expected output is

[![enter image description here](https://i.stack.imgur.com/gXs1b.png)](https://i.stack.imgur.com/gXs1b.png)

Answer: 
> 
> I think inside function, the passed argument is assigned to function parameter
> 
> 
> 

No. The arguments are essentially local variables of the called function, *except they are created by the caller before* the execution goes into the function. The function does not even know how they were constructed.

> 
> why does function use copy constructor?
> 
> 
> 

So this assumption is wrong, the function does not use copy constructor on its arguments. *The caller does* (if argument is a variable and passed by value, so copy needs to be made).
First of all, it's inaccurate to say that a copy constructor is called.

Let me give some examples:

```
void foo(string b);
...
{
    string a = "asdf";
    foo(a); // copy constructor is called to make string b
    foo(std::move(a)); // move constructor is called to make string b
    foo("asdfg"); // the string b is constructed inplace from "asdfg"
}

```

Basically, `foo` has the `string` as a local parameter and it needs to be constructed in some way. How exactly it is constructed is defined by the call.