# Converting a Matrix to a DataFrame

**URL:** <https://discourse.julialang.org/t/converting-a-matrix-to-a-dataframe/6114>\
**Category:** Data\
**Tags:** question\
**Created:** [September 27, 2017, 2:19pm UTC](https://discourse.julialang.org/t/converting-a-matrix-to-a-dataframe/6114 "2017-09-27T14:19:44Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [September 8, 2019, 12:44pm UTC](https://discourse.julialang.org/t/converting-a-matrix-to-a-dataframe/6114/4 "2019-09-08T12:44:30Z")

</div>

Can I ask how you ended up in a situation where you have a string/float mixed type array in the first place?

Typically you don’t want to do that, having strings in an otherwise numerical array like that breaks a lot of functionality. Here’s my work around for this…

```julia
using DataFrames
m = ["A" "B" "C"
     1 10 100;
     nothing nothing nothing;
     3 30 300;
     4 40 400]
m[m .== nothing] .= missing
Names = m[1,:]
Numbers = m[2:end,:]

newdf = convert(DataFrame, Numbers);
rename!(newdf, names(newdf) .=> Symbol.(Names[:]))

dropmissing(newdf)

```

---

_[View the full topic](https://discourse.julialang.org/t/converting-a-matrix-to-a-dataframe/6114)._
