# How to edit row values of a dataframe column based on condition using query.jl

**URL:** https://discourse.julialang.org/t/how-to-edit-row-values-of-a-dataframe-column-based-on-condition-using-query-jl/26437
**Category:** Data
**Created:** [July 16, 2019, 5:36pm UTC](https://discourse.julialang.org/t/how-to-edit-row-values-of-a-dataframe-column-based-on-condition-using-query-jl/26437 "2019-07-16T17:36:42Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [July 17, 2019, 1:26pm UTC](https://discourse.julialang.org/t/how-to-edit-row-values-of-a-dataframe-column-based-on-condition-using-query-jl/26437/2 "2019-07-17T13:26:22Z")

</div>

Please make sure that you quote your code with triple backticks, and ideally include an [MWE](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757) with your question.

DataFrames columns can just be treated as vectors so you can broadcast a `replace` string operation:

```julia
julia> using DataFrames

julia> df = DataFrame(CarCompany = rand(["porsche", "porcshce"], 10))

julia> df.CarCompany = replace.(df.CarCompany, Ref("porcshce" => "porsche"))

julia> unique(df.CarCompany)
1-element Array{String,1}: 
"porsche"

```

---

_[View the full topic](https://discourse.julialang.org/t/how-to-edit-row-values-of-a-dataframe-column-based-on-condition-using-query-jl/26437)._
