# DimensionMismatch("column length of 178 for columns startTime, startLoc, routePlaned, and is incompatible with column length 177 for columns dists and travelTimes" in julia dataframes)

**URL:** <https://discourse.julialang.org/t/dimensionmismatch-column-length-of-178-for-columns-starttime-startloc-routeplaned-and-is-incompatible-with-column-length-177-for-columns-dists-and-traveltimes-in-julia-dataframes/31759>\
**Category:** General Usage\
**Created:** [December 2, 2019, 3:33pm UTC](https://discourse.julialang.org/t/dimensionmismatch-column-length-of-178-for-columns-starttime-startloc-routeplaned-and-is-incompatible-with-column-length-177-for-columns-dists-and-traveltimes-in-julia-dataframes/31759 "2019-12-02T15:33:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [December 2, 2019, 3:33pm UTC](https://discourse.julialang.org/t/dimensionmismatch-column-length-of-178-for-columns-starttime-startloc-routeplaned-and-is-incompatible-with-column-length-177-for-columns-dists-and-traveltimes-in-julia-dataframes/31759/1 "2019-12-02T15:33:45Z")

</div>

Hi. I was trying to use a dataframe with several columns, where some columns are vectors of varying length;  
i.e., in some columns, they are of length say 10, and in some other columns, they are of length say 12. Also, in the same row, some entries may have different lengths, compared with other entries. Then I got this DimensionMismatch error. Could anyone let me know what might be wrong?

---

<div class="post-metadata">

**Author:** ![bashonubuntu](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bashonubuntu](https://discourse.julialang.org/u/bashonubuntu)\
**Post date:** [December 2, 2019, 4:51pm UTC](https://discourse.julialang.org/t/dimensionmismatch-column-length-of-178-for-columns-starttime-startloc-routeplaned-and-is-incompatible-with-column-length-177-for-columns-dists-and-traveltimes-in-julia-dataframes/31759/2 "2019-12-02T16:51:55Z")

</div>

Can you post a slice of the dataframe? Might be easier to see the issue then.

---

<div class="post-metadata">

**Author:** ![jkbest2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jkbest2/32/7350_2.png) [@jkbest2](https://discourse.julialang.org/u/jkbest2)\
**Post date:** [December 2, 2019, 7:32pm UTC](https://discourse.julialang.org/t/dimensionmismatch-column-length-of-178-for-columns-starttime-startloc-routeplaned-and-is-incompatible-with-column-length-177-for-columns-dists-and-traveltimes-in-julia-dataframes/31759/3 "2019-12-02T19:32:19Z")

</div>

If your columns are _supposed_ to be of different length then you probably won’t be able to use a data frame. Data frames are assumed to be “rectangular”, with all columns the same length. You may be able to fill in rows with `missing` or `nothing` as appropriate so that the columns are the same length.

---

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [December 3, 2019, 8:55am UTC](https://discourse.julialang.org/t/dimensionmismatch-column-length-of-178-for-columns-starttime-startloc-routeplaned-and-is-incompatible-with-column-length-177-for-columns-dists-and-traveltimes-in-julia-dataframes/31759/4 "2019-12-03T08:55:56Z")

</div>

Thank you a lot for kind explanations.

---

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [December 3, 2019, 8:59am UTC](https://discourse.julialang.org/t/dimensionmismatch-column-length-of-178-for-columns-starttime-startloc-routeplaned-and-is-incompatible-with-column-length-177-for-columns-dists-and-traveltimes-in-julia-dataframes/31759/5 "2019-12-03T08:59:33Z")

</div>

So, if the columns are of different lengths, which data structure would be better than Data Frames ?

---

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [December 3, 2019, 9:16am UTC](https://discourse.julialang.org/t/dimensionmismatch-column-length-of-178-for-columns-starttime-startloc-routeplaned-and-is-incompatible-with-column-length-177-for-columns-dists-and-traveltimes-in-julia-dataframes/31759/6 "2019-12-03T09:16:58Z")

</div>

I figured it out now, by writing it directly to a .csv file instead.
