# Array of tuples to DataFrame

**URL:** <https://discourse.julialang.org/t/array-of-tuples-to-dataframe/119494>\
**Category:** General Usage\
**Tags:** question, package, dataframes\
**Created:** [September 17, 2024, 12:19pm UTC](https://discourse.julialang.org/t/array-of-tuples-to-dataframe/119494 "2024-09-17T12:19:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [September 17, 2024, 12:19pm UTC](https://discourse.julialang.org/t/array-of-tuples-to-dataframe/119494/1 "2024-09-17T12:19:19Z")

</div>

How can I convert an array of tuples (NOT named tuples) into a DataFrame?  
Code to create an array of named tuples:

```julia
parking_sections = []

for i in 1:10
   push!(parking_sections, (i, rand(1)[1]))
end

```

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [September 17, 2024, 12:30pm UTC](https://discourse.julialang.org/t/array-of-tuples-to-dataframe/119494/2 "2024-09-17T12:30:11Z")

</div>

So easy:

```julia
using DataFrames

parking_sections = []

for i in 1:10
   push!(parking_sections, (i, rand(1)[1]))
end
DataFrame(parking_sections, [:a, :b])

```
