# DataFrames show() ignores column width, prints everything

**URL:** <https://discourse.julialang.org/t/dataframes-show-ignores-column-width-prints-everything/53327>\
**Category:** Data\
**Tags:** jupyter, dataframes\
**Created:** [January 14, 2021, 11:01am UTC](https://discourse.julialang.org/t/dataframes-show-ignores-column-width-prints-everything/53327 "2021-01-14T11:01:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xyz1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xyz1/32/19984_2.png) [@xyz1](https://discourse.julialang.org/u/xyz1)\
**Post date:** [January 14, 2021, 11:01am UTC](https://discourse.julialang.org/t/dataframes-show-ignores-column-width-prints-everything/53327/1 "2021-01-14T11:01:44Z")

</div>

Hi, I’m using DataFrames with IJulia and when I create a DataFrame and then “show” it, instead of truncation like in Python it shows all columns non-truncated, which obviously hangs always. I’ve tried setting ENV[“COLUMNS”] but DataFrames is ignoring it.

I can always reproduce with

```julia
ENV["COLUMNS"] = 10
ENV

```

(Here I see the variable ENV shown truncated to 10 characters).

But subsequently

```julia
using DataFrames
x = repeat("ABC", 20000)
df = DataFrame(i=1:50, j=repeat(x, 50));

df

```

hangs for a second, then shows full 20k characters long lines.

What is the cause and fix? I am using classic Jupyter.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [January 14, 2021, 12:39pm UTC](https://discourse.julialang.org/t/dataframes-show-ignores-column-width-prints-everything/53327/2 "2021-01-14T12:39:18Z")

</div>

use:

```julia
show(df)

```

in this case for the time being.

We are waiting to integrate PrettyTables.jl support for HTML and LaTeX backend to fix it consistently, and I know @Ronis_BR is working on it.

---

<div class="post-metadata">

**Author:** ![xyz1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xyz1/32/19984_2.png) [@xyz1](https://discourse.julialang.org/u/xyz1)\
**Post date:** [January 14, 2021, 8:27pm UTC](https://discourse.julialang.org/t/dataframes-show-ignores-column-width-prints-everything/53327/3 "2021-01-14T20:27:12Z")

</div>

Thanks, that stops the hanging output but unfortunately it truncates all columns and prints only the first one.  
For the example above, when I use show(df), it shows the first column and

```julia
50×2 DataFrame. Omitted printing of 1 columns
│ Row │ i │
│ │ Int64 │
├─────┼───────┤
│ 1 │ 1 │
...

```

Is there a built-in function to print e.g. 10 chars from each column side by side for the first like 5 rows?

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [January 14, 2021, 8:38pm UTC](https://discourse.julialang.org/t/dataframes-show-ignores-column-width-prints-everything/53327/4 "2021-01-14T20:38:12Z")

</div>

Please update DataFrames.jl to 0.22 version and then report if what is printed is OK. You are using an old version of DataFrames.jl, which had different printing method.
