# Dataframe columns type is \`Any\` even though it's initialized with all \`Float64\`

**URL:** <https://discourse.julialang.org/t/dataframe-columns-type-is-any-even-though-its-initialized-with-all-float64/132870>\
**Category:** New to Julia\
**Tags:** type, dataframes\
**Created:** [October 3, 2025, 11:15pm UTC](https://discourse.julialang.org/t/dataframe-columns-type-is-any-even-though-its-initialized-with-all-float64/132870 "2025-10-03T23:15:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Quantodeluz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quantodeluz/32/218696_2.png) [@Quantodeluz](https://discourse.julialang.org/u/Quantodeluz)\
**Post date:** [October 3, 2025, 11:15pm UTC](https://discourse.julialang.org/t/dataframe-columns-type-is-any-even-though-its-initialized-with-all-float64/132870/1 "2025-10-03T23:15:15Z")

</div>

I don’t have much more to add, I even rerun the code but initializing the columns with the type as a string, and still:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/c/3cc4a172d05afc34920f950627432b0ba2746099.png)  
The two columns before them are fine, but no matter what i do these have type `Any`, and that’s making my code throw errors later on

---

<div class="post-metadata">

**Author:** ![technocrat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/technocrat/32/220947_2.png) [@technocrat](https://discourse.julialang.org/u/technocrat)\
**Post date:** [October 4, 2025, 12:11am UTC](https://discourse.julialang.org/t/dataframe-columns-type-is-any-even-though-its-initialized-with-all-float64/132870/2 "2025-10-04T00:11:59Z")

</div>

How are you initializing?

```julia-auto

julia> A = Array{Float64}(undef, 4, 4)
4×4 Matrix{Float64}:
 0.0 0.0 0.0 0.0
 0.0 0.0 0.0 0.0
 0.0 0.0 0.0 0.0
 0.0 0.0 0.0 0.0

julia> df = DataFrame(A, :auto)
4×4 DataFrame
 Row │ x1 x2 x3 x4      
     │ Float64 Float64 Float64 Float64 
─────┼────────────────────────────────────
   1 │ 0.0 0.0 0.0 0.0
   2 │ 0.0 0.0 0.0 0.0
   3 │ 0.0 0.0 0.0 0.0
   4 │ 0.0 0.0 0.0 0.0

```

---

<div class="post-metadata">

**Author:** ![Quantodeluz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quantodeluz/32/218696_2.png) [@Quantodeluz](https://discourse.julialang.org/u/Quantodeluz)\
**Post date:** [October 4, 2025, 12:59am UTC](https://discourse.julialang.org/t/dataframe-columns-type-is-any-even-though-its-initialized-with-all-float64/132870/3 "2025-10-04T00:59:15Z")

</div>

I used some arrays of floats i constructed before.

Oh, i found the problem. I was initializing the vectors as `[]`, with no values inside them and no type, so they stayed as `Vector{Any}`s.  
Changing the declarations to `Vector{Float64}()` solved the problem.

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [October 4, 2025, 7:08am UTC](https://discourse.julialang.org/t/dataframe-columns-type-is-any-even-though-its-initialized-with-all-float64/132870/4 "2025-10-04T07:08:06Z")

</div>

You can use also `Float64[]` (and more generally `T[]`) to initialize an empty vector or Float64…
