[julia-users] What wrong in (D'*D)/k.-(mean(D,1)'*mean(D,1)) ?
Why (D'*D)/k.-(mean(D,1)'*mean(D,1)) compute var = -0.018 if var must be 0.124326 ?** julia> using HDF5, JLD julia> D=load("D_test.jld","D_test"); julia> k,l=size(D) (100,10) julia> cov(D[:,1],D[:,1],corrected=false) 0.12432634086422582 julia> cov(D,corrected=false) 10x10 Array{Float64,2}: 0.124326 0.0239205 -0.0119771 -0.0201163 0.013 0.0239205 0.154538 -0.0156671 -0.0263335 -0.023 -0.0119771 -0.0156671 0.0853087 -0.0158088 0.002 - julia> (D'*D)/k.-(mean(D,1)'*mean(D,1)) 10x10 Array{Float64,2}: -0.018 -0.0244635 -0.0119771 -0.0247243 -0.01791 -0.0244635 -0.0320863 -0.0156671 -0.0324775 -0.02332 -0.0119771 -0.0156671 -0.00761925 -0.0158088 -0.01140 julia> (D[:,1]'*D[:,1])/k.-(mean(D[:,1],1)'*mean(D[:,1],1)) 1-element Array{Float64,1}: 0.124326 julia> mean(D,1)' 10x1 Array{Float64,2}: 0.136944 0.179135 0.08746 0.180755 0.130206 0.015541 0.036076 0.101094 0.155723 0.045505 julia> mean(D,1) 1x10 Array{Float64,2}: 0.136944 0.179135 0.08746 0.180755 0.130206 0.015541 0 julia> ee=mean(D[:,1],1)'*mean(D[:,1],1) 1-element Array{Float64,1}: 0.0187537 julia> dd=(D[:,1]'*D[:,1])/k 1-element Array{Float64,1}: 0.14308 julia> dd-ee 1-element Array{Float64,1}: 0.124326 file: https://drive.google.com/open?id=0B9xW5VtANWhDOHlwVlZxZk1xanc
[julia-users] how to create a vector of 15 elements, equal as possible, starting with -2 and ending on 2
how to create a vector of 15 elements, equal as possible, starting with -2 and ending on 2 ? Paul
Re: [julia-users] autocor Why 100 elemnts vector has not 100 elements autocor output ?
Thx, how to insert lags ? julia> autocor(y,5) ERROR: MethodError: `autocor` has no method matching autocor(::Array{Float64,1}, ::Int64) Closest candidates are: autocor{T<:Real}(::Array{T<:Real,1}, ::AbstractArray{T<:Integer,1}) autocor{T<:Real}(::Union{Array{T<:Real,1},Array{T<:Real,2}}) julia> W dniu 2016-01-08 o 19:07, Kristoffer Carlsson pisze: Because it depends on what lag you use. Presumably you have to change the default lag.
Re: [julia-users] autocor Why 100 elemnts vector has not 100 elements autocor output ?
BIG Txh, vector as parameter is something new ;/ Paul W dniu 2016-01-08 o 20:19, Kristoffer Carlsson pisze: Good thing with opensource is that you can look yourself: https://github.com/JuliaStats/StatsBase.jl/blob/1090db25cc3afae3c3b737a853a6309b973f839a/src/signalcorr.jl#L124 On Friday, January 8, 2016 at 8:00:00 PM UTC+1, paul analyst wrote: Thx, how to insert lags ? julia> autocor(y,5) ERROR: MethodError: `autocor` has no method matching autocor(::Array{Float64,1}, ::Int64) Closest candidates are: autocor{T<:Real}(::Array{T<:Real,1}, ::AbstractArray{T<:Integer,1}) autocor{T<:Real}(::Union{Array{T<:Real,1},Array{T<:Real,2}}) julia> W dniu 2016-01-08 o 19:07, Kristoffer Carlsson pisze: > Because it depends on what lag you use. Presumably you have to change the default lag.
[julia-users] autocor Why 100 elemnts vector has not 100 elements autocor output ?
julia> using StatsBase Why 100 elemnts vector has not 100 elements autocor output ? julia> autocor(rand(10)) 10-element Array{Float64,1}: 1.0 0.363742 -0.11318 -0.222987 0.0235896 0.0205071 -0.135124 -0.242747 -0.140223 -0.0535775 julia> autocor(rand(100)) 21-element Array{Float64,1}: 1.0 0.0187758 -0.105103 -0.0232407 0.0636284 0.0438567 -0.246789 -0.00484981 0.00894277 -0.0909333 -0.00114724 0.142196 0.0421625 0.0117317 0.109289 0.122338 -0.0507566 -0.114893 0.130828 -0.0543573 -0.0132691
[julia-users] Stepping avg. How faster to compute?
I have meny lonng vectors (like a)and need avg for intervals (f.e. 100 ) in second new vecotr (b) julia> a=rand(10^7); julia> b=zeros(a); julia> tic();for i in [1:100:10^7;] b[i:i+99]=mean(a[i:i+99]) end;toc() elapsed time: 0.138522318 seconds 0.138522318 I am looking for more faster way , is any ? Paul
[julia-users] Steping avg, how faster ?
I have meny lonng vectors (like a)and need avg for intervals (f.e. 100 ) in second new vecotr (b) julia> a=rand(10^7); julia> b=zeros(a); julia> tic();for i in [1:100:10^7;] b[i:i+99]=mean(a[i:i+99]) end;toc() elapsed time: 0.138522318 seconds 0.138522318 I am looking for more faster way , is any ? Paul
[julia-users] Stepping Average
I have meny lonng vectors (like a)and need avg for intervals (f.e. 100 ) in second new vecotr (b) julia> a=rand(10^7); julia> b=zeros(a); julia> tic();for i in [1:100:10^7;] b[i:i+99]=mean(a[i:i+99]) end;toc() elapsed time: 0.138522318 seconds 0.138522318 Is shorter way to compute this ? Paul
Re: [julia-users] a=[1:1:10] WARNING ? What to creat vectors in 4.0 ?
If I am new in Julia and strting and reading this about collect: /collect(collection) "Return an array of all items in a collection. For associative collections, returns Pair{KeyType, ValType}.// //collect(element_type, collection) Return an array of type Array{element_type,1} of all items in a collection."// Now nothink about vecotrs in manual ! Paul / W dniu 2015-11-04 o 20:45, Tom Breloff pisze: The warning is pretty clear here I think. Use `a = collect(1:10)` On Wed, Nov 4, 2015 at 2:43 PM, paul analyst <paul.anal...@mail.com <mailto:paul.anal...@mail.com>> wrote: _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "?help" for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.4.0 (2015-10-08 06:20 UTC) _/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release |__/ | x86_64-w64-mingw32 julia> a=[1:1:10] WARNING: [a] concatenation is deprecated; use collect(a) instead in depwarn at deprecated.jl:73 in oldstyle_vcat_warning at abstractarray.jl:29 in vect at abstractarray.jl:32 while loading no file, in expression starting on line 0 10-element Array{Int64,1}: 1 2 3 4 5 6 7 8 9 10 julia>
Re: [julia-users] Re: a=[1:1:10] WARNING ? What to creat vectors in 4.0 ?
Uf ;) semicolon is nice:) WARNING sholud this hints Paul W dniu 2015-11-05 o 15:31, Ismael VC pisze: Paul, you can also use this syntax with a semi colon: | _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "?help" for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.4.0 (2015-10-08 06:20 UTC) _/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release |__/ | x86_64-w64-mingw32 julia> [1:10;] 10-element Array{Int64,1}: 1 2 3 4 5 6 7 8 9 10 julia> | El miércoles, 4 de noviembre de 2015, 13:43:55 (UTC-6), paul analyst escribió: _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "?help" for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.4.0 (2015-10-08 06:20 UTC) _/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release |__/ | x86_64-w64-mingw32 julia> a=[1:1:10] WARNING: [a] concatenation is deprecated; use collect(a) instead in depwarn at deprecated.jl:73 in oldstyle_vcat_warning at abstractarray.jl:29 in vect at abstractarray.jl:32 while loading no file, in expression starting on line 0 10-element Array{Int64,1}: 1 2 3 4 5 6 7 8 9 10 julia>
[julia-users] a=[1:1:10] WARNING ? What to creat vectors in 4.0 ?
_ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "?help" for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.4.0 (2015-10-08 06:20 UTC) _/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release |__/ | x86_64-w64-mingw32 julia> a=[1:1:10] WARNING: [a] concatenation is deprecated; use collect(a) instead in depwarn at deprecated.jl:73 in oldstyle_vcat_warning at abstractarray.jl:29 in vect at abstractarray.jl:32 while loading no file, in expression starting on line 0 10-element Array{Int64,1}: 1 2 3 4 5 6 7 8 9 10 julia>
Re: [julia-users] How to get first number from Int64
Very smart, thx Paul W dniu 2015-10-26 o 23:18, David Epstein pisze: A one-liner, with type conversion to get an integer back: *convert(Int64,floor(x/10^(floor(log10(x)* On Saturday, October 24, 2015 at 11:40:03 AM UTC-4, Michele Zaffalon wrote: There is also the builtin http://docs.julialang.org/en/latest/stdlib/numbers/#Base.digits <http://docs.julialang.org/en/latest/stdlib/numbers/#Base.digits> On Sat, Oct 24, 2015 at 3:51 PM, Tamas Papp <tkp...@gmail.com > wrote: A trivial (but not necessarily the fastest) solution is function firstdigit(i,base=10) while (i >= base) i = div(i,base) end i end Best, Tamas On Sat, Oct 24 2015, paul analyst <paul.a...@mail.com > wrote: > How to get first number from Int64 > > julia> lista[3] > 464 > > julia> eltype(lista[3]) > Int64 > > julia> length(lista[3]) > 1 > > julia> lista[3][] > 464 > > julia> lista[3][1] > > I need the first "4" > Paul
Re: [julia-users] Re: How to get first number from Int64
Is ok but I can`t convert to int julia> string(lista[3])[1] '4' julia> int(string(lista[3])[1]) 52 Paul W dniu 2015-10-27 o 09:35, Alireza Nejati pisze: Michele's solution is preferred here, but you can also do it like this: string(lista[3])[1]
Re: [julia-users] How to get first number from Int64
Ups:) THX Paul W dniu 2015-10-28 o 11:12, Tamas Papp pisze: Are you sure about that? Try x=99. Best, Tamas On Wed, Oct 28 2015, Paul Analyst <paul.anal...@mail.com> wrote: Very smart, thx Paul W dniu 2015-10-26 o 23:18, David Epstein pisze: A one-liner, with type conversion to get an integer back: *convert(Int64,floor(x/10^(floor(log10(x)* On Saturday, October 24, 2015 at 11:40:03 AM UTC-4, Michele Zaffalon wrote: There is also the builtin http://docs.julialang.org/en/latest/stdlib/numbers/#Base.digits <http://docs.julialang.org/en/latest/stdlib/numbers/#Base.digits> On Sat, Oct 24, 2015 at 3:51 PM, Tamas Papp <tkp...@gmail.com > wrote: A trivial (but not necessarily the fastest) solution is function firstdigit(i,base=10) while (i >= base) i = div(i,base) end i end Best, Tamas On Sat, Oct 24 2015, paul analyst <paul.a...@mail.com > wrote: > How to get first number from Int64 > > julia> lista[3] > 464 > > julia> eltype(lista[3]) > Int64 > > julia> length(lista[3]) > 1 > > julia> lista[3][] > 464 > > julia> lista[3][1] > > I need the first "4" > Paul
[julia-users] How to get first number from Int64
How to get first number from Int64 julia> lista[3] 464 julia> eltype(lista[3]) Int64 julia> length(lista[3]) 1 julia> lista[3][] 464 julia> lista[3][1] I need the first "4" Paul
Re: [julia-users] Re: @parallel , double loop , what wrong?
Big THX Vincent , big help :) Paul W dniu 2015-10-12 o 12:23, Vincent Lostanlen pisze: Dear Paul, For k=100 and your purpose, parallelization may not be the utmost performance bottleneck here. I advise you to use the Distances.jl <https://github.com/JuliaStats/Distances.jl> package. Since Julia stores contiguous memory in column-major order <https://julia.readthedocs.org/en/latest/manual/performance-tips/#access-arrays-in-memory-order-along-columns>, you will first need to transpose the matrix D — or, better, to define it foremost as a n*k matrix instead of k*n. Once you've ensured that, calling mapa = Distances.pairwise(Euclidean(), D) should give you at least a 100x speedup over the for loop you've written, so parallelization should no longer be necessary. Vincent. Le dimanche 11 octobre 2015 16:34:27 UTC+2, paul analyst a écrit : Like here , what wrong ? k=100 mapa=zeros(k,k) julia> @parallel for i=1:k,j=1:k mapa[i,j]=sqrt(sum([D[i,:]-D[j,:]].^2)) end ERROR: syntax: invalid assignment location Paul
Re: [julia-users] Re: @parallel , double loop , what wrong?
Thx, huge help:) unfortunatly i must compute all ;/ bur only one time ;) Paul W dniu 2015-10-12 o 20:52, Vincent Lostanlen pisze: Dear Paul, Remember that for K=283300, you’ll have K*(K+1)/2 = 4.0e10 distance values. That is over 160 gigabytes in memory. The reason you have an OOM error is that this exceeds the RAM of your machine. So consider whether you really need a quadratic algorithm on such a large number of samples. If so, you’ll have to carefully split the dataset in P=10 splits, and then call Distances.pairwise over all splits p and q for all p <= q <= P while progressively freeing memory. That will be P*(P+1)/2 = 55 iterations, each of them allocating 1.6 Gb. Store progressively each of these 55 gigabyte-sized matrices in your hard drive. Do you really need all distance values ? If your final application is e.g. clustering, there are suboptimal large-scale algorithms that have a lower complexity. Vincent. Le 12 octobre 2015 à 20:20:33, Paul Analyst (paul.anal...@mail.com <mailto:paul.anal...@mail.com>) a écrit: Unfortunaty for big file no memory :) julia> F1=load("F.jd","F") 283300x266 Array{Float64,2}: julia> mapa = Distances.pairwise(Euclidean(), F1') ERROR: OutOfMemoryError() in pairwise at C:\Users\SAMSUNG2\.julia\v0.4\Distances\src\generic.jl:132 Do You have any hint for big sets ? Paul W dniu 2015-10-12 o 12:23, Vincent Lostanlen pisze: Dear Paul, For k=100 and your purpose, parallelization may not be the utmost performance bottleneck here. I advise you to use the Distances.jl <https://github.com/JuliaStats/Distances.jl> package. Since Julia stores contiguous memory in column-major order <https://julia.readthedocs.org/en/latest/manual/performance-tips/#access-arrays-in-memory-order-along-columns>, you will first need to transpose the matrix D — or, better, to define it foremost as a n*k matrix instead of k*n. Once you've ensured that, calling mapa = Distances.pairwise(Euclidean(), D) should give you at least a 100x speedup over the for loop you've written, so parallelization should no longer be necessary. Vincent. Le dimanche 11 octobre 2015 16:34:27 UTC+2, paul analyst a écrit : Like here , what wrong ? k=100 mapa=zeros(k,k) julia> @parallel for i=1:k,j=1:k mapa[i,j]=sqrt(sum([D[i,:]-D[j,:]].^2)) end ERROR: syntax: invalid assignment location Paul
[julia-users] @parallel , double loop , what wrong?
Like here , what wrong ? k=100 mapa=zeros(k,k) julia> @parallel for i=1:k,j=1:k mapa[i,j]=sqrt(sum([D[i,:]-D[j,:]].^2)) end ERROR: syntax: invalid assignment location Paul
Re: [julia-users] Re: @parallel and HDF5 is posible to work together?
*what wrong?* fid = h5open("data.h5","r+") this code work : import HDF5 @everywhere using HDF5 @parallel for i=1:l #dset=fid["punkty"*string(i)] f=vec(h5read("F.h5","F",(:,i))); #dset[:,:]=f*rand() println(i) end close(fid) this code do not work: * *fid = h5open("data.h5","r+") @parallel for i=1:l * dset=fid["punkty"*string(i)]* f=vec(h5read("F.h5","F",(:,i))); #dset[:,:]=f*rand() println(i) end* ERROR: File or object has been closedn exception on 236: 4: in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) : ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) julia> close(fiexception on dexception on 58: ): ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) 7: julia> ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) close(fid)** ** *Paul W dniu 2015-09-04 o 19:44, Paul Analyst pisze: Thanak lot Nils, Unfortunatly like below: julia> addprocs(7) 7-element Array{Any,1}: 2 3 4 5 6 7 8 julia> import HDF5 julia> @everywhere using HDF5 julia> @parallel for i=1:l dset=fid["punkty"*string(i)] f=vec(h5read("F.h5","F",(:,i))); ... println(i) end julia> close(fid) julia> toc() elapsed time: 18.801164342 seconds 18.801164342 julia> exception on 2: ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) exception on 4: exception on 6: exception on 5: exception on exception on 3: exception on 8: 7: ERROR: File or o ect has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) W dniu 2015-09-01 o 22:14, Nils Gudat pisze: As the warning says, the module is not defined on the workers. Do addprocs() import HDF5 @everywhere using HDF5
Re: [julia-users] Re: @parallel and HDF5 is posible to work together?
Thanak lot Nils, Unfortunatly like below: julia> addprocs(7) 7-element Array{Any,1}: 2 3 4 5 6 7 8 julia> import HDF5 julia> @everywhere using HDF5 julia> @parallel for i=1:l dset=fid["punkty"*string(i)] f=vec(h5read("F.h5","F",(:,i))); ... println(i) end julia> close(fid) julia> toc() elapsed time: 18.801164342 seconds 18.801164342 julia> exception on 2: ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) exception on 4: exception on 6: exception on 5: exception on exception on 3: exception on 8: 7: ERROR: File or o ect has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) ERROR: File or object has been closed in o_open at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:696 (repeats 2 times) W dniu 2015-09-01 o 22:14, Nils Gudat pisze: As the warning says, the module is not defined on the workers. Do addprocs() import HDF5 @everywhere using HDF5
[julia-users] @parallel and HDF5 is posible to work together?
@parallel and HDF5 is posible to work together? julia> addprocs(6) 6-element Array{Any,1}: 2 3 4 5 6 7 julia> @parallel for i=1:l dset=fid["punkts"*string(i)] f=vec(h5read("F.h5","F",(:,i))); . end WARNING: Module HDF5 not defined on process 2 WARNING: Module HDF5 not defined on process 3 julia> close(fid) julia> fatal error on 3: WARNING: Module HDF5 not defined on process 6 WARNING: Module HDF5 not defined on process 7 WARNING: Module HDF5 not defined on process 4 fatal error on 6: fatal error on fatal error on 74: : WARNING: Module HDF5 not defined on process 5 fatal error on 5: ERROR: HDF5 not defined in deserialize at serialize.jl:377 in handle_deserialize at serialize.jl:352 in deserialize at serialize.jl:506 in handle_deserialize at serialize.jl:352 Paul
[julia-users] How parallel count and save the results ?
How parallel count and save the results ? I have a large matrix A saved in the file hdf5 10 ^ 7 x 10 ^ 3. Each column was converted to the write down in the matrix B of the same size. Each column independently. The calculations are tedious but not borne by the processor. How does this process do parallel? Paul
Re: [julia-users] Re: different eigen value ordering from eigs
Sample m,v=eig(B) return m,v where m and v are from smalest do bigest value. First eigen value and eigenvec are on the last position You must flip/flop both: v=fliplr(v);m=flipud(m) julia A=rand(4,4) 4x4 Array{Float64,2}: 0.661782 0.366042 0.149729 0.445334 0.658829 0.376393 0.0998171 0.637071 0.851418 0.876499 0.748640.544398 0.0921396 0.522684 0.384848 0.853703 julia B=cor(A) 4x4 Array{Float64,2}: 1.00.308153 0.18808-0.858457 0.308153 1.00.988595 -0.0151858 0.188080.988595 1.0 0.0563374 -0.858457 -0.0151858 0.0563374 1.0 julia m,v=eig(B) ([4.44089e-16,0.109119,1.70604,2.18484], 4x4 Array{Float64,2}: 0.207923 0.6822 0.509621 -0.481308 -0.712208 0.0744095 -0.368759 -0.592655 0.65762 -0.269323 -0.432141 -0.555208 0.130629 0.675671 -0.646187 0.32992 ) julia m 4-element Array{Float64,1}: 4.44089e-16 0.109119 1.70604 2.18484 W dniu 2015-08-23 o 22:45, Edward Chen pisze: Would there be any reason to suspect that the ordering of the eigenvalues and the eigenvectors are different? I am doing a side-by-side comparison with the eig function in MATLAB and it seems to give a different ordering of vectors for the same matrix. On Saturday, April 26, 2014 at 5:15:21 PM UTC-4, Ethan Anderes wrote: Paul: Sorry, I don't think I can help you there. I don't have any observational errors, just numerical error in the matrix.
[julia-users] How quickly compute the density of the vector in the selected range?
Hi, How quickly computethe density of the vector in the selected range? I have vec=[0 0 0 1 0 1 0 1 1 0] I am lookking for function computing density of this vector on selelcted range i.e. 5 elements : foo(vec,5) result: [0.2 0.2 0.2 0.2 0.2 0.6 0.6 0.6 0.6 0.6] mean first 5 elements is 0.2 mean second 5 elements is 0.6 etc... I need somthing fast to vry long vectors Paul
Re: [julia-users] How quickly compute the density of the vector in the selected range?
Nice way, thx. paull W dniu niedziela, 16 sierpnia 2015 18:25:02 UTC+2 użytkownik Tim Holy napisał: If you want a running density, look into c = cumsum(v) density = c[6:end] - c[1:end-5] If you want in blocks, reshape to a matrix and take the mean along dimension 1. --Tim On Sunday, August 16, 2015 09:08:23 AM paul analyst wrote: Hi, How quickly computethe density of the vector in the selected range? I have vec=[0 0 0 1 0 1 0 1 1 0] I am lookking for function computing density of this vector on selelcted range i.e. 5 elements : foo(vec,5) result: [0.2 0.2 0.2 0.2 0.2 0.6 0.6 0.6 0.6 0.6] mean first 5 elements is 0.2 mean second 5 elements is 0.6 etc... I need somthing fast to vry long vectors Paul
[julia-users] Is some Autocorrelation function in Julia?
*Is some Autocorrelation function in Julia?Paul*
[julia-users] HDF5 file id biger then txt. What wrong?
I have data in txt file, some milons like this: 0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,2,0,0,0,2,0,0,0,0,1 0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1 Coding win1250. size of dane.txt is 1.3 GB D=readcsv(dane.txt) k,l=size(D) using HDF5, JLD hfi=h5open(D.h5,w) close(hfi) fid = h5open(D.h5,r+) g = fid[/] dset1 = d_create(g, /D, datatype(Int64), dataspace(k,l)) dset1[:,:]=D close(fid) After save to h5 file the file has 6.3 GB ? Why new file is 4 times biger? Paul
Re: [julia-users] Re: How from dimensional array cut out no more than the first 15 characters of each line, without loop. is posible it ?
This | map(x-x[1:min(length(x),15)],A) This is ok, but now i must take only last char from any row this array A. How do it ? julia map(x-x[length(x)],A) ERROR: BoundsError() in next at utf8.jl:56 in anonymous at none:1 in map_to! at abstractarray.jl:1311 in anonymous at none:1 in map at abstractarray.jl:1331 julia map(x-x[end],A) ERROR: BoundsError() in next at utf8.jl:56 in anonymous at none:1 in map_to! at abstractarray.jl:1311 in anonymous at none:1 in map at abstractarray.jl:1331 Paul | W dniu 2015-07-02 o 21:13, Tom Breloff pisze: Try: | map(x-x[1:min(length(x),15)],A) | On Thursday, July 2, 2015 at 3:06:33 PM UTC-4, paul analyst wrote: How from dimensional array cut out no more than the first 15 characters of each line, without loop. is posible it ? I have : julia A 3-element Array{Any,1}: Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magn a aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum. But i need julia A 3-element Array{Any,1}: Lorem ipsum dolor a aliqua. Ut enim ad minim Duis aute irure d sint occaecat cupi
[julia-users] Is @@ reservd word in Julia ? Can I use @@ in data?
Is @@ reservd word in Julia ? Can I use @@ in data? Paul
Re: [julia-users] Re: How to find the index of array containing some text (substring)
Big Thx , but b,i in oposit order must like below... i,b But my aray is 2261-element Array{Any,1}: , the trick working only with Array{ASCIIString,1}: , How convert Array Any to Array ASCIIString ? julia [contains(b,i) for i in A] 4-element Array{Any,1}: false false false false julia A 4-element Array{ASCIIString,1}: aaa aab aac aba julia [contains(i,b) for i in A] 4-element Array{Any,1}: false true false true W dniu 2015-07-08 o 19:58, Eduardo Lenz pisze: [contains(b,i) for i in A]
Re: [julia-users] Re: How to find the index of array containing some text (substring)
thx, bat no:) In my array are digits too. I must Some loop to preapere . Paul julia A2 = map( (x)-convert(ASCIIString,x), A) ERROR: `convert` has no method matching convert(::Type{ASCIIString}, ::Float64) in convert at base.jl:13 in anonymous at none:1 in map at base.jl:189 W dniu 2015-07-08 o 20:35, Eduardo Lenz pisze: A2 = map( (x)-convert(ASCIIString,x), A)
Re: [julia-users] Re: How to find the index of array containing some text (substring)
if i read data like String is ok , but is problem with digit:) data=readcsv(file.txt,UTF8String) Paweł W dniu 2015-07-08 o 20:40, Paul Analyst pisze: thx, bat no:) In my array are digits too. I must Some loop to preapere . Paul julia A2 = map( (x)-convert(ASCIIString,x), A) ERROR: `convert` has no method matching convert(::Type{ASCIIString}, ::Float64) in convert at base.jl:13 in anonymous at none:1 in map at base.jl:189 W dniu 2015-07-08 o 20:35, Eduardo Lenz pisze: A2 = map( (x)-convert(ASCIIString,x), A)
[julia-users] How to find the index of array containing some text (substring)
Is array A julia A=[aaa,aab,aac,aba] 4-element Array{ASCIIString,1}: aaa aab aac aba How to How to find the index this arrary containing b ? julia find(A,b) ERROR: `find` has no method matching find(::Array{ASCIIString,1}, ::ASCIIString) julia getindex(A,b) ERROR: `getindex` has no method matching getindex(::Array{ASCIIString,1}, ::ASCIIString) julia search(A,b) ERROR: `search` has no method matching search(::Array{ASCIIString,1}, ::ASCIIString) julia search(A,b) ERROR: `search` has no method matching search(::Array{ASCIIString,1}, ::ASCIIString) Paul
Re: [julia-users] Re: How to find the index of array containing some text (substring)
julia A2 = map( (x)-convert(ASCIIString, string(x)), A) ERROR: invalid ASCII sequence in convert at ascii.jl:101 in bytestring at string.jl:644 in convert at ascii.jl:120 in anonymous at none:1 in map at base.jl:189 But after readcsv(file, UTF8 String) works! THX Paul W dniu 2015-07-08 o 20:46, Eduardo Lenz pisze: A2 = map( (x)-convert(ASCIIString, string(x)), A)
[julia-users] How rotate a cube f1 to its edges are parallel to another cube (f2) ?
How rotate a cube f1 to its edges are parallel to another cube (f2) ? I have two 3 dimensional orthogonal sets of the 1444 observation in each. julia size(f1) (1444,3) julia size(f2) (1444,3) cor in each are real 0, julia cor(f1) 3x3 Array{Float64,2}: 1.0 -2.39743e-16 3.8112e-16 -2.39743e-16 1.0 -2.02954e-16 3.8112e-16 -2.02954e-16 1.0 julia cor(f2) 3x3 Array{Float64,2}: 1.0 -5.55883e-17 1.76522e-17 -5.55883e-17 1.0 1.70523e-15 1.76522e-17 1.70523e-15 1.0 There are also orthogonal: angle in degrees matrix of f1 3x3 Array{Float64,2}: 0.0 90.0 90.0 90.0 0.0 90.0 90.0 90.0 0.0 angle in degrees matrix of f2 3x3 Array{Float64,2}: 0.0 90.0 90.0 90.0 0.0 90.0 90.0 90.0 0.0 but angle in degrees betwen f1 and f2 are: 90.6388 91.4539 88.8789 92.2294 90.6144 89.2666 88.8462 89.6773 92.377 angle in degrees betwen f2 and f1 are: 90.6388 92.2294 88.8462 91.4539 90.6144 89.6773 88.8789 89.2666 92.377 How rotate one of the cube to edges f1 are parallel to f2 ? first col f1 parallele to first col of f2 . etc... Paul
[julia-users] Win 7, How by one click on .bat file run the Julia and perform some script automatically ?
Win 7 How by one click on .bat file run the Julia and perform some script automatically ? for example. include(file.jl) My file.bat(below) run julia bat not started the script test.jl bin\julia.exe include(test.jl) Paul
Re: [julia-users] Re: Win 7, How by one click on .bat file run the Julia and perform some script automatically ?
BIG Thx, but not works, My Julia on win 7/64: Version 0.3.8 (2015-04-30 23:40 UTC) Official http://julialang.org/ release i686-w64-mingw32 *it is strange that:* bin\julia.exe -p 2 working bin\julia.exe -q working bin\julia.exe -h NO!! just on the moment (+-0.1 sek , I can`t read ) consloe is and close himself bin\julia.exe test.jl NO!! just on the moment (+-0.1 sek , I can`t read ) consloe is and close himself Paul W dniu 2015-07-02 o 16:53, Tony Kelman pisze: bin\julia.exe test.jl
Re: [julia-users] Re: Win 7, How by one click on .bat file run the Julia and perform some script automatically ?
I read the manual: -L, --load file Load file right after boot on all processors but bin\julia.exe -L, test.jl bin\julia.exe -L, test.jl bin\julia.exe -L, 'test.jl' not work Paul W dniu 2015-07-02 o 16:12, Scott Jones pisze: You'll need to pass that on the command line to julia, bin\julia -help will give you a list of all the command line options you can use. On Thursday, July 2, 2015 at 9:14:50 AM UTC-4, paul analyst wrote: Win 7 How by one click on .bat file run the Julia and perform some script automatically ? for example. include(file.jl) My file.bat(below) run julia bat not started the script test.jl bin\julia.exe include(test.jl) Paul
Re: [julia-users] Re: Win 7, How by one click on .bat file run the Julia and perform some script automatically ?
I have: bin\julia.exe -L test.jl without , Paul W dniu 2015-07-02 o 18:34, Paul Analyst pisze: Thanks test.jl a=rand(10) writecsv(a.txt, a) script run !!! But console sey: press any kay to continue... after press cloused :/ my.bat : bin\julia.exe test.jl pause Paul W dniu 2015-07-02 o 17:48, Tony Kelman pisze: Does the test script do anything? You could add pause at the end of the batch file to avoid the console window closing after completion. There's a difference between interactive commands that start up a REPL that waits for input, vs script commands that close when they're finished.
[julia-users] How from dimensional array cut out no more than the first 15 characters of each line, without loop. is posible it ?
How from dimensional array cut out no more than the first 15 characters of each line, without loop. is posible it ? I have : julia A 3-element Array{Any,1}: Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magn a aliqua. Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum. But i need julia A 3-element Array{Any,1}: Lorem ipsum dolor a aliqua. Ut enim ad minim Duis aute irure d sint occaecat cupi
Re: [julia-users] Re: How from dimensional array cut out no more than the first 15 characters of each line, without loop. is posible it ?
Thx Tom, nice !!! Paul W dniu 2015-07-02 o 21:13, Tom Breloff pisze: | map(x-x[1:min(length(x),15)],A) |
[julia-users] Is ready to function returning the greater variable?
Is ready to function returning the greater variable? x = 1 y = 2 fun (x, y) y Paul
[julia-users] How to insert new row/ egsisitng vector into array ?
Is posible insert new row (egsisitng vector) into array ? wihout hcat etc. ? Is something like insert! in iter ? julia a=rand(5,5) 5x5 Array{Float64,2}: 0.613346 0.864493 0.495873 0.571237 0.948809 0.688794 0.168175 0.732427 0.0516122 0.439683 0.740090.491623 0.0662683 0.160219 0.708842 0.0678776 0.601627 0.425847 0.329719 0.108245 0.689865 0.233258 0.171292 0.487139 0.452603 julia insert!(a,3,1,zeros(5)) ERROR: `insert!` has no method matching insert!(::Array{Float64,2}, ::Int32, ::Int32, ::Array{Float64,1}) julia insert!(a,[:,3],,zeros(5)) ERROR: syntax: unexpected , Paul?
[julia-users] Re: Is ready to function returning the greater variable?
Big thx , I tried maximum(x,y) P. W dniu piątek, 26 czerwca 2015 12:36:20 UTC+2 użytkownik Kristoffer Carlsson napisał: It is hard to understand your question but the function max(x,y) returns the greater of x and y. On Friday, June 26, 2015 at 12:33:34 PM UTC+2, paul analyst wrote: Is ready to function returning the greater variable? x = 1 y = 2 fun (x, y) y Paul
[julia-users] Re: Nan is readed as NaN but is the name of cat. How to read this data ?
orginal file here Lucycat Fliper dog Mia dog Nan cat Snupy dog
[julia-users] Re: Nan is readed as NaN but is the name of cat. How to read this data ?
Orginal file here Paul W dniu środa, 24 czerwca 2015 09:24:58 UTC+2 użytkownik paul analyst napisał: Nan is readed as NaN but Nan is the name of cat. How to read this data ? How to find the cat ? I have data.txt file , UTF8 Lucycat Fliperdog Miadog Nancat Snupydog julia data=readd readdir readdlm julia data=readdlm(data.txt,'\t') 5x2 Array{Any,2}: Lucycat Fliper dog Mia dog NaN cat Snupy dog julia unique(data[:,1]) 5-element Array{Any,1}: Lucy Fliper Mia NaN Snupy julia findin(data[:,1],[Fliper]) 1-element Array{Int32,1}: 2 julia findin(data[:,1],[Nan]) 0-element Array{Int32,1} Paul Lucycat Fliper dog Mia dog Nan cat Snupy dog
[julia-users] Nan is readed as NaN but is the name of cat. How to read this data ?
Nan is readed as NaN but Nan is the name of cat. How to read this data ? How to find the cat ? I have data.txt file , UTF8 Lucycat Fliperdog Miadog Nancat Snupydog julia data=readd readdir readdlm julia data=readdlm(data.txt,'\t') 5x2 Array{Any,2}: Lucycat Fliper dog Mia dog NaN cat Snupy dog julia unique(data[:,1]) 5-element Array{Any,1}: Lucy Fliper Mia NaN Snupy julia findin(data[:,1],[Fliper]) 1-element Array{Int32,1}: 2 julia findin(data[:,1],[Nan]) 0-element Array{Int32,1} Paul
Re: [julia-users] Re: Nan is readed as NaN but is the name of cat. How to read this data ?
Wow! julia a=readdlm(data.txt, '\t', ASCIIString) 5x2 Array{ASCIIString,2}: Lucycat Fliper dog Mia dog Nan cat Snupy dog julia unique(a[:,1]) 5-element Array{ASCIIString,1}: Lucy Fliper Mia Nan Snupy julia findin(a,Nan) 0-element Array{Int32,1} julia findin(a[:,1],[Nan]) 1-element Array{Int32,1}: 4 julia
Re: [julia-users] Re: Nan is readed as NaN but is the name of cat. How to read this data ?
Is better, If ia have file coded UTF8 , use readdlm(data.txt, '\t',UTF8String) ? Paul W dniu 2015-06-24 o 14:52, Avik Sengupta pisze: Interesting problem! :) Try: readlm(data.txt, '\t', ASCIIString) On Wednesday, 24 June 2015 03:24:58 UTC-4, paul analyst wrote: Nan is readed as NaN but Nan is the name of cat. How to read this data ? How to find the cat ? I have data.txt file , UTF8 Lucycat Fliperdog Miadog Nancat Snupydog julia data=readd readdir readdlm julia data=readdlm(data.txt,'\t') 5x2 Array{Any,2}: Lucycat Fliper dog Mia dog NaN cat Snupy dog julia unique(data[:,1]) 5-element Array{Any,1}: Lucy Fliper Mia NaN Snupy julia findin(data[:,1],[Fliper]) 1-element Array{Int32,1}: 2 julia findin(data[:,1],[Nan]) 0-element Array{Int32,1} Paul
[julia-users] read(STDIN,Char); in Win ,
in win julia x= read(STDIN,Char) t 't' julia julia julia x 't' julia becose is \r and \n How to do correctly ? for i=1:10println(i)println(if number is ok press 'y' )read(STDIN,Char);end I nead to vave control the code in any steps on while . This while jump 1 4 7 10 :/ How do it ? Paul
Re: [julia-users] read(STDIN,Char); in Win ,
I now it. But how to do the code usefull ? Paul W dniu poniedziałek, 22 czerwca 2015 20:41:23 UTC+2 użytkownik Stefan Karpinski napisał: You're on Windows – the line end is two characters, not one, so you have to check for both characters: http://blog.codinghorror.com/the-great-newline-schism/ On Mon, Jun 22, 2015 at 2:37 PM, paul analyst paul.a...@mail.com javascript: wrote: Why ? Mayby any user can help me ? Paul W dniu poniedziałek, 22 czerwca 2015 20:34:51 UTC+2 użytkownik Stefan Karpinski napisał: C'mon, please stop starting new threads about this. On Mon, Jun 22, 2015 at 2:27 PM, paul analyst paul.a...@mail.com wrote: in win julia x= read(STDIN,Char) t 't' julia julia julia x 't' julia becose is \r and \n How to do correctly ? for i=1:10println(i)println(if number is ok press 'y' )read(STDIN,Char);end I nead to vave control the code in any steps on while . This while jump 1 4 7 10 :/ How do it ? Paul
Re: [julia-users] read(STDIN,Char); in Win ,
Why ? Mayby any user can help me ? Paul W dniu poniedziałek, 22 czerwca 2015 20:34:51 UTC+2 użytkownik Stefan Karpinski napisał: C'mon, please stop starting new threads about this. On Mon, Jun 22, 2015 at 2:27 PM, paul analyst paul.a...@mail.com javascript: wrote: in win julia x= read(STDIN,Char) t 't' julia julia julia x 't' julia becose is \r and \n How to do correctly ? for i=1:10println(i)println(if number is ok press 'y' )read(STDIN,Char);end I nead to vave control the code in any steps on while . This while jump 1 4 7 10 :/ How do it ? Paul
Re: [julia-users] Re: How to read any lines with stream open(file)
Unfrtunatly can`t run, (in Julia 3.6 the same) _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type help() for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.4.0-dev+2847 (2015-01-21 18:34 UTC) _/ |\__'_|_|_|\__'_| | Commit fc61385 (146 days old master) |__/ | x86_64-w64-mingw32 julia f = open(temp.txt,w) IOStream(file temp.txt) julia for i in 1:20 write(f, $i\n) end julia close(f) julia readline(open(temp.txt), 15) ERROR: MethodError: `readline` has no method matching readline(::IOStream, ::Int64)SYSTEM: show(lasterr) caused an error julia readline(open(temp.txt)) 1\n julia readline(open(temp.txt)) 1\n julia readlines(open(temp.txt)) 20-element Array{Union(ASCIIString,UTF8String),1}: 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n 10\n 11\n 12\n 13\n 14\n 15\n 16\n 17\n 18\n 19\n 20\n Paul W dniu 2015-06-16 o 19:49, Tom Breloff pisze: You could create your own: | julia Base.readline(s, i::Int) = (for (j,line) in enumerate(eachline(s)); if j==i; return line; end; end; error(not enough lines)) readline (generic function with 4 methods) julia f = open(/tmp/tmp.txt, w) IOStream(file /tmp/tmp.txt) julia for i in 1:20 write(f, $i\n) end julia close(f) julia readline(open(/tmp/tmp.txt), 15) 15\n julia readline(open(/tmp/tmp.txt), 25) ERROR: not enough lines in readline at none:1 | On Tuesday, June 16, 2015 at 12:17:28 PM UTC-4, paul analyst wrote: If o is stream o=open(file) how to read any line ?e.g. 15 julia readline(o,15) ERROR: MethodError: `readline` has no method matching readline(::IOStream, ::Int64)SYSTEM: show(lasterr) caused error Paul
Re: [julia-users] Re: How to know the size of a large array stored in a csv file (greater than RAM
This way: how many rows/line o=open(storage2.txt) nol=0 while readline(o)!= nol+=1 end nol close(o) how anay regular col ? o=open(storage2.txt) cnt=0 for line=eachline(o) cnt=max(cnt, length(split(line, \t))) end close(o) cnt Paul W dniu poniedziałek, 15 czerwca 2015 21:31:41 UTC+2 użytkownik paul analyst napisał: W dniu 2015-06-15 o 15:13, Ian Hellström pisze: Would it be possible/feasible to introduce external data frames (like in Revolution Analytics R), so that we can work with data that does not fit into memory? Just an idea... this Idea is a stream (open ) but firs I mus know size of data . Do You know another way? Paul
[julia-users] How to read any lines with stream open(file)
If o is stream o=open(file) how to read any line ?e.g. 15 julia readline(o,15) ERROR: MethodError: `readline` has no method matching readline(::IOStream, ::Int64)SYSTEM: show(lasterr) caused error Paul
Re: [julia-users] Re: How to know the size of a large array stored in a csv file (greater than RAM
W dniu 2015-06-15 o 15:13, Ian Hellström pisze: Would it be possible/feasible to introduce external data frames (like in Revolution Analytics R), so that we can work with data that does not fit into memory? Just an idea... this Idea is a stream (open ) but firs I mus know size of data . Do You know another way? Paul
[julia-users] How to stop the program and enter the value of the variable from the keyboard (by user)?
How to stop the program and enter the value of the variable from the keyboard (by user)? in other words: How to choose variants of the program with the keyboard? for example: a=zeros(10); for i=1:10 x=rand(1);y=rand(1) if x[].y[] a[i]=x[] else a[i]=SOMTHIG FROM KEYBOARD (USER DECISION) end Paul
[julia-users] What wrong in read(STDIN,Int) ?
What wrong ? after typing 1 var = 939577809079766321 (one ENTER is to small ) julia println(type any digit and ENTER);x=read(STDIN,Int) type any digit and ENTER 1 939577809079766321 julia julia x 939577809079766321 julia println(type any digit and ENTER);x=read(STDIN,Int64) type any digit and ENTER 1
[julia-users] What wrong in read(STDIN,Int) ??? Re: How to stop the program and enter the value of the variable from the keyboard (by user)?
What wrong in read(STDIN,Int) ??? W dniu sobota, 23 maja 2015 19:31:47 UTC+2 użytkownik paul analyst napisał: What wrong ? after typing 1 var = 939577809079766321 (one ENTER is to small ) julia println(type any digit and ENTER);x=read(STDIN,Int) type any digit and ENTER 1 939577809079766321 julia julia x 939577809079766321 julia println(type any digit and ENTER);x=read(STDIN,Int64) type any digit and ENTER 1 939577809079766321 Paul W dniu sobota, 23 maja 2015 13:02:54 UTC+2 użytkownik paul analyst napisał: How to stop the program and enter the value of the variable from the keyboard (by user)? in other words: How to choose variants of the program with the keyboard? for example: a=zeros(10); for i=1:10 x=rand(1);y=rand(1) if x[].y[] a[i]=x[] else a[i]=SOMTHIG FROM KEYBOARD (USER DECISION) end Paul
[julia-users] Re: How to stop the program and enter the value of the variable from the keyboard (by user)?
What wrong ? after typing 1 var = 939577809079766321 (one ENTER is to small ) julia println(type any digit and ENTER);x=read(STDIN,Int) type any digit and ENTER 1 939577809079766321 julia julia x 939577809079766321 julia println(type any digit and ENTER);x=read(STDIN,Int64) type any digit and ENTER 1 939577809079766321 Paul W dniu sobota, 23 maja 2015 13:02:54 UTC+2 użytkownik paul analyst napisał: How to stop the program and enter the value of the variable from the keyboard (by user)? in other words: How to choose variants of the program with the keyboard? for example: a=zeros(10); for i=1:10 x=rand(1);y=rand(1) if x[].y[] a[i]=x[] else a[i]=SOMTHIG FROM KEYBOARD (USER DECISION) end Paul
Re: [julia-users] Re: How to create own format with two digits 3=03, 10=10, 99=99 (only range 00:99)
This Way now I`am working. I am lookingo for somthing faster. Paul W dniu 2015-05-20 o 17:56, Tim Wheeler pisze: Could you just cast your strings to normal integers, do your arithmetic, and then convert it back to a string with the necessary zero-padding? ``` @sprintf(%02d, int(01)*int(02)) ``` On Wednesday, May 20, 2015 at 8:28:03 AM UTC-7, paul analyst wrote: Big thx, but I need: 01*02=02 like 1*2=2 Paul W dniu 2015-05-20 o 14:21, Kristoffer Carlsson pisze: In Julia you concatenate strings with * | juliaa=[@sprintf(%02d,i)fori =1:99]; juliaa[1]*a[2] 0102 | On Wednesday, May 20, 2015 at 10:05:08 AM UTC+2, paul analyst wrote: Txh, but unfortunatly is not to compute julia a=[@sprintf(%02d,i) for i = 1:99]; julia a[1]+a[2] ERROR: MethodError: `+` has no method matching +(::ASCIIString, ::ASCIIString) Closest candidates are: +(::Any, ::Any, ::Any) +(::Any, ::Any, ::Any, ::Any...) I have in string data with time and i must compute changes only in on 2 last position table= 2015-01-01 2015-01-01 2015-01-12 I take last two digits int(table[i][9:10]) compute somthing and I must put the last two Chars Always i need 2 char '12' or '01' Paul W dniu 2015-05-20 o 09:57, Jeff Waller pisze: | *[@sprintf(%02d,i)fori =1:99]* |
[julia-users] How to create own format with two digits 3=03, 10=10, 99=99 (only range 00:99)
How to create own format with two digits 3=03, 10=10, 99=99 (only range 00:99) I need keep all digits on 2 positions 1 must be 01 10 must be 10 (I need compute on this and after save as Char) How define this format ? Paul
Re: [julia-users] Re: How to create own format with two digits 3=03, 10=10, 99=99 (only range 00:99)
Txh, but unfortunatly is not to compute julia a=[@sprintf(%02d,i) for i = 1:99]; julia a[1]+a[2] ERROR: MethodError: `+` has no method matching +(::ASCIIString, ::ASCIIString) Closest candidates are: +(::Any, ::Any, ::Any) +(::Any, ::Any, ::Any, ::Any...) I have in string data with time and i must compute changes only in on 2 last position table= 2015-01-01 2015-01-01 2015-01-12 I take last two digits int(table[i][9:10]) compute somthing and I must put the last two Chars Always i need 2 char '12' or '01' Paul W dniu 2015-05-20 o 09:57, Jeff Waller pisze: | *[@sprintf(%02d,i)fori =1:99]* |
Re: [julia-users] Re: How to create own format with two digits 3=03, 10=10, 99=99 (only range 00:99)
Big thx, but I need: 01*02=02 like 1*2=2 Paul W dniu 2015-05-20 o 14:21, Kristoffer Carlsson pisze: In Julia you concatenate strings with * | juliaa=[@sprintf(%02d,i)fori =1:99]; juliaa[1]*a[2] 0102 | On Wednesday, May 20, 2015 at 10:05:08 AM UTC+2, paul analyst wrote: Txh, but unfortunatly is not to compute julia a=[@sprintf(%02d,i) for i = 1:99]; julia a[1]+a[2] ERROR: MethodError: `+` has no method matching +(::ASCIIString, ::ASCIIString) Closest candidates are: +(::Any, ::Any, ::Any) +(::Any, ::Any, ::Any, ::Any...) I have in string data with time and i must compute changes only in on 2 last position table= 2015-01-01 2015-01-01 2015-01-12 I take last two digits int(table[i][9:10]) compute somthing and I must put the last two Chars Always i need 2 char '12' or '01' Paul W dniu 2015-05-20 o 09:57, Jeff Waller pisze: | *[@sprintf(%02d,i)fori =1:99]* |
Re: [julia-users] Re: how to replace , to . in Array{Any,2}:
It work, thx, Paul W dniu 2015-05-19 o 01:30, ele...@gmail.com pisze: Strings are immutable, so replace can't change the existing string, so it returns a new string, so map returns a new array which you have to assign back to x Cheers Lex On Tuesday, May 19, 2015 at 2:10:18 AM UTC+10, paul analyst wrote: Big thx, but after this code x is no changed Paul W dniu 2015-05-17 o 20:23, wil...@gmail.com javascript: pisze: map(e-replace(string(e), ',', '.'), x) On Saturday, May 16, 2015 at 2:40:05 PM UTC-4, paul analyst wrote: I have file with decimal separator lika , x=readdlm(x.txt,'\t') julia x=x[2:end,:] 6390x772 Array{Any,2}: some kolumns looks : julia x[:,69] 6390-element Array{Any,1}: 0.0 0,33 0,72 1,09 0,95 3,57 2,27 2,42 julia replace(x[:,69],',','.') ERROR: `replace` has no method matching replace(::Array{Any,1}, ::Char, ::Char) julia replace(string(x[:,69],',','.')) ERROR: `replace` has no method matching replace(::ASCIIString) how to replace , to . ? I can repalce all , to . Paul
Re: [julia-users] Re: how to replace , to . in Array{Any,2}:
Big thx, but after this code x is no changed Paul W dniu 2015-05-17 o 20:23, wild...@gmail.com pisze: map(e-replace(string(e), ',', '.'), x) On Saturday, May 16, 2015 at 2:40:05 PM UTC-4, paul analyst wrote: I have file with decimal separator lika , x=readdlm(x.txt,'\t') julia x=x[2:end,:] 6390x772 Array{Any,2}: some kolumns looks : julia x[:,69] 6390-element Array{Any,1}: 0.0 0,33 0,72 1,09 0,95 3,57 2,27 2,42 julia replace(x[:,69],',','.') ERROR: `replace` has no method matching replace(::Array{Any,1}, ::Char, ::Char) julia replace(string(x[:,69],',','.')) ERROR: `replace` has no method matching replace(::ASCIIString) how to replace , to . ? I can repalce all , to . Paul
Re: [julia-users] Re: how do we convert an array{Float64,1} in a Float64?
But very important ! Paul W dniu 2015-05-18 o 17:45, Sisyphuss pisze: Side note: A[] == A[1] On Saturday, May 16, 2015 at 9:19:48 PM UTC+2, paul analyst wrote: Use [] julia A=rand(1) 1-element Array{Float64,1}: 0.33519 julia A[] 0.3351896128863725 julia W dniu piątek, 15 maja 2015 23:18:32 UTC+2 użytkownik Lytu napisał: Someone know how to convert an array{Float64,1} in a Float64? Thank you
[julia-users] Re: how to replace , to . in Array{Any,2}:
I see, . No any hints? Paul W dniu niedziela, 17 maja 2015 01:28:50 UTC+2 użytkownik ele...@gmail.com napisał: I don't think replace broadcasts, you have to write a loop applying replace to each string at a time. On Sunday, May 17, 2015 at 4:40:05 AM UTC+10, paul analyst wrote: I have file with decimal separator lika , x=readdlm(x.txt,'\t') julia x=x[2:end,:] 6390x772 Array{Any,2}: some kolumns looks : julia x[:,69] 6390-element Array{Any,1}: 0.0 0,33 0,72 1,09 0,95 3,57 2,27 2,42 julia replace(x[:,69],',','.') ERROR: `replace` has no method matching replace(::Array{Any,1}, ::Char, ::Char) julia replace(string(x[:,69],',','.')) ERROR: `replace` has no method matching replace(::ASCIIString) how to replace , to . ? I can repalce all , to . Paul
[julia-users] Re: How to convert a matrix in Julia ?
H=Float64[5 3 6;3 9 12;6 12 17] Paul W dniu niedziela, 17 maja 2015 10:03:28 UTC+2 użytkownik Lytu napisał: Hello Julia users, How can i convert an Array{Int32,2} matrix H in an Array{Float64,2} matrix? For example: H=[5 3 6;3 9 12;6 12 17] I ask this because i would like to do this: H=[5 3 6;3 9 12;6 12 17] val=-7.046128291045994 H[2,1] = val but it gives an error: InexactError() I think it is because val is a* float64* and the matrix H is an *Array{Int32,2}* Does anybody know how i can do this? Thanks
[julia-users] Re: how do we convert an array{Float64,1} in a Float64?
Use [] julia A=rand(1) 1-element Array{Float64,1}: 0.33519 julia A[] 0.3351896128863725 julia W dniu piątek, 15 maja 2015 23:18:32 UTC+2 użytkownik Lytu napisał: Someone know how to convert an array{Float64,1} in a Float64? Thank you
[julia-users] Re: how do we convert an array{Float64,1} in a Float64?
Or simply julia A=rand(1)[] 0.5353688036503286 Paul W dniu sobota, 16 maja 2015 21:19:48 UTC+2 użytkownik paul analyst napisał: Use [] julia A=rand(1) 1-element Array{Float64,1}: 0.33519 julia A[] 0.3351896128863725 julia W dniu piątek, 15 maja 2015 23:18:32 UTC+2 użytkownik Lytu napisał: Someone know how to convert an array{Float64,1} in a Float64? Thank you
[julia-users] how to replace , to . in Array{Any,2}:
I have file with decimal separator lika , x=readdlm(x.txt,'\t') julia x=x[2:end,:] 6390x772 Array{Any,2}: some kolumns looks : julia x[:,69] 6390-element Array{Any,1}: 0.0 0,33 0,72 1,09 0,95 3,57 2,27 2,42 julia replace(x[:,69],',','.') ERROR: `replace` has no method matching replace(::Array{Any,1}, ::Char, ::Char) julia replace(string(x[:,69],',','.')) ERROR: `replace` has no method matching replace(::ASCIIString) how to replace , to . ? I can repalce all , to . Paul
[julia-users] Re: Problem with if else in Julia
You can use [] after a if a[]0 works also Paul W dniu piątek, 15 maja 2015 23:14:43 UTC+2 użytkownik Lytu napisał: When i do: M=rand(5,5) a=M[:,1]' * M[:,1] if a0 println(Less than 0) else println(more) end I have an error: isless has no method matching isless(::Array{Float64,2}, ::Int 32) in at operators.jl:32 Can anyone tell me please how to do this? Thank you
[julia-users] How to cleen all vars and proces ?
How to cleen all vars and proces ? Is in Julia somthink like reload all modules ? Start again ? Paul
[julia-users] Re: Looking for incomplete SVD -- need only some of the singular values
eigs(A[, B], ; nev=6, which=”LM”, tol=0.0, maxiter=1000, sigma=nothing, ritzvec=true, v0=zeros((0, ))) - (d[, v ], nconv, niter, nmult, resid) eigs computes eigenvalues d of A using Lanczos or Arnoldi iterations for real symmetric or general nonsymmetric matrices nev= number of eigens... Paul W dniu niedziela, 15 marca 2015 21:10:08 UTC+1 użytkownik Erik Schnetter napisał: I am looking for a routine that calculate the SVD (singular value decomposition) of a square, complex, dense, non-symmetric matrix. I am aware of Julia's SVD routine (and the respective LAPACK routines that one could call directly). However, I don't need all of the singular values -- I need only the largest one (or some of the largest ones), as well as the associated entries of U. Is there such a routine? I didn't find one in Julia. I've looked for other packages that could be wrapped, but couldn't find any that offers this feature. The only thing I found is a description of the svds Matlab routine, which is apparently based on eigs. -erik -- Erik Schnetter schn...@gmail.com javascript: http://www.perimeterinstitute.ca/personal/eschnetter/ My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from https://sks-keyservers.net.
Re: [julia-users] Re: webpy equivalent
Thx for info look nice but I am using win7 , usualy using Pkg.add. How to install skeleton-webapp on my Julia under win? ? julia Pkg.available() 551-element Array{ASCIIString,1}: AffineTransforms ... Sims SIUnits SliceSampler Smile SmoothingKernels SMTPClient Snappy Sobol ... No skeleton-webapp Paul W dniu 2015-03-11 o 21:28, jock.law...@gmail.com pisze: Hi Jonathan, Uncanny timing. Here https://bitbucket.org/jocklawrie/skeleton-webapp.jl is an example of Julia working with the Mustache.jl package which I posted just a couple of hours before your post. It works fine but is not nearly as mature as webpy. Hope you find it helpful. Cheers, Jock On Friday, November 1, 2013 at 3:00:25 AM UTC+11, Jonathan Malmaud wrote: Anywhere aware of a package that implements a light-weight HTTP server framework for Julia? Something like webpy + and a templating engine like jinja2?
Re: [julia-users] webpy equivalent
Hi Masters Hi , I try raun Medle , all is ok only cant find dir for root. Wher put my file index.html ? Paul
Re: [julia-users] Re: how to remove the quotation marks ?
I see , Thx, propably this is nad way, ;) Paul W dniu poniedziałek, 2 marca 2015 13:01:36 UTC+1 użytkownik Tamas Papp napisał: I am afraid you are missing something fundamental here. Those double quotes are not part of the strings, they are just a printing convention that Julia uses (which coincides with the read syntax). Similarly, julia print([1,2,3]) [1,2,3] even though the array has no elements [ or ], not even ','. You have to decide what you want. Using Darwin Darakananda's solution, you can write those strings into a file, and then naturally they would have no quotes. Or if you want to transform them to something else which is still a string, then quotes will appear when the output is printed at the REPL, even if it has no quotes. By the way, these concepts are not specific to Julia. Unless you understand the very basics of programming languages, you will have a rather difficult time using Julia or any other language. hope this helps, Tamas On Mon, Mar 02 2015, Paul Analyst paul.a...@mail.com javascript: wrote: look nice but result is nothing :) julia a=map(println,[r]) !DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN htmlhead title302 Found/title /headbody h1Found/h1 pThe document has moved a href=http://www4.rp.pl/;here/a./p /body/html 1-element Array{Void,1}: nothing Paul julia W dniu 2015-03-02 o 06:51, Darwin Darakananda pisze: How about something like | map(println,[abc,def]); abc def | On Sunday, March 1, 2015 at 1:00:38 PM UTC-8, paul analyst wrote: I need :) P W dniu niedziela, 1 marca 2015 20:47:15 UTC+1 użytkownik Simon Danisch napisał: If I'm not mistaken, that's how an array of strings gets displayed: julia[tets, test] test test So no need for removing them! Am Sonntag, 1. März 2015 19:51:40 UTC+1 schrieb paul analyst: Przetłumacz wiadomość na język polski how to remove the quotation marks ?, like below.. julia (split(bytestring(r.body),\r\n)) 180-element Array{SubString{UTF8String},1} : !DOCTYPE html html head
Re: [julia-users] Re: how to remove the quotation marks ?
look nice but result is nothing :) julia a=map(println,[r]) !DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN htmlhead title302 Found/title /headbody h1Found/h1 pThe document has moved a href=http://www4.rp.pl/;here/a./p /body/html 1-element Array{Void,1}: nothing Paul julia W dniu 2015-03-02 o 06:51, Darwin Darakananda pisze: How about something like | map(println,[abc,def]); abc def | On Sunday, March 1, 2015 at 1:00:38 PM UTC-8, paul analyst wrote: I need :) P W dniu niedziela, 1 marca 2015 20:47:15 UTC+1 użytkownik Simon Danisch napisał: If I'm not mistaken, that's how an array of strings gets displayed: julia[tets, test] test test So no need for removing them! Am Sonntag, 1. März 2015 19:51:40 UTC+1 schrieb paul analyst: Przetłumacz wiadomość na język polski how to remove the quotation marks ?, like below.. julia (split(bytestring(r.body),\r\n)) 180-element Array{SubString{UTF8String},1} : !DOCTYPE html html head
Re: [julia-users] How to html parse ?
Thx, Now I am learning Gumbo. please see there: julia JSON.parse(get(http://rp.pl;).data) ERROR: Unknown value Line: 0 Around: ...!DOCTYPE HTML PUBLIC... ^ Ii posible the page to convert to JSON ? Paul W dniu 2015-03-02 o 16:46, Stefan Karpinski pisze: James Porter has an HTML parsing package based on Google's Gumbo library: https://github.com/porterjamesj/Gumbo.jl However, what's happening here is that you're getting a 302 moved response and the content is just a renderable version of that. What you actually want to do is look at the response code and headers to figure out what page to actually get and parse as JSON. Or you could use curl with the appropriate options and it will do this for you.
Re: [julia-users] How to html parse ?
Do You now any HTML parser for Julia who do it ? Paul W dniu 2015-03-01 o 22:04, Jameson Nash pisze: That page isn't a JSON formatted document. Perhaps you were looking for a HTML parser? On Sun, Mar 1, 2015 at 4:02 PM paul analyst paul.anal...@mail.com mailto:paul.anal...@mail.com wrote: For some pages JSON parser is OK, but most pages no, like below. How to html parse ? julia get(http://rp.pl;).data !DOCTYPE HTML PUBLIC \-//IETF//DTD HTML 2.0//EN\\nhtmlhead\ntitle302 Found/title\n/headbod Found/h1\npThe document has moved a href=\http://www4.rp.pl/\ http://www4.rp.pl/%5Chere/a./p\n/body/html\n julia JSON.parse(get(http://rp.pl;).data) ERROR: Unknown value Line: 0 Around: ...!DOCTYPE HTML PUBLIC... ^ in error at error.jl:19 julia Paul
[julia-users] how to remove the quotation marks ?
Przetłumacz wiadomość na język polski how to remove the quotation marks ?, like below.. julia (split(bytestring(r.body),\r\n)) 180-element Array{SubString{UTF8String},1} : !DOCTYPE html html head
[julia-users] how to remove the quotation marks ( (split(bytestring(r.body),\r\n)))
how to remove the quotation marks ? julia (split(bytestring(r.body),\r\n)) 180-element Array{SubString{UTF8String},1}: !DOCTYPE html html head titleSilniki rekomendacyjne, analizy wielowymiarowe, algorytmy Big Data, Paweł Klimczewski/title
[julia-users] how to remove the quotation marks ?
how to remove the quotation marks ? julia (split(bytestring(r.body),\r\ n)) 180-element Array{SubString{UTF8String},1}: !DOCTYPE html html head titleSilniki rekomendacyjne, analizy wielowymiarowe,
[julia-users] Re: how to remove the quotation marks ?
I need :) P W dniu niedziela, 1 marca 2015 20:47:15 UTC+1 użytkownik Simon Danisch napisał: If I'm not mistaken, that's how an array of strings gets displayed: julia[tets, test] test test So no need for removing them! Am Sonntag, 1. März 2015 19:51:40 UTC+1 schrieb paul analyst: Przetłumacz wiadomość na język polski how to remove the quotation marks ?, like below.. julia (split(bytestring(r.body),\r\n)) 180-element Array{SubString{UTF8String},1} : !DOCTYPE html html head
[julia-users] How to html parse ?
For some pages JSON parser is OK, but most pages no, like below. How to html parse ? julia get(http://rp.pl;).data !DOCTYPE HTML PUBLIC \-//IETF//DTD HTML 2.0//EN\\nhtmlhead\ntitle302 Found/title\n/headbod Found/h1\npThe document has moved a href=\http://www4.rp.pl/\;here/a./p\n/body/html\n julia JSON.parse(get(http://rp.pl;).data) ERROR: Unknown value Line: 0 Around: ...!DOCTYPE HTML PUBLIC... ^ in error at error.jl:19 julia Paul
Re: [julia-users] Re: How to read and change the content of web pages to the vector ?
HI James, I have a doc downloaded from web download(url, file) doc=readall(file) julia eltype(doc) Char julia doc !DOCTYPE html\r\nhtml\r\nhead\r\n titleSil . \n/script\r\n/div\r\n\r\n/body\r\n/html\r\n What next with Gumbo? my doc is not ready to Gumbo julia for elem in preorder(doc.root) println(tag(elem)) end ERROR: type UTF8String has no field root in anonymous at no file How to convert my data for Gumbo? Paul W dniu poniedziałek, 9 czerwca 2014 19:35:38 UTC+2 użytkownik paul analyst napisał: Thx James, i will try Paul. W dniu 2014-06-09 19:04, James Porter pisze: https://github.com/porterjamesj/GumboParser.jl
Re: [julia-users] Re: How to quickly count the moving average with one vector and save in the other vec? Whitout while
Thx Stefan (Dziękuję Stefan ;)) it is working : a=rand(100) b=zeros(100) [b[i:min(i+9,end)]=mean(a[i:min(i+9,end)]) for i=1:10:length(a) ] Paul W dniu wtorek, 10 lutego 2015 14:59:08 UTC+1 użytkownik Stefan Karpinski napisał: There's always going to be a loop since that's what the computer is doing. Either you wrote it or someone wrote it for you. In this case you can use a comprehension: [ mean(b[i:min(i+9,end)]) for i=1:10:length(b) ] On Tue, Feb 10, 2015 at 5:48 AM, paul analyst paul.a...@mail.com javascript: wrote: ok, it is jumping average :) Nice way, thx, but unfortunatly lenght of my vecotrs are random, 100 it was only like sample. reshape of vector length on 256845 is imposible:) Paul W dniu wtorek, 10 lutego 2015 11:18:55 UTC+1 użytkownik Gunnar Farnebäck napisał: If speed is what's important you almost certainly want some kind of loop. If it's more important not to have a loop you can satisfy your specification with b = reshape(repmat(mean(reshape(a,10,10),1),10),100) although that's not what I would call a moving average. Den tisdag 10 februari 2015 kl. 10:00:36 UTC+1 skrev paul analyst: How to quickly count the moving average with one vector and save the other vector? I have vec a and need to fill vec b moving average of a, in this same range. Is posible to do it whitout while ? julia a=rand(100); julia b=zeros(100); julia b[1:10]=mean(a[1:10]) 0.6312220153427996 julia b[11:20]=mean(a[11:20]) 0.6356771620528772 julia b 100-element Array{Float64,1}: 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.635677 0.635677 0.635677 0.635677 0.635677 0.635677 0.635677 0.635677 0.635677 ? 0.0 Paul 0.0
[julia-users] How to quickly count the moving average with one vector and save in the other vec? Whitout while
How to quickly count the moving average with one vector and save the other vector? I have vec a and need to fill vec b moving average of a, in this same range. Is posible to do it whitout while ? julia a=rand(100); julia b=zeros(100); julia b[1:10]=mean(a[1:10]) 0.6312220153427996 julia b[11:20]=mean(a[11:20]) 0.6356771620528772 julia b 100-element Array{Float64,1}: 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.635677 0.635677 0.635677 0.635677 0.635677 0.635677 0.635677 0.635677 0.635677 ? 0.0 Paul 0.0
[julia-users] Re: How to quickly count the moving average with one vector and save in the other vec? Whitout while
ok, it is jumping average :) Nice way, thx, but unfortunatly lenght of my vecotrs are random, 100 it was only like sample. reshape of vector length on 256845 is imposible:) Paul W dniu wtorek, 10 lutego 2015 11:18:55 UTC+1 użytkownik Gunnar Farnebäck napisał: If speed is what's important you almost certainly want some kind of loop. If it's more important not to have a loop you can satisfy your specification with b = reshape(repmat(mean(reshape(a,10,10),1),10),100) although that's not what I would call a moving average. Den tisdag 10 februari 2015 kl. 10:00:36 UTC+1 skrev paul analyst: How to quickly count the moving average with one vector and save the other vector? I have vec a and need to fill vec b moving average of a, in this same range. Is posible to do it whitout while ? julia a=rand(100); julia b=zeros(100); julia b[1:10]=mean(a[1:10]) 0.6312220153427996 julia b[11:20]=mean(a[11:20]) 0.6356771620528772 julia b 100-element Array{Float64,1}: 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.631222 0.635677 0.635677 0.635677 0.635677 0.635677 0.635677 0.635677 0.635677 0.635677 ? 0.0 Paul 0.0
[julia-users] No help ? ? Re: Binomial , how compute discret (or / and cumulated) value ?
No help ? W dniu niedziela, 8 lutego 2015 21:34:33 UTC+1 użytkownik paul analyst napisał: I have : ntrials =10 p =0.5 succprob=5 how to compute discret (or / and cumulated) value of Binomial distibution ? Must be 0,246094... Paul
[julia-users] Binomial, how to compute ?
I have : ntrials =10 failprob =0.5 succprob=5 how to compute discret (or / and cumulated) value of Binomial distibution ? Must be 0,246094... Paul
[julia-users] Re: Binomial, how to compute ?
Mistake is in first isue p=0.5, not failprob I have : ntrials =10 p =0.5 succprob=5 how to compute discret (or / and cumulated) value of Binomial distibution ? Must be 0,246094... Paul
[julia-users] Binomial , how compute discret (or / and cumulated) value ?
I have : ntrials =10 p =0.5 succprob=5 how to compute discret (or / and cumulated) value of Binomial distibution ? Must be 0,246094... Paul
[julia-users] How to build (automaticly) a vector with a range of indivisible ?
How to build (automaticly) a vector with a range of indivisible ? k=1 l=11 p=3 I need vec : [1 4 7 10 11 ] Paul
Re: [julia-users] How to build (automaticly) a vector with a range of indivisible ?
simply ! start=1 st=3 k=601 v=[start:fld(k,st):k];push!(v,k) Paul W dniu wtorek, 3 lutego 2015 14:24:16 UTC+1 użytkownik paul analyst napisał: W dniu wtorek, 3 lutego 2015 14:16:49 UTC+1 użytkownik paul analyst napisał: Thx Tamas, i see idea, but in this function is somthing wrong ? julia range(1,3,603) 1:3:18060001 Paul This way: julia a=1 1 julia st=3 3 julia finish=601 601 julia [a:fld(finish,3):finish] 30001-element Array{Int64,1}: 1 201 401 601 801 1001 ... 5999801 601 Paul W dniu wtorek, 3 lutego 2015 14:08:57 UTC+1 użytkownik Tamas Papp napisał: Eg function range_end(a,step,b) v = a:step:b if v[end] != b v = [v,b] end v end [1 4 ... ] is not a vector, but a matrix. You will need to transpose the result if you want that. Also, if the range does not need to be extended, it is left as is, should work fine in most applications, but you can of course convert it. Best, Tamas On Tue, Feb 03 2015, paul analyst paul.a...@mail.com wrote: How to build (automaticly) a vector with a range of indivisible ? k=1 l=11 p=3 I need vec : [1 4 7 10 11 ] Paul
Re: [julia-users] How to build (automaticly) a vector with a range of indivisible ?
W dniu wtorek, 3 lutego 2015 14:16:49 UTC+1 użytkownik paul analyst napisał: Thx Tamas, i see idea, but in this function is somthing wrong ? julia range(1,3,603) 1:3:18060001 Paul This way: julia a=1 1 julia st=3 3 julia finish=601 601 julia [a:fld(finish,3):finish] 30001-element Array{Int64,1}: 1 201 401 601 801 1001 ... 5999801 601 Paul W dniu wtorek, 3 lutego 2015 14:08:57 UTC+1 użytkownik Tamas Papp napisał: Eg function range_end(a,step,b) v = a:step:b if v[end] != b v = [v,b] end v end [1 4 ... ] is not a vector, but a matrix. You will need to transpose the result if you want that. Also, if the range does not need to be extended, it is left as is, should work fine in most applications, but you can of course convert it. Best, Tamas On Tue, Feb 03 2015, paul analyst paul.a...@mail.com wrote: How to build (automaticly) a vector with a range of indivisible ? k=1 l=11 p=3 I need vec : [1 4 7 10 11 ] Paul
Re: [julia-users] How to build (automaticly) a vector with a range of indivisible ?
Thx Tamas, i see idea, but in this function is somthing wrong ? julia range(1,3,603) 1:3:18060001 Paul W dniu wtorek, 3 lutego 2015 14:08:57 UTC+1 użytkownik Tamas Papp napisał: Eg function range_end(a,step,b) v = a:step:b if v[end] != b v = [v,b] end v end [1 4 ... ] is not a vector, but a matrix. You will need to transpose the result if you want that. Also, if the range does not need to be extended, it is left as is, should work fine in most applications, but you can of course convert it. Best, Tamas On Tue, Feb 03 2015, paul analyst paul.a...@mail.com javascript: wrote: How to build (automaticly) a vector with a range of indivisible ? k=1 l=11 p=3 I need vec : [1 4 7 10 11 ] Paul
[julia-users] How to make vector 'c' such that they are the values of the vector a but not in the vector b?
How to make vector 'c' such that they are the values of the vector a but not in the vector b? (Excluding the value of b with a ) julia b=[1 2 5] 1x3 Array{Int64,2}: 1 2 5 julia a=[1:1:10] 10-element Array{Int64,1}: 1 2 3 4 5 6 7 8 9 10 expected c: 3 4 6 7 8 9 10 Paul
Re: [julia-users] How to make vector 'c' such that they are the values of the vector a but not in the vector b?
Thx, my idea was to long;) c=copy(a) deleteat!(c,findin(a,b)) Paul W dniu poniedziałek, 2 lutego 2015 13:43:18 UTC+1 użytkownik Tamas Papp napisał: Perhaps setdiff(a, b) or a[indexin(a, b) .== 0] I don't know which is faster, for small arrays it should not matter. Best, Tamas On Mon, Feb 02 2015, paul analyst paul.a...@mail.com javascript: wrote: How to make vector 'c' such that they are the values of the vector a but not in the vector b? (Excluding the value of b with a ) julia b=[1 2 5] 1x3 Array{Int64,2}: 1 2 5 julia a=[1:1:10] 10-element Array{Int64,1}: 1 2 3 4 5 6 7 8 9 10 expected c: 3 4 6 7 8 9 10 Paul