# \`transform!\` on a \`SubDataFrame\`

**URL:** https://discourse.julialang.org/t/transform-on-a-subdataframe/83253
**Category:** Data
**Tags:** dataframes
**Created:** [June 23, 2022, 3:07pm UTC](https://discourse.julialang.org/t/transform-on-a-subdataframe/83253 "2022-06-23T15:07:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hdperez](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hdperez/32/37391_2.png) [@hdperez](https://discourse.julialang.org/u/hdperez)
#### Post date: [June 23, 2022, 3:07pm UTC](https://discourse.julialang.org/t/transform-on-a-subdataframe/83253/1 "2022-06-23T15:07:11Z")

</div>

Hi,

I am trying to do an in-place transformation on a subset of a dataframe.

1. `df_filtered_view = filter(args..., df, view = true)`
2. `transform!(df_filtered_view, args...)`

However, it is not possible to use `transform!` on a `SubDataFrame`. I know I can add the filtering column in the `transform!` function to do the filtering subject to some condition. However, since my transformation function uses `ByRow` I thought it would be more efficient to filter and then transform, rather than use `ByRow` on a bunch on unnecessary rows (the rows that don’t meet the filtering criterion don’t need to be modified).

Any thoughts?

---

<div class="post-metadata">

### Author: ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)
#### Post date: [June 23, 2022, 3:15pm UTC](https://discourse.julialang.org/t/transform-on-a-subdataframe/83253/2 "2022-06-23T15:15:19Z")

</div>

`transform!` on `SubDataFrame ` is supported [since version 1.3](https://github.com/JuliaData/DataFrames.jl/blob/e0a1b0ef67196a263d8fed7f674cf0a64b5687d8/NEWS.md#dataframesjl-v13-release-notes). Are you sure you’re on the latest version?

---

<div class="post-metadata">

### Author: ![hdperez](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hdperez/32/37391_2.png) [@hdperez](https://discourse.julialang.org/u/hdperez)
#### Post date: [June 23, 2022, 3:22pm UTC](https://discourse.julialang.org/t/transform-on-a-subdataframe/83253/3 "2022-06-23T15:22:09Z")

</div>

Awesome! I will run the update. I’m on 1.2
