# Append!() with two dataframe throws PooledArray error

**URL:** <https://discourse.julialang.org/t/append-with-two-dataframe-throws-pooledarray-error/24850>\
**Category:** General Usage\
**Created:** [June 2, 2019, 11:23am UTC](https://discourse.julialang.org/t/append-with-two-dataframe-throws-pooledarray-error/24850 "2019-06-02T11:23:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![notpeerreviewed](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@notpeerreviewed](https://discourse.julialang.org/u/notpeerreviewed)\
**Post date:** [June 2, 2019, 11:23am UTC](https://discourse.julialang.org/t/append-with-two-dataframe-throws-pooledarray-error/24850/1 "2019-06-02T11:23:23Z")

</div>

Hi everyone,

I’m very new to Julia and have been working through replicating a relatively simple R script in Julia 1.0.  
Currently it’s a data cleaning exercise and I’ve been using DataFrames and DataFramesMeta, as I am most comfortable using dplyr type syntax.

I’ve read in some data from a csv file, executed a few melt, unstack, and filter type operations and now I have two dataframes that I want to row bind. I’ve tried the append! function but for some reason it won’t work. I can just use the standard [df1; df2] approach to concatenate, but I’d like to understand why the append! function fails.

I’ve ensured that the column types in both dataframes are identical, but I don’t know how to check for further properties of the dataframes that could be causing issues. If I was using R I’d suspect the issue was something like one of the dataframes being grouped, except I haven’t grouped either dataframe. I’m not sure of what pooling is exactly except that it appears it is used as a memory saving device when referencing strings in a dataframe. I don’t know why this would cause an issue with appending one dataframe to another.

Is anyone able to suggest how I could go about investigating this further? Is there a way to me to check if a dataframe is pooled?

I can’t share the data just yet as it is a bit sensitive and I haven’t had a chance to try to replicate the error.

Cheers

Jeff

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [June 2, 2019, 11:28am UTC](https://discourse.julialang.org/t/append-with-two-dataframe-throws-pooledarray-error/24850/2 "2019-06-02T11:28:53Z")

</div>

This is a bug and will be fixed soon. See [https://github.com/JuliaComputing/PooledArrays.jl/pull/23](https://github.com/JuliaComputing/PooledArrays.jl/pull/23).

A temporary solution is to convert the offending columns into vectors:

```julia
for (name, col) in eachcol(df, true)
    col isa PooledArray && (df[name] = Vector(col))
end

```

---

<div class="post-metadata">

**Author:** ![notpeerreviewed](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@notpeerreviewed](https://discourse.julialang.org/u/notpeerreviewed)\
**Post date:** [June 3, 2019, 4:32am UTC](https://discourse.julialang.org/t/append-with-two-dataframe-throws-pooledarray-error/24850/3 "2019-06-03T04:32:27Z")

</div>

Thanks for that. Glad to know it’s a bug and there’s a fix planned. I tried this solution and got an error saying PooledArray not defined. I tried changing the “col isa PooledArray” to isa(col, PooledArray) , but got the same error. I’ll keep an eye out for the update.

Thanks so much for your help.

jeff

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [June 3, 2019, 7:40am UTC](https://discourse.julialang.org/t/append-with-two-dataframe-throws-pooledarray-error/24850/4 "2019-06-03T07:40:06Z")

</div>

You have to install PooledArrays.jl first by `using Pkg; Pkg.add("PooledArrays"); using PooledArrays`.

---

<div class="post-metadata">

**Author:** ![notpeerreviewed](https://avatars.discourse-cdn.com/v4/letter/n/a9adbd/32.png) [@notpeerreviewed](https://discourse.julialang.org/u/notpeerreviewed)\
**Post date:** [June 3, 2019, 8:07am UTC](https://discourse.julialang.org/t/append-with-two-dataframe-throws-pooledarray-error/24850/5 "2019-06-03T08:07:04Z")

</div>

I wondered if it might be something simple like that. I’ll give it a go.
