# How to create JuliaDB table from DataFrame?

**URL:** https://discourse.julialang.org/t/how-to-create-juliadb-table-from-dataframe/10334
**Category:** General Usage
**Created:** [April 14, 2018, 4:52pm UTC](https://discourse.julialang.org/t/how-to-create-juliadb-table-from-dataframe/10334 "2018-04-14T16:52:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)
#### Post date: [April 14, 2018, 4:52pm UTC](https://discourse.julialang.org/t/how-to-create-juliadb-table-from-dataframe/10334/1 "2018-04-14T16:52:48Z")

</div>

I thought it would be easy but…

```julia
julia> df = DataFrame(x = [1,2,3], y = [4,5,6])
3×2 DataFrames.DataFrame
│ Row │ x │ y │
├─────┼───┼───┤
│ 1 │ 1 │ 4 │
│ 2 │ 2 │ 5 │
│ 3 │ 3 │ 6 │

julia> t = table(df)
ERROR: ArgumentError: iter cannot be turned into a NextTable.
Stacktrace:
 [1] #table#334(::Bool, ::Array{Any,1}, ::Function, ::DataFrames.DataFrame) at /Users/tomkwong/.julia/v0.6/IndexedTables/src/tabletraits.jl:68
 [2] table(::DataFrames.DataFrame) at /Users/tomkwong/.julia/v0.6/IndexedTables/src/tabletraits.jl:65

```

---

<div class="post-metadata">

### Author: ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)
#### Post date: [April 15, 2018, 2:09am UTC](https://discourse.julialang.org/t/how-to-create-juliadb-table-from-dataframe/10334/2 "2018-04-15T02:09:44Z")

</div>

I can work around with the following. It looks like a bug with JuliaDB and I will submit an issue as such.

```julia
julia> table([df[c] for c in names(df)]...; names = names(df))
Table with 3 rows, 2 columns:
x y
────
1 4
2 5
3 6

```

---

<div class="post-metadata">

### Author: ![shashi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shashi/32/1824_2.png) [@shashi](https://discourse.julialang.org/u/shashi)
#### Post date: [April 15, 2018, 6:31am UTC](https://discourse.julialang.org/t/how-to-create-juliadb-table-from-dataframe/10334/3 "2018-04-15T06:31:39Z")

</div>

To convert, you need to load `using IterableTables`

```julia
julia> using IterableTables

julia> table(df)
Table with 3 rows, 2 columns:
x y
────
1 4
2 5
3 6

```
