# Overwrite the subdataframes made with a for loop

**URL:** <https://discourse.julialang.org/t/overwrite-the-subdataframes-made-with-a-for-loop/65176>\
**Category:** Performance\
**Tags:** question\
**Created:** [July 23, 2021, 1:19pm UTC](https://discourse.julialang.org/t/overwrite-the-subdataframes-made-with-a-for-loop/65176 "2021-07-23T13:19:41Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [July 23, 2021, 3:55pm UTC](https://discourse.julialang.org/t/overwrite-the-subdataframes-made-with-a-for-loop/65176/5 "2021-07-23T15:55:06Z")

</div>

Update, the version with `combine` actually _is_ faster. We were just working with a very small data frame. See below

```julia
actually_large_df = DataFrame(ID = rand(large_df.ID, 100_000), Count = rand(large_df.Count, 100_000));

@btime analysis_ID_better(actually_large_df);
  2.476 ms (258 allocations: 2.54 MiB)

@btime analysis_ID(actually_large_df);
  10.774 ms (136 allocations: 919.75 KiB)

```

---

_[View the full topic](https://discourse.julialang.org/t/overwrite-the-subdataframes-made-with-a-for-loop/65176)._
