Hi all,
I am new with Julia my background is Stata and R, I am comparing different command and results. I wonder if exist some way to avoid display all database without ask for it.
Its complicated when I load millions of observations.
Maybe its my configuration??
I am using SublimeRepl with Sublime text 4
Example:
You can see that print all the rows and columnsโฆ
using Random, CategoricalArrays, DataFrames
# Generate sample data
n = 1000
Random.seed!(06515)
df = DataFrame(
y = randn(n),
x1 = randn(n),
x2 = randn(n),
group = categorical(rand(["A", "B", "C"], n)))
DataFrame adjusts display dynamically depending on the size of the display window. For example
julia> using CategoricalArrays
julia> using DataFrames
julia> using Random
julia> n = 1000
1000
julia> Random.seed!(06515)
TaskLocalRNG()
julia> df = DataFrame(
y = randn(n),
x1 = randn(n),
x2 = randn(n),
group = categorical(rand(["A", "B", "C"], n)))
1000ร4 DataFrame
Row โ y x1 x2 group
โ Float64 Float64 Float64 Catโฆ
โโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1 โ -1.702 0.630715 0.615604 A
2 โ -0.783141 3.32108 0.398537 A
3 โ -1.12673 0.741291 1.0854 A
4 โ -1.8922 -0.219293 0.275528 B
5 โ 0.251435 -0.168469 -0.384072 B
6 โ 1.32279 0.478072 -0.727269 C
7 โ 0.0177961 0.50748 0.511304 A
8 โ -0.00805389 1.32029 0.665092 B
9 โ 1.07988 0.664838 1.24314 A
10 โ 1.28176 1.24093 0.552596 A
11 โ -1.56424 -1.1748 1.26912 C
12 โ -0.101351 0.154412 0.245494 C
13 โ 0.1592 -0.291401 -0.370051 B
14 โ 0.305936 -1.95372 -1.67376 A
15 โ -0.455743 0.960887 0.232676 A
16 โ 1.46745 2.84029 0.278892 A
17 โ 0.145784 0.186623 0.11497 A
18 โ -1.04925 -0.494621 -0.182952 B
19 โ -1.50332 -1.70582 -0.358066 B
20 โ -0.725616 -0.0157264 -1.29976 B
21 โ -0.453116 0.611136 -2.54458 A
22 โ 0.435147 -1.11523 0.838568 C
โฎ โ โฎ โฎ โฎ โฎ
979 โ 1.73312 0.45741 -0.394642 C
980 โ 0.297119 0.708152 -0.593984 A
981 โ -1.97116 -0.199694 0.572518 C
982 โ -1.80177 -0.294087 -0.627953 C
983 โ -1.14641 1.70589 -1.05738 C
984 โ -0.427469 0.199414 -1.53624 A
985 โ 0.443345 -0.446598 1.06973 C
986 โ 0.58093 -0.542177 0.709585 C
987 โ -0.942309 -3.04805 -1.38662 C
988 โ -0.317554 0.914196 0.283311 B
989 โ 0.802619 -1.84786 0.607003 A
990 โ 0.421096 -0.951215 0.382277 B
991 โ -0.632904 -1.4118 -0.294012 A
992 โ -0.260684 -0.526704 0.122641 B
993 โ -0.452213 -1.35053 -1.18115 B
994 โ -1.58226 0.420341 0.916672 B
995 โ -1.39596 0.339323 -1.45384 C
996 โ 1.36291 -1.30481 0.524041 B
997 โ 0.847221 0.0251756 0.781781 B
998 โ 1.21163 0.68933 0.0178197 A
999 โ -2.82673 -0.784539 0.156953 C
1000 โ 0.82131 -1.4174 -0.391486 B
956 rows omitted
julia>
and
julia> using CategoricalArrays
julia> using DataFrames
julia> using Random
julia> n = 1000
1000
julia> Random.seed!(06515)
TaskLocalRNG()
julia> df = DataFrame(
y = randn(n),
x1 = randn(n),
x2 = randn(n),
group = categorical(rand(["A", "B", "C"], n)))
1000ร4 DataFrame
Row โ y x1 x2 group
โ Float64 Float64 Float64 Catโฆ
โโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1 โ -1.702 0.630715 0.615604 A
2 โ -0.783141 3.32108 0.398537 A
3 โ -1.12673 0.741291 1.0854 A
4 โ -1.8922 -0.219293 0.275528 B
5 โ 0.251435 -0.168469 -0.384072 B
6 โ 1.32279 0.478072 -0.727269 C
7 โ 0.0177961 0.50748 0.511304 A
8 โ -0.00805389 1.32029 0.665092 B
9 โ 1.07988 0.664838 1.24314 A
10 โ 1.28176 1.24093 0.552596 A
11 โ -1.56424 -1.1748 1.26912 C
12 โ -0.101351 0.154412 0.245494 C
13 โ 0.1592 -0.291401 -0.370051 B
14 โ 0.305936 -1.95372 -1.67376 A
15 โ -0.455743 0.960887 0.232676 A
16 โ 1.46745 2.84029 0.278892 A
17 โ 0.145784 0.186623 0.11497 A
18 โ -1.04925 -0.494621 -0.182952 B
19 โ -1.50332 -1.70582 -0.358066 B
20 โ -0.725616 -0.0157264 -1.29976 B
21 โ -0.453116 0.611136 -2.54458 A
22 โ 0.435147 -1.11523 0.838568 C
23 โ 0.501289 1.24776 0.647895 B
24 โ 0.402811 0.801254 1.27738 C
25 โ 0.211726 1.60119 -1.38694 B
26 โ -1.20796 -1.26969 1.2001 B
27 โ 0.177459 0.00575822 0.159947 C
28 โ 0.738264 -0.495383 -1.40506 B
29 โ -0.252979 -0.769827 0.527035 C
30 โ 0.266908 -0.246113 -0.827958 C
31 โ 0.0444857 0.0742844 -0.331827 C
โฎ โ โฎ โฎ โฎ โฎ
971 โ -1.92257 -0.65397 -1.2593 B
972 โ -0.725117 -1.08739 -0.105488 A
973 โ -0.467188 0.420613 -0.485866 C
974 โ -0.791398 0.910714 -0.944314 B
975 โ -1.43344 0.891557 0.39844 A
976 โ -0.681357 -0.806813 2.01171 A
977 โ -1.41441 -1.57139 -0.260637 C
978 โ -0.420314 0.455886 -0.698848 A
979 โ 1.73312 0.45741 -0.394642 C
980 โ 0.297119 0.708152 -0.593984 A
981 โ -1.97116 -0.199694 0.572518 C
982 โ -1.80177 -0.294087 -0.627953 C
983 โ -1.14641 1.70589 -1.05738 C
984 โ -0.427469 0.199414 -1.53624 A
985 โ 0.443345 -0.446598 1.06973 C
986 โ 0.58093 -0.542177 0.709585 C
987 โ -0.942309 -3.04805 -1.38662 C
988 โ -0.317554 0.914196 0.283311 B
989 โ 0.802619 -1.84786 0.607003 A
990 โ 0.421096 -0.951215 0.382277 B
991 โ -0.632904 -1.4118 -0.294012 A
992 โ -0.260684 -0.526704 0.122641 B
993 โ -0.452213 -1.35053 -1.18115 B
994 โ -1.58226 0.420341 0.916672 B
995 โ -1.39596 0.339323 -1.45384 C
996 โ 1.36291 -1.30481 0.524041 B
997 โ 0.847221 0.0251756 0.781781 B
998 โ 1.21163 0.68933 0.0178197 A
999 โ -2.82673 -0.784539 0.156953 C
1000 โ 0.82131 -1.4174 -0.391486 B
939 rows omitted
are from the same terminal REPL session with the first having a smaller display than the second. I havenโt used Julia within Sublime so I donโt know how it differs from the REPL.
Thanks for you reply.
I have your same result using Julia default Repl.
I am trying to change some configuration of my setup but i failedโฆ
I use the same configuration with R and Sublime Repl for 10 year and never had this issue
Anyway I am still work in that.
Regards
It looks like the show function for Dataframes (which is called internally within display which is called when the Dataframe is shown in the REPL), checks whether the output should be limited or not by checking the above property. See also here:
If stdout[:limit] is false for the Sublime REPL then that would be the issue I think. If :limit is true or if there is no default value (thatโs the case in my standard terminal REPL) then the issue might be one level higher at the display function and the type of output the Sublime REPL implements (perhaps the io is not stdout)?
If you want it to display just a little, see the above responses.
If you donโt need it to print anything at all, know that when you include a file in the REPL (or possibly โrunโ it from an editor REPL, depends on the editor), it will display the last โresultโ of the file, in this case your df = ... line. If you donโt want that printout, you can add nothing as the last line of your file. nothing prints as a blank.
If you or the editor are pasting the results to the REPL one at a time (possible but doubtful), you can add a ; to the ends of the lines. Lines ending in ; in the REPL do not display their result.
Finally i use nothing and work great, I have some issues with margins predictions and how display results from linear mixed model but i hope solve later
Thanks all for your time
using DataFrames, Random,MixedModels,CategoricalArrays,RegressionTables, MixedModelsDatasets, GLM
using Random, CategoricalArrays, DataFrames
# Generate sample data
n = 1000
Random.seed!(06515)
begin
df = DataFrame(y = randn(n),
x1 = randn(n),
x2 = randn(n),
group = categorical(rand(["A", "B", "C"], n)))
nothing
end
lmod = @time lmm(@formula(y ~ x1+ x2+x1 & x2+ (1|group)), df)
coeftable(lmod)