# Replace values in a DataFrame column based on a Dict of corresponding values

**URL:** <https://discourse.julialang.org/t/replace-values-in-a-dataframe-column-based-on-a-dict-of-corresponding-values/62353>\
**Category:** New to Julia\
**Tags:** question, dataframes\
**Created:** [June 3, 2021, 7:38pm UTC](https://discourse.julialang.org/t/replace-values-in-a-dataframe-column-based-on-a-dict-of-corresponding-values/62353 "2021-06-03T19:38:39Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [June 4, 2021, 1:42am UTC](https://discourse.julialang.org/t/replace-values-in-a-dataframe-column-based-on-a-dict-of-corresponding-values/62353/6 "2021-06-04T01:42:43Z")

</div>

A couple of other options were discussed recently here

> [@Transforming a DataFrame column by mapping with a Dict](https://discourse.julialang.org/t/transforming-a-dataframe-column-by-mapping-with-a-dict/61753):
>
> Let’s say I have a DataFrame and a Dict: df = DataFrame( a = 1:3, b = ["beetle", "fly", "spider"]) arthropod\_dict = Dict( "beetle" =\> "insect", "fly" =\> "insect", "spider" =\> "arachnid") And I’d like to apply the Dict like a map to the DataFrame, producing df = DataFrame( a = 1:3, b = ["beetle", "fly", "spider"], c = ["insect", "insect", "arachnid"]) Is there a way to do that using [transform](https://dataframes.juliadata.org/stable/lib/functions/#DataFrames.transform) or another DataFrame function so that I can apply the Dict within a [@…](https://github.com/jkrumbiegel/Chain.jl)

---

_[View the full topic](https://discourse.julialang.org/t/replace-values-in-a-dataframe-column-based-on-a-dict-of-corresponding-values/62353)._
