# Is there a way to update a column of a dataframe to an array in julia?

**URL:** <https://discourse.julialang.org/t/is-there-a-way-to-update-a-column-of-a-dataframe-to-an-array-in-julia/20244>\
**Category:** General Usage\
**Created:** [January 29, 2019, 8:32pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-update-a-column-of-a-dataframe-to-an-array-in-julia/20244 "2019-01-29T20:32:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [January 29, 2019, 8:32pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-update-a-column-of-a-dataframe-to-an-array-in-julia/20244/1 "2019-01-29T20:32:48Z")

</div>

this seems easy, but I can not find any answers. can anyone please let me know?

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [January 29, 2019, 8:52pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-update-a-column-of-a-dataframe-to-an-array-in-julia/20244/2 "2019-01-29T20:52:19Z")

</div>

You can just overwrite it! `df.x = df.x .+ 1`

---

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [January 29, 2019, 9:17pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-update-a-column-of-a-dataframe-to-an-array-in-julia/20244/3 "2019-01-29T21:17:24Z")

</div>

.+1 is because one is a vector and the other one is an element, right?

---

<div class="post-metadata">

**Author:** ![Mattriks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattriks/32/351_2.png) [@Mattriks](https://discourse.julialang.org/u/Mattriks)\
**Post date:** [January 29, 2019, 9:25pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-update-a-column-of-a-dataframe-to-an-array-in-julia/20244/4 "2019-01-29T21:25:01Z")

</div>

also:

```julia
df.x .+= 1

```

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [January 30, 2019, 3:29am UTC](https://discourse.julialang.org/t/is-there-a-way-to-update-a-column-of-a-dataframe-to-an-array-in-julia/20244/5 "2019-01-30T03:29:34Z")

</div>

Yes! “Broadcasting” with the `f.(x)` syntax means that you apply the function `f` to each element of `x` individually.
