[julia-users] How to know the size of a large array stored in a csv file (greater than RAM
How to know the size of a large array stored in a csv file (greater than RAM , I can not use readcsv. After that I want to apply the open (file, size, size) 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
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 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() 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() 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 read any lines with stream open(file)
Ok, sorry, i don`t see 1 line:) |Base.readline(s, i::Int) = (for (j,line) in enumerate(eachline(s)); if j==i; return line; end; end; error("not enough lines")) Is oK ,big thx Paul | W dniu 2015-06-17 o 11:27, Paul Analyst pisze: 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() 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() 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 read any lines with stream open(file)
Is another way [1:end-1] to lost "\n" on the end of line? julia> readline(open("temp.txt"))[1:end] "1\n" julia> readline(open("temp.txt"))[1:end-1] "1" Paul W dniu 2015-06-17 o 11:33, Paul Analyst pisze: Ok, sorry, i don`t see 1 line:) |Base.readline(s, i::Int) = (for (j,line) in enumerate(eachline(s)); if j==i; return line; end; end; error("not enough lines")) Is oK ,big thx Paul | W dniu 2015-06-17 o 11:27, Paul Analyst pisze: 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() 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() 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
[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 ,
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 > 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 ,
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 > 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 >>> 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 >>>> >>> >>> >
[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}: "Lucy""cat" "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] 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}: > "Lucy""cat" > "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] 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
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}: "Lucy""cat" "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}: "Lucy""cat" "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] 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] 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] 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] 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 ?
I read the manual: -L, --load Load 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 ?
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 ?
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.
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] 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] 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] 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)
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)
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] Is @@ reservd word in Julia ? Can I use @@ in data?
Is @@ reservd word in Julia ? Can I use @@ in data? Paul
[julia-users] How to find last somethink in vector ?
How to find last somethink in vector ? how to find index of last "1" 1 0 0 1 0 0 0 1 1 0 0 0 0 0 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] 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
[julia-users] Is some Autocorrelation function in Julia?
*Is some Autocorrelation function in Julia?Paul*
[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 > >
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 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
[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
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
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
[julia-users] how to apply vector on diagonal of matrix ?
a=rand(5) b=zeros(5,5) how to apply a on diagonal b ? Paul
[julia-users] Re: how to apply vector on diagonal of matrix ?
b- not is zeros sometimes... c= diagm(a) b=b+c. Thx Paul W dniu wtorek, 20 maja 2014 16:17:11 UTC+2 użytkownik Oliver Lylloff napisał: > > Hi Paul, > > if b is just zeros, then b = diagm(a). > > Best, > Oliver > > > > Den tirsdag den 20. maj 2014 15.04.33 UTC+2 skrev paul analyst: >> >> a=rand(5) >> b=zeros(5,5) >> how to apply a on diagonal b ? >> Paul >> >
Re: [julia-users] Re: how to apply vector on diagonal of matrix ?
I have arrays about 10k*10k. Is faster by loop? Paul W dniu 2014-05-20 17:18, Oliver Lylloff pisze: Yes, and for larger arrays it might be beneficial to write in a loop: a = rand(1000); b = rand(1000,1000); for i = 1:length(a) b[i,i] = b[i,i] + a[i]; end Den tirsdag den 20. maj 2014 16.48.30 UTC+2 skrev paul analyst: b- not is zeros sometimes... c= diagm(a) b=b+c. Thx Paul W dniu wtorek, 20 maja 2014 16:17:11 UTC+2 użytkownik Oliver Lylloff napisał: Hi Paul, if b is just zeros, then b = diagm(a). Best, Oliver Den tirsdag den 20. maj 2014 15.04.33 UTC+2 skrev paul analyst: a=rand(5) b=zeros(5,5) how to apply a on diagonal b ? Paul
[julia-users] How quickly calculate distances arrays etc.
How quickly calculate distances arrays etc. This is an array of quotients, on the diagonal must be zero. Are there any features that quickly count this type of arrays? Data in F... k=size(F,2); O=zeros(k,k); for o=0:k-2; for i=1:k-1-o j=i+1+o; O[i,j]=sum(F[:,i])/sum(F[:,j]); O[j,i]=1/O[i,j]; end; end; Paul
[julia-users] when the loop variable takes on values from a vector?
I have some vector : 1 4 56 67 99 and some loop: for i F(i) do somethink end How to assign a variable (i) only value from a vector? Paul
Re: [julia-users] when the loop variable takes on values from a vector?
if vector a=[1, 4, 56, 67, 99] cod is for i in a F(i) end ? Paul ? W dniu poniedziałek, 26 maja 2014 19:09:03 UTC+2 użytkownik Jameson napisał: > > for i in [1, 4, 56, 67, 99] > F(i) > end > > On Mon, May 26, 2014 at 12:52 PM, paul analyst > > > wrote: > > I have some vector : 1 4 56 67 99 > > > > and some loop: > > > > for i > > F(i) do somethink > > end > > > > How to assign a variable (i) only value from a vector? > > > > Paul >
Re: [julia-users] when the loop variable takes on values from a vector?
Thx, W dniu poniedziałek, 26 maja 2014 19:23:24 UTC+2 użytkownik Jameson napisał: > > yes, unless i did not understand the question correctly > > On Mon, May 26, 2014 at 1:15 PM, paul analyst > > > wrote: > > if vector a=[1, 4, 56, 67, 99] > > > > cod is > > > > for i in a > > F(i) > > end > > ? > > Paul ? > > > > W dniu poniedziałek, 26 maja 2014 19:09:03 UTC+2 użytkownik Jameson > napisał: > >> > >> for i in [1, 4, 56, 67, 99] > >> F(i) > >> end > >> > >> On Mon, May 26, 2014 at 12:52 PM, paul analyst > wrote: > >> > I have some vector : 1 4 56 67 99 > >> > > >> > and some loop: > >> > > >> > for i > >> > F(i) do somethink > >> > end > >> > > >> > How to assign a variable (i) only value from a vector? > >> > > >> > Paul >
[julia-users] How quickly and automatically find the cut-off point of vectors with long tails ?
How quickly and automatically cut off long tails We have often sorted vectors with long tails. How quickly and automatically find the cut-off point where the graph flattens? Vectors are long and have a variety of unpleasant characteristics. Simple sample: a=[5 3 2 1.5 1.1 1 0.8 0.25 0.2 0.16] b=[156 125 112 101 89 88 56 66 62 61] Paul
[julia-users] Re: How quickly and automatically find the cut-off point of vectors with long tails ?
W dniu wtorek, 27 maja 2014 12:19:09 UTC+2 użytkownik Yuuki Soho napisał: > > The simplest way to do it is probably to use a quantile: > > > a=[5 3 2 1.5 1.1 1 0.8 0.25 0.2 0.16] > > q = quantile(vec(a),0.1) > > a = a[1:cut] > > > Does not work always, distributions are different. > How to find the number of elements of the vector from which the chart is > getting flat (where is the beginning of the tail?) > Paul >
[julia-users] Re: How quickly and automatically find the cut-off point of vectors with long tails ?
Does not work always, distributions are different. How to find the number of elements of the vector from which the chart is getting flat (where is the beginning of the tail?) Paul W dniu wtorek, 27 maja 2014 12:19:09 UTC+2 użytkownik Yuuki Soho napisał: > > The simplest way to do it is probably to use a quantile: > > > a=[5 3 2 1.5 1.1 1 0.8 0.25 0.2 0.16] > > q = quantile(vec(a),0.1) > > a = a[1:cut] > > >
Re: [julia-users] Re: How quickly and automatically find the cut-off point of vectors with long tails ?
Thanks for the cool link. Generally this is the point where the tangential tilt is 45 degrees. Paul W dniu wtorek, 27 maja 2014 15:06:25 UTC+2 użytkownik Harlan Harris napisał: > > Paul, I don't believe that this is a well-posed question. Determining what > is the tail of a distribution and what isn't is very much > problem-dependent. "getting flat" depends entirely on the scale of your > data, and isn't meaningful. You could do what people constructing boxplots > do, and use some multiple of the inter-quartile range from the median, but > that still depends on the source, distribution, and meaning of your data. > In any case, you'd be better off asking this somewhere like CrossValidated ( > http://stats.stackexchange.com/) -- this isn't a Julia question. > > > On Tue, May 27, 2014 at 8:22 AM, paul analyst > > wrote: > >> Does not work always, distributions are different. >> How to find the number of elements of the vector from which the chart is >> getting flat (where is the beginning of the tail?) >> Paul >> >> >> W dniu wtorek, 27 maja 2014 12:19:09 UTC+2 użytkownik Yuuki Soho napisał: >> >>> The simplest way to do it is probably to use a quantile: >>> >>> >>> a=[5 3 2 1.5 1.1 1 0.8 0.25 0.2 0.16] >>> >>> q = quantile(vec(a),0.1) >>> >>> a = a[1:cut] >>> >>> >>> >
Re: [julia-users] Re: How quickly and automatically find the cut-off point of vectors with long tails ?
Big thx, it is good way, Intresting is also this dagr = diff(a) ./ diff(gradient(x)) and another offset avg ... Paul W dniu wtorek, 27 maja 2014 17:37:41 UTC+2 użytkownik Tomas Lycken napisał: > > If you have the y-values in a sorted vector, and the x-values in another > sorted vector (or if they're just the index you don't need them), you can > get the discrete derivative by using diff: > > da = diff(a) ./ diff(x) > > Now, the tangential tilt is less than 45 degrees whenever that derivative > is larger than -1, so > > a[da .< -1] > > will give you the portion of a for which the slope is steeper than 45 > degrees. (I might be off by one here, so you might want to experiment a > little and see if you need to include one more, or one less, data point to > get exactly what you want...) > > // T > > On Tuesday, May 27, 2014 4:53:52 PM UTC+2, paul analyst wrote: >> >> Thanks for the cool link. >> Generally this is the point where the tangential tilt is 45 degrees. >> Paul >> >> W dniu wtorek, 27 maja 2014 15:06:25 UTC+2 użytkownik Harlan Harris >> napisał: >>> >>> Paul, I don't believe that this is a well-posed question. Determining >>> what is the tail of a distribution and what isn't is very much >>> problem-dependent. "getting flat" depends entirely on the scale of your >>> data, and isn't meaningful. You could do what people constructing boxplots >>> do, and use some multiple of the inter-quartile range from the median, but >>> that still depends on the source, distribution, and meaning of your data. >>> In any case, you'd be better off asking this somewhere like CrossValidated ( >>> http://stats.stackexchange.com/) -- this isn't a Julia question. >>> >>> >>> On Tue, May 27, 2014 at 8:22 AM, paul analyst wrote: >>> >>>> Does not work always, distributions are different. >>>> How to find the number of elements of the vector from which the chart is >>>> getting flat (where is the beginning of the tail?) >>>> Paul >>>> >>>> >>>> W dniu wtorek, 27 maja 2014 12:19:09 UTC+2 użytkownik Yuuki Soho >>>> napisał: >>>> >>>>> The simplest way to do it is probably to use a quantile: >>>>> >>>>> >>>>> a=[5 3 2 1.5 1.1 1 0.8 0.25 0.2 0.16] >>>>> >>>>> q = quantile(vec(a),0.1) >>>>> >>>>> a = a[1:cut] >>>>> >>>>> >>>>> >>>
[julia-users] Code running back? what happens?
Code running back? what happens? I have a array FS julia> println(sum(FS)); 9.8267205e7 julia> l,m=size(FS); julia> FSbis=FS; julia> julia> julia> for i=1:l; #println(i) if w[i]==1 us=hcat(F[i,:]',[1:1:m]); us=sortrows(us, by=x->x[1],rev=true); for j=1:m if in(us[j,2],Su) FSbis[i,us[j,2]]=us[j,2]; break end; end; end; end; julia> julia> println(sum(FSbis)); 1.03295914e8 julia> julia> println(sum(FS)); 1.03295914e8 after the code array FSbis changing and well. But the array FS too is changing! Why? Compare sum(FS) before and after. Paul
[julia-users] Re: Code running back? what happens?
Thx, I'm surprised. I suspect, and I did: a = ones (5,5) b = a b = b +3 a == b false That is not the case for small and large objects? This is not OK :/ W dniu środa, 28 maja 2014 21:11:12 UTC+2 użytkownik Patrick O'Leary napisał: > > > FSbis=FS > > This binds the identifier FSbis to the same memory that FS is bound to, so > the identifiers are aliases for one another. > > If you want FSbis to start out initialized to the same values as those in > FS, but be a separate container, use `FSbis = copy(FS)`. > > On Wednesday, May 28, 2014 2:07:38 PM UTC-5, paul analyst wrote: >> >> Code running back? what happens? >> I have a array FS >> >> >> julia> println(sum(FS)); >> 9.8267205e7 >> >> julia> l,m=size(FS); >> >> julia> FSbis=FS; >> >> julia> >> >> julia> >> >> julia> for i=1:l; #println(i) >>if w[i]==1 us=hcat(F[i,:]',[1:1:m]); >>us=sortrows(us, by=x->x[1],rev=true); >>for j=1:m >>if in(us[j,2],Su) FSbis[i,us[j,2]]=us[j,2]; break end; >>end; >>end; >>end; >> >> julia> >> >> julia> println(sum(FSbis)); >> 1.03295914e8 >> >> julia> >> >> julia> println(sum(FS)); >> 1.03295914e8 >> >> >> after the code array FSbis changing and well. But the array FS too is >> changing! Why? Compare sum(FS) before and after. >> Paul >> >
Re: [julia-users] Code running back? what happens?
I see, but what is the difference between: b [2,3] = 3 and b = b.+2 Paul W dniu 2014-05-30 10:11, Tomas Lycken pisze: @Paul, Try julia> a = ones(5,5); julia> b = a; julia> b[2,3] = 2; julia> a == b true On Wednesday, May 28, 2014 9:22:26 PM UTC+2, Jameson wrote: b+3 is not the same as a (or b, from the prior stage, for that matter). It doesn't matter whether a and b are numbers or matrices, large or small On Wednesday, May 28, 2014, paul analyst > wrote: Thx, I'm surprised. I suspect, and I did: a = ones (5,5) b = a b = b +3 a == b false That is not the case for small and large objects? This is not OK :/ W dniu środa, 28 maja 2014 21:11:12 UTC+2 użytkownik Patrick O'Leary napisał: > FSbis=FS This binds the identifier FSbis to the same memory that FS is bound to, so the identifiers are aliases for one another. If you want FSbis to start out initialized to the same values as those in FS, but be a separate container, use `FSbis = copy(FS)`. On Wednesday, May 28, 2014 2:07:38 PM UTC-5, paul analyst wrote: Code running back? what happens? I have a arrayFS julia> println(sum(FS)); 9.8267205e7 julia> l,m=size(FS); julia> FSbis=FS; julia> julia> julia> for i=1:l; #println(i) if w[i]==1 us=hcat(F[i,:]',[1:1:m]); us=sortrows(us, by=x->x[1],rev=true); for j=1:m if in(us[j,2],Su) FSbis[i,us[j,2]]=us[j,2]; break end; end; end; end; julia> julia> println(sum(FSbis)); 1.03295914e8 julia> julia> println(sum(FS)); 1.03295914e8 after the code arrayFSbis changing and well. But the array FS too is changing! Why? Compare sum(FS) before and after. Paul
[julia-users] Parallel, strange behavior of the loop after changing the value to a variable, 6 time slower
D:\install\Julia\Julia 0.3.0-prerelease-win64-ver3\Julia 0.3.0-prerelease ver 3>bin\julia.exe -p 8 _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "help()" to list help topics | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.3.0-prerelease+2599 (2014-04-11 23:52 UTC) _/ |\__'_|_|_|\__'_| | Commit bf7096c (50 days old master) |__/ | x86_64-w64-mingw32 julia> procs() 9-element Array{Int64,1}: 1 2 3 4 5 6 7 8 9 julia> tic(); julia> nheads = @parallel (+) for i=1:2 int(randbool()) end 16468 julia> toc() elapsed time: 2.77418807 seconds 2.77418807 julia>exit() D:\install\Julia\Julia 0.3.0-prerelease-win64-ver3\Julia 0.3.0-prerelease ver 3>bin\julia.exe -p 8 _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "help()" to list help topics | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.3.0-prerelease+2599 (2014-04-11 23:52 UTC) _/ |\__'_|_|_|\__'_| | Commit bf7096c (50 days old master) |__/ | x86_64-w64-mingw32 julia> k=2 2 julia> tic(); julia> nheads = @parallel (+) for i=1:k int(randbool()) end 99989022 julia> toc() elapsed time: 18.631674663 seconds 18.631674663 julia> What hapend ? Paul
Re: [julia-users] Parallel, strange behavior of the loop after changing the value to a variable, 6 time slower
*julia> const k=2;ERROR: cannot declare k constant; it already has a value:/Paul* W dniu niedziela, 1 czerwca 2014 16:13:27 UTC+2 użytkownik Andreas Noack Jensen napisał: > > This is the usual problem with global variables in Julia. If you define k > by > > const k=2 > > the timing results should be similar. > > > 2014-06-01 16:09 GMT+02:00 paul analyst > > : > >> >> D:\install\Julia\Julia 0.3.0-prerelease-win64-ver3\Julia 0.3.0-prerelease >> ver 3>bin\julia.exe -p 8 >>_ >>_ _ _(_)_ | A fresh approach to technical computing >> (_) | (_) (_)| Documentation: http://docs.julialang.org >>_ _ _| |_ __ _ | Type "help()" to list help topics >> | | | | | | |/ _` | | >> | | |_| | | | (_| | | Version 0.3.0-prerelease+2599 (2014-04-11 23:52 >> UTC) >> _/ |\__'_|_|_|\__'_| | Commit bf7096c (50 days old master) >> |__/ | x86_64-w64-mingw32 >> >> julia> procs() >> 9-element Array{Int64,1}: >> 1 >> 2 >> 3 >> 4 >> 5 >> 6 >> 7 >> 8 >> 9 >> >> julia> tic(); >> >> julia> nheads = @parallel (+) for i=1:2 >>int(randbool()) >>end >> 16468 >> >> julia> toc() >> elapsed time: 2.77418807 seconds >> 2.77418807 >> >> julia>exit() >> >> >> D:\install\Julia\Julia 0.3.0-prerelease-win64-ver3\Julia 0.3.0-prerelease >> ver 3>bin\julia.exe -p 8 >>_ >>_ _ _(_)_ | A fresh approach to technical computing >> (_) | (_) (_)| Documentation: http://docs.julialang.org >>_ _ _| |_ __ _ | Type "help()" to list help topics >> | | | | | | |/ _` | | >> | | |_| | | | (_| | | Version 0.3.0-prerelease+2599 (2014-04-11 23:52 >> UTC) >> _/ |\__'_|_|_|\__'_| | Commit bf7096c (50 days old master) >> |__/ | x86_64-w64-mingw32 >> >> julia> k=2 >> 2 >> >> julia> tic(); >> >> julia> nheads = @parallel (+) for i=1:k >>int(randbool()) >>end >> 99989022 >> >> julia> toc() >> elapsed time: 18.631674663 seconds >> 18.631674663 >> >> julia> >> >> What hapend ? >> >> Paul >> >> >> > > > -- > Med venlig hilsen > > Andreas Noack Jensen >
Re: [julia-users] Parallel, strange behavior of the loop after changing the value to a variable, 6 time slower
After restart julia : D:\install\Julia\Julia 0.3.0-prerelease-win64-ver3\Julia 0.3.0-prerelease ver 3>bin\julia.exe -p 8 _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "help()" to list help topics | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.3.0-prerelease+2599 (2014-04-11 23:52 UTC) _/ |\__'_|_|_|\__'_| | Commit bf7096c (50 days old master) |__/ | x86_64-w64-mingw32 julia> const k=2 2 julia> tic(); julia> nheads = @parallel (+) for i=1:k int(randbool()) end exception on exception on 3: 4: ERROR: ERROR: exception on exception on 2: exception on 7: ERROR: 5: ERROR: ERROR: exception on k not defined6: exception on ERROR: in anonymous at no file:1379 8k: not definedERROR: in anonymous at no file:1379 k not definedk not defined in anonymous at no file:1379 in anonymous at no file:1379 k not definedk not definedk not defined in anonymous at no file:1379 in anonymous at no file:1379 in anonymous at no file:1379exception on 9: ERROR: k not defined in anonymous at no file:1379 ERROR: no method +(UndefVarError, UndefVarError) in mr_pairwise at reduce.jl:534 julia> toc() elapsed time: 2.493525081 seconds 2.493525081 julia> W dniu niedziela, 1 czerwca 2014 16:27:14 UTC+2 użytkownik paul analyst napisał: > > > > > > *julia> const k=2;ERROR: cannot declare k constant; it already has > a value:/Paul* > W dniu niedziela, 1 czerwca 2014 16:13:27 UTC+2 użytkownik Andreas Noack > Jensen napisał: >> >> This is the usual problem with global variables in Julia. If you define k >> by >> >> const k=20000 >> >> the timing results should be similar. >> >> >> 2014-06-01 16:09 GMT+02:00 paul analyst : >> >>> >>> D:\install\Julia\Julia 0.3.0-prerelease-win64-ver3\Julia >>> 0.3.0-prerelease ver 3>bin\julia.exe -p 8 >>>_ >>>_ _ _(_)_ | A fresh approach to technical computing >>> (_) | (_) (_)| Documentation: http://docs.julialang.org >>>_ _ _| |_ __ _ | Type "help()" to list help topics >>> | | | | | | |/ _` | | >>> | | |_| | | | (_| | | Version 0.3.0-prerelease+2599 (2014-04-11 >>> 23:52 UTC) >>> _/ |\__'_|_|_|\__'_| | Commit bf7096c (50 days old master) >>> |__/ | x86_64-w64-mingw32 >>> >>> julia> procs() >>> 9-element Array{Int64,1}: >>> 1 >>> 2 >>> 3 >>> 4 >>> 5 >>> 6 >>> 7 >>> 8 >>> 9 >>> >>> julia> tic(); >>> >>> julia> nheads = @parallel (+) for i=1:2 >>>int(randbool()) >>>end >>> 16468 >>> >>> julia> toc() >>> elapsed time: 2.77418807 seconds >>> 2.77418807 >>> >>> julia>exit() >>> >>> >>> D:\install\Julia\Julia 0.3.0-prerelease-win64-ver3\Julia >>> 0.3.0-prerelease ver 3>bin\julia.exe -p 8 >>>_ >>>_ _ _(_)_ | A fresh approach to technical computing >>> (_) | (_) (_)| Documentation: http://docs.julialang.org >>>_ _ _| |_ __ _ | Type "help()" to list help topics >>> | | | | | | |/ _` | | >>> | | |_| | | | (_| | | Version 0.3.0-prerelease+2599 (2014-04-11 >>> 23:52 UTC) >>> _/ |\__'_|_|_|\__'_| | Commit bf7096c (50 days old master) >>> |__/ | x86_64-w64-mingw32 >>> >>> julia> k=2 >>> 2 >>> >>> julia> tic(); >>> >>> julia> nheads = @parallel (+) for i=1:k >>>int(randbool()) >>>end >>> 99989022 >>> >>> julia> toc() >>> elapsed time: 18.631674663 seconds >>> 18.631674663 >>> >>> julia> >>> >>> What hapend ? >>> >>> Paul >>> >>> >>> >> >> >> -- >> Med venlig hilsen >> >> Andreas Noack Jensen >> >
[julia-users] pmap(eig,M) . How to separate result of pmap ?
julia> M = {cor(rand(4,4)) for i=1:2} 2-element Array{Any,1}: 4x4 Array{Float64,2}: 1.0 -0.227554 0.507924 -0.800516 -0.227554 1.00.220113 0.75924 0.507924 0.220113 1.0 -0.272765 -0.800516 0.75924 -0.272765 1.0 4x4 Array{Float64,2}: 1.0 -0.65399 -0.619397 -0.132602 -0.653991.0 -0.188752 0.818691 -0.619397 -0.188752 1.0 -0.680177 -0.132602 0.818691 -0.680177 1.0 julia> P=pmap(eig,M) 2-element Array{Any,1}: ([-2.0e-16,0.340329,1.3362,2.32347], 4x4 Array{Float64,2}: 0.445323 0.628389 -0.283962 -0.571121 -0.485061 0.445037 -0.623672 0.421533 0.08456 -0.637878 -0.711606 -0.282095 0.747832 -0.0134082 -0.154970.645409) ([1.77636e-15,0.0237017,1.77733,2.19897], 4x4 Array{Float64,2}: 0.670874 -0.0224424 0.702664 -0.235982 0.5131470.521253 -0.261832 0.629618 0.534381 -0.427716 -0.640692 -0.347864 0.0323244 -0.73814 0.164988 0.653364) julia> P[1] ([-2.0e-16,0.340329,1.3362,2.32347], 4x4 Array{Float64,2}: 0.445323 0.628389 -0.283962 -0.571121 -0.485061 0.445037 -0.623672 0.421533 0.08456 -0.637878 -0.711606 -0.282095 0.747832 -0.0134082 -0.154970.645409) julia> P[2] ([1.77636e-15,0.0237017,1.77733,2.19897], 4x4 Array{Float64,2}: 0.670874 -0.0224424 0.702664 -0.235982 0.5131470.521253 -0.261832 0.629618 0.534381 -0.427716 -0.640692 -0.347864 0.0323244 -0.73814 0.164988 0.653364) How can you separate results, eigenvalues and eigenvectors? The first and subsequent lines array P [1] and P [2]
Re: [julia-users] pmap(eig,M) . How to separate result of pmap ?
Thx, OK, its work. It is eigenvaluse of first array : [x[1] for x in P][1] But ?: julia> [x[i] for x in P][i]=pmap(eig,M) ERROR: i not defined in anonymous at no file this no wor. How automaticly preapre m1,v1; m2,v2; m3,v3 lik in typical [m,v] = eig(R) Paul W dniu niedziela, 1 czerwca 2014 17:03:58 UTC+2 użytkownik Andreas Noack Jensen napisał: > > You can use a complehensen. To get a vector of the vectors of the > eigenvalues you could write [x[1] for x in P]. If you want to collect them > into a matrix, you could write hcat([x[1] for x in P]...) > > > 2014-06-01 16:56 GMT+02:00 paul analyst > > : > >> julia> M = {cor(rand(4,4)) for i=1:2} >> 2-element Array{Any,1}: >> 4x4 Array{Float64,2}: >> 1.0 -0.227554 0.507924 -0.800516 >> -0.227554 1.00.220113 0.75924 >> 0.507924 0.220113 1.0 -0.272765 >> -0.800516 0.75924 -0.272765 1.0 >> 4x4 Array{Float64,2}: >> 1.0 -0.65399 -0.619397 -0.132602 >> -0.653991.0 -0.188752 0.818691 >> -0.619397 -0.188752 1.0 -0.680177 >> -0.132602 0.818691 -0.680177 1.0 >> >> julia> P=pmap(eig,M) >> >> 2-element Array{Any,1}: >> ([-2.0e-16,0.340329,1.3362,2.32347], >> 4x4 Array{Float64,2}: >> 0.445323 0.628389 -0.283962 -0.571121 >> -0.485061 0.445037 -0.623672 0.421533 >> 0.08456 -0.637878 -0.711606 -0.282095 >> 0.747832 -0.0134082 -0.154970.645409) >> ([1.77636e-15,0.0237017,1.77733,2.19897], >> 4x4 Array{Float64,2}: >> 0.670874 -0.0224424 0.702664 -0.235982 >> 0.5131470.521253 -0.261832 0.629618 >> 0.534381 -0.427716 -0.640692 -0.347864 >> 0.0323244 -0.73814 0.164988 0.653364) >> >> julia> P[1] >> ([-2.0e-16,0.340329,1.3362,2.32347], >> 4x4 Array{Float64,2}: >> 0.445323 0.628389 -0.283962 -0.571121 >> -0.485061 0.445037 -0.623672 0.421533 >> 0.08456 -0.637878 -0.711606 -0.282095 >> 0.747832 -0.0134082 -0.154970.645409) >> >> julia> P[2] >> ([1.77636e-15,0.0237017,1.77733,2.19897], >> 4x4 Array{Float64,2}: >> 0.670874 -0.0224424 0.702664 -0.235982 >> 0.5131470.521253 -0.261832 0.629618 >> 0.534381 -0.427716 -0.640692 -0.347864 >> 0.0323244 -0.73814 0.164988 0.653364) >> >> How can you separate results, eigenvalues and eigenvectors? >> The first and subsequent lines array P [1] and P [2] >> >> > > > -- > Med venlig hilsen > > Andreas Noack Jensen >
[julia-users] How to read and change the content of web pages to the vector ?
How to read and change the content of web pages to the vector ["word1", " word2", "word3", ",,,", "wordlast"]? Paul
Re: [julia-users] How to calculate all Euclidean distances between two sets of points in a 3-dimensional space
It is there. If D aand D1 ar two arrays with vectors in columns You have this in Distance package. julia> r = pairwise(Euclidean(), D,D1) 4x4 Array{Float64,2}: 4579.3 4528.87 2650.71 7326.62 5658.24 3646.92 2587.83 7348.04 5729.42 4581.69 1941.65 7266.23 5733.62 4656.58 2488.6 5902.54 in paresecs too ;) Paul W dniu środa, 4 czerwca 2014 14:50:35 UTC+2 użytkownik Carlos Baptista napisał: > > Yes I have seen it. I tried something with the function pairwise, but I > did not really get what I want. If I have two sets of sizes N and M > respectively, I expect as return value a matrix of size NxM. What I got out > of pairwise is smaller than that. >
Re: [julia-users] How to read and change the content of web pages to the vector ?
Any help ? How to read and change the content of web pages to the vector ["word1", "word2", "word3", ",,,", "wordlast"]? W dniu 2014-06-04 12:47, paul analyst pisze: How to read and change the content of web pages to the vector ["word1", "word2", "word3", ",,,", "wordlast"]? Paul
Re: [julia-users] How to read and change the content of web pages to the vector ?
nice will be in 2 varaints: 1 All inside html 2. Only text displayed by browser Paul W dniu 2014-06-04 18:23, John Myles White pisze: I don't really understand what you mean by web page. -- John On Jun 4, 2014, at 9:20 AM, Paul Analyst wrote: Any help ? How to read and change the content of web pages to the vector ["word1", "word2", "word3", ",,,", "wordlast"]? W dniu 2014-06-04 12:47, paul analyst pisze: How to read and change the content of web pages to the vector ["word1", "word2", "word3", ",,,", "wordlast"]? Paul
[julia-users] Dynamic creation and naming of variables, what wrong?
dynamic creation and naming of variables, what wrong? I need 100 new variables : m1 to m 100 julia> for i=1:100 "m" * string(i)=readcsv(string("m",i,".txt")) end ERROR: syntax: "#" is not a valid function argument name
Re: [julia-users] Re: Dynamic creation and naming of variables, what wrong?
Big txh, it works, but now i heve 100 arrays (in real more... ) with 99 empty columns. Is posible read m1 , m2 to vector , not to array ? Paul W dniu środa, 4 czerwca 2014 19:22:11 UTC+2 użytkownik Bob Nnamtrop napisał: > > Sorry I left out the function call: > > for i=1:100 > eval(parse("m$i = readcsv(\"m$i.txt\")")) > end > > > > On Wed, Jun 4, 2014 at 11:16 AM, Bob Nnamtrop > wrote: > >> Or closer to the syntax of the original loop: >> >> for i=1:100 >> eval(parse("m$i = \"m$i.txt\"")) >> end >> >> Bob >> >> >> >> On Wed, Jun 4, 2014 at 11:13 AM, Patrick O'Leary > > wrote: >> >>> First, you probably would be better off with an array, rather than 100 >>> variables with numeric postfixes. You can use push!() for this. >>> >>> Second, the error is because Julia is trying to parse the left hand side >>> as an attempt to define a function, using the shortened f(x) = y function >>> definition syntax. Here, f is *, and the literal `"m" * string(i)` is being >>> interpreted as the name of its argument, but this is not a valid identifier. >>> >>> Finally, although you almost certainly don't want to do what you're >>> trying to do, you can if you separate creation of the symbol from >>> evaluation: >>> >>> var_name = symbol("m" * string(i)) >>> @eval $var_name = readcsv(string("m", i, ".txt")) >>> >>> >>> On Wednesday, June 4, 2014 11:36:37 AM UTC-5, paul analyst wrote: >>>> >>>> dynamic creation and naming of variables, what wrong? >>>> >>>> I need 100 new variables : m1 to m 100 >>>> >>>> julia> for i=1:100 >>>>"m" * string(i)=readcsv(string("m",i,".txt")) >>>>end >>>> ERROR: syntax: "#" is not a valid function argument name >>>> >>> >> >
Re: [julia-users] Re: Dynamic creation and naming of variables, what wrong?
Sorry, is ok , i have vectors .. Paul W dniu środa, 4 czerwca 2014 20:09:46 UTC+2 użytkownik paul analyst napisał: > > Big txh, it works, > but now i heve 100 arrays (in real more... ) with 99 empty columns. Is > posible read m1 , m2 to vector , not to array ? > Paul > > W dniu środa, 4 czerwca 2014 19:22:11 UTC+2 użytkownik Bob Nnamtrop > napisał: >> >> Sorry I left out the function call: >> >> for i=1:100 >> eval(parse("m$i = readcsv(\"m$i.txt\")")) >> end >> >> >> >> On Wed, Jun 4, 2014 at 11:16 AM, Bob Nnamtrop >> wrote: >> >>> Or closer to the syntax of the original loop: >>> >>> for i=1:100 >>> eval(parse("m$i = \"m$i.txt\"")) >>> end >>> >>> Bob >>> >>> >>> >>> On Wed, Jun 4, 2014 at 11:13 AM, Patrick O'Leary >>> wrote: >>> >>>> First, you probably would be better off with an array, rather than 100 >>>> variables with numeric postfixes. You can use push!() for this. >>>> >>>> Second, the error is because Julia is trying to parse the left hand >>>> side as an attempt to define a function, using the shortened f(x) = y >>>> function definition syntax. Here, f is *, and the literal `"m" * >>>> string(i)` >>>> is being interpreted as the name of its argument, but this is not a valid >>>> identifier. >>>> >>>> Finally, although you almost certainly don't want to do what you're >>>> trying to do, you can if you separate creation of the symbol from >>>> evaluation: >>>> >>>> var_name = symbol("m" * string(i)) >>>> @eval $var_name = readcsv(string("m", i, ".txt")) >>>> >>>> >>>> On Wednesday, June 4, 2014 11:36:37 AM UTC-5, paul analyst wrote: >>>>> >>>>> dynamic creation and naming of variables, what wrong? >>>>> >>>>> I need 100 new variables : m1 to m 100 >>>>> >>>>> julia> for i=1:100 >>>>>"m" * string(i)=readcsv(string("m",i,".txt")) >>>>>end >>>>> ERROR: syntax: "#" is not a valid function argument name >>>>> >>>> >>> >>
Re: [julia-users] How to read and change the content of web pages to the vector ?
sample: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.kurshtml.edu.pl/html/html,html.html> xmlns="http://www.w3.org/1999/xhtml"; xml:lang="pl" lang="pl"> http://www.kurshtml.edu.pl/html/head,html.html>> http://www.kurshtml.edu.pl/html/meta,html.html> http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /> http://www.kurshtml.edu.pl/html/meta,html.html> name="Description" content="description about page" /> http://www.kurshtml.edu.pl/html/meta,html.html> name="Keywords" content="bee, fly,monky" /> http://www.kurshtml.edu.pl/html/title,html.html>>page about insectshttp://www.kurshtml.edu.pl/html/title,html.html>> http://www.kurshtml.edu.pl/html/head,html.html>> http://www.kurshtml.edu.pl/html/body,html.html>> *Insects* (fromLatin <http://en.wikipedia.org/wiki/Latin> /insectum/, acalque <http://en.wikipedia.org/wiki/Calque> ofGreek <http://en.wikipedia.org/wiki/Ancient_Greek> ἔντομον [/éntomon/], "cut into sections") are aclass <http://en.wikipedia.org/wiki/Class_%28biology%29> ofinvertebrates <http://en.wikipedia.org/wiki/Invertebrate> within thearthropod <http://en.wikipedia.org/wiki/Arthropod> phylum that have achitinous <http://en.wikipedia.org/wiki/Chitin> exoskeleton <http://en.wikipedia.org/wiki/Exoskeleton>, a three-part body (head <http://en.wikipedia.org/wiki/Head>,thorax <http://en.wikipedia.org/wiki/Thorax_%28insect_anatomy%29> andabdomen <http://en.wikipedia.org/wiki/Abdomen>), three pairs of jointedlegs <http://en.wikipedia.org/wiki/Arthropod_leg>,compound eyes <http://en.wikipedia.org/wiki/Compound_eye> and one pair ofantennae <http://en.wikipedia.org/wiki/Antenna_%28biology%29>. They are among the most diverse groups ofanimals <http://en.wikipedia.org/wiki/Animal> on the planet, including more than a million describedspecies <http://en.wikipedia.org/wiki/Species> and representing more than half of all known living organisms.^[2] <http://en.wikipedia.org/wiki/Insect#cite_note-Chapman-2> ^[3] <http://en.wikipedia.org/wiki/Insect#cite_note-3>The number ofextant <http://en.wikipedia.org/wiki/Extant_taxon> species is estimated at between six and ten million,^[2] <http://en.wikipedia.org/wiki/Insect#cite_note-Chapman-2> ^[4] <http://en.wikipedia.org/wiki/Insect#cite_note-4> ^[5] <http://en.wikipedia.org/wiki/Insect#cite_note-number-5>and potentially represent over 90% of the differing animal life forms on Earth.^[6] <http://en.wikipedia.org/wiki/Insect#cite_note-6>Insects may be found in nearly allenvironments <http://en.wikipedia.org/wiki/Natural_environment>, although only a small number of species reside in the oceans, a habitat dominated by another arthropod group,crustaceans <http://en.wikipedia.org/wiki/Crustacean>. http://www.kurshtml.edu.pl/html/body,html.html>> http://www.kurshtml.edu.pl/html/html,html.html>> i need somthing like : Insects (from Latin insectum, a calque of Greek µ?? [éntomon], "cut into ... although only a small number of species reside in the oceans, a habitat dominated by another arthropod group, crustaceans W dniu 2014-06-05 07:15, John Myles White pisze: I'm still lost. Do you want to print out the text for an HTML table to STDOUT? -- John On Jun 4, 2014, at 9:33 AM, Kevin Squire <mailto:kevin.squ...@gmail.com>> wrote: I would think "web page" = "HTML document". On Wednesday, June 4, 2014, John Myles White mailto:johnmyleswh...@gmail.com>> wrote: I don't really understand what you mean by web page. -- John > On Jun 4, 2014, at 9:20 AM, Paul Analyst > wrote: > > > Any help ? > How to read and change the content of web pages to the vector ["word1", "word2", "word3", ",,,", "wordlast"]? > > W dniu 2014-06-04 12:47, paul analyst pisze: >> How to read and change the content of web pages to the vector ["word1", "word2", "word3", ",,,", "wordlast"]? >> >> Paul >
[julia-users] Error Pkg.add("LightXML"), where is problem ?on my comp or on server?
A fresh approach to technical computing Documentation: http://docs.julialang.org Type "help()" to list help topics Version 0.3.0-prerelease+2599 (2014-04-11 23:52 UTC) Commit bf7096c (54 days old master) x86_64-w64-mingw32 julia> Pkg.add("LightXML") INFO: Cloning cache of LightXML from git://github.com/lindahua/LightXML.jl.git INFO: Installing LightXML v0.1.6 INFO: Building LibCURL WARNING: skipping repodata/0363c7383794a00bf1c007bcd1bb47709f416fb86f80852c5915931f67fc3739-primary. xml.gz, not in cache INFO: Updating WinRPM package list INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/ /repodata/repomd.xml INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/ /repodata/dd159986229fa87a6b80b82e1658883175ac9678031564d766bc4a824c3e4c03-primary.xml.gz WARNING: encounted invalid data while parsing repomd ===[ ERROR: LibCURL ]=== no method alloc_request(IOBuffer, Uint64) while loading C:\Users\SAMSUNG2\.julia\LibCURL\deps\build.jl, in expression starting on line 13 INFO: Building LightXML INFO: Updating WinRPM package list INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/ /repodata/repomd.xml INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/ /repodata/dd159986229fa87a6b80b82e1658883175ac9678031564d766bc4a824c3e4c03-primary.xml.gz WARNING: encounted invalid data while parsing repomd ==[ ERROR: LightXML ]=== no method alloc_request(IOBuffer, Uint64) while loading C:\Users\SAMSUNG2\.julia\LightXML\deps\build.jl, in expression starting on line 11 [ BUILD ERRORS ] WARNING: LightXML and LibCURL had build errors. - packages with build errors remain installed in C:\Users\SAMSUNG2\.julia - build a package and all its dependencies with `Pkg.build(pkg)` - build a single package by running its `deps/build.jl` script INFO: Package database updated julia> Pkg.add("LightXML") INFO: Nothing to be done julia> Pkg.update() INFO: Updating METADATA... INFO: Updating Distributions... INFO: Computing changes... INFO: No packages to install, update or remove julia> using LightXML ERROR: could not load module C:\Users\SAMSUNG2\.julia\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mi ngw\bin\libxml2-2: no error in dlopen at c.jl:19 in include at boot.jl:244 in include_from_node1 at loading.jl:128 in include_from_node1 at loading.jl:124 while loading C:\Users\SAMSUNG2\.julia\LightXML\src\clib.jl, in expression starting on line 4 while loading C:\Users\SAMSUNG2\.julia\LightXML\src\LightXML.jl, in expression starting on line 24 julia> Pkg.update() INFO: Updating METADATA... INFO: Updating Distributions... INFO: Computing changes... INFO: No packages to install, update or remove julia> Pkg.add("LightXML") INFO: Nothing to be done julia> using LightXML julia> xdoc = parse_file("ex1.xml") ERROR: parse_file not defined julia> xdoc = parse_file("ex1.xml") ERROR: parse_file not defined julia> par parentparse_bin parse_hex parse_string parseip parentindexes parse_file parse_int parsefloat partitions parse parse_floatparse_oct parseint julia> xdoc = parse("ex1.xml") :(ex1.xml) julia> using LightXML julia> xdoc = parse_file("ex1.xml") ERROR: parse_file not defined julia>
Re: [julia-users] Error Pkg.add("LightXML"), where is problem ?on my comp or on server?
..) instead. in depwarn at deprecated.jl:36 INFO: Downloading: libidn INFO: Extracting: libidn WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 INFO: Downloading: mozilla-nspr INFO: Extracting: mozilla-nspr WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 INFO: Downloading: libcurl INFO: Extracting: libcurl WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 INFO: Success julia> Pkg.update() INFO: Updating METADATA... INFO: Updating Distributions... INFO: Computing changes... INFO: No packages to install, update or remove julia> Pkg.add("LightXML") INFO: Nothing to be done julia> using Li LibCURL LibExpat LightXML julia> using LightXML ERROR: could not load module C:\Users\SAMSUNG2\.julia\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mi ngw\bin\libxml2-2: no error in dlopen at c.jl:19 in include at boot.jl:244 in include_from_node1 at loading.jl:128 in include_from_node1 at loading.jl:124 while loading C:\Users\SAMSUNG2\.julia\LightXML\src\clib.jl, in expression starting on line 4 while loading C:\Users\SAMSUNG2\.julia\LightXML\src\LightXML.jl, in expression starting on line 24 julia> Paul W dniu 2014-06-05 15:45, Jameson Nash pisze: Version 0.3.0-prerelease+2599 (2014-04-11 23:52 UTC) Commit bf7096c (54 days old master) your version of 0.3 is too old. either switch to 0.2, or update your copy of 0.3 more frequently (note: after calling using XXX, future calls to using XXX are a no-op, even if the initial attempt halted with an error) On Thu, Jun 5, 2014 at 6:55 AM, paul analyst <mailto:paul.anal...@mail.com>> wrote: A fresh approach to technical computing Documentation: http://docs.julialang.org Type "help()" to list help topics Version 0.3.0-prerelease+2599 (2014-04-11 23:52 UTC) Commit bf7096c (54 days old master) x86_64-w64-mingw32 julia> Pkg.add("LightXML") INFO: Cloning cache of LightXML from git://github.com/lindahua/LightXML.jl.git <http://github.com/lindahua/LightXML.jl.git> INFO: Installing LightXML v0.1.6 INFO: Building LibCURL WARNING: skipping repodata/0363c7383794a00bf1c007bcd1bb47709f416fb86f80852c5915931f67fc3739-primary. xml.gz, not in cache INFO: Updating WinRPM package list INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/ /repodata/repomd.xml INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/ /repodata/dd159986229fa87a6b80b82e1658883175ac9678031564d766bc4a824c3e4c03-primary.xml.gz WARNING: encounted invalid data while parsing repomd ===[ ERROR: LibCURL ]=== no method alloc_request(IOBuffer, Uint64) while loading C:\Users\SAMSUNG2\.julia\LibCURL\deps\build.jl, in expression starting on line 13 INFO: Building LightXML INFO: Updating WinRPM package list INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/ /repodata/repomd.xml INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/ /repodata/dd159986229fa87a6b80b82e1658883175ac9678031564d766bc4a824c3e4c03-primary.xml.gz WARNING: encounted invalid data while parsing repomd ==[ ERROR: LightXML ]=== no method alloc_request(IOBuffer, Uint64) while loading C:\Users\SAMSUNG2\.julia\LightXML\deps\build.jl, in expression starting on line 11 [ BUILD ERRORS ] WARNING: LightXML and LibCURL had build errors. - packages with build errors remain installed in C:\Users\SAMSUNG2\.julia - build a package and all its dependencies with `Pkg.build(pkg)` - build a single package by running its `deps/build.jl` script INFO: Package database updated julia> Pkg.add("LightXML") INFO: Nothing to be done julia> Pkg.upd
Re: [julia-users] Error Pkg.add("LightXML"), where is problem ?on my comp or on server?
julia> Pkg.build("LightXML") INFO: Building LibCURL INFO: Updating WinRPM package list INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory// repodata/repomd.xml INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Factory// repodata/repomd.xml INFO: Building LightXML INFO: Packages to install: zlib, libxml2 INFO: Downloading: zlib INFO: Extracting: zlib INFO: Downloading: libxml2 INFO: Extracting: libxml2 INFO: Success julia> using LightXML julia> xdoc = parse_file("ex1.xml") ERROR: parse_file not defined file is in this dir... Paul W dniu 2014-06-05 17:21, Isaiah Norton pisze: try Pkg.build("LightXML") On Thu, Jun 5, 2014 at 11:03 AM, Paul Analyst <mailto:paul.anal...@mail.com>> wrote: new verison and new errors (mu Julia is not instaled on drive C, is on D ) _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "help()" to list help topics | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.3.0-prerelease+3431 (2014-06-03 20:06 UTC) _/ |\__'_|_|_|\__'_| | Commit 1769118* (1 day old master) |__/ | x86_64-w64-mingw32 julia> Pkg.a add available julia> Pkg.ad ERROR: ad not defined julia> Pkg.add("LightXML") INFO: Nothing to be done INFO: METADATA is out-of-date - you may not have the latest version of LightXML INFO: Use `Pkg.update()` to get the latest versions of your packages julia> Pkg.update() INFO: Updating METADATA... INFO: Updating cache of Color... INFO: Updating cache of WinRPM... INFO: Updating Distributions... INFO: Computing changes... INFO: Upgrading Color: v0.2.9 => v0.2.10 INFO: Upgrading WinRPM: v0.0.13 => v0.0.14 INFO: Building LibCURL INFO: Updating WinRPM package list INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory// repodata/repomd.xml INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory// repodata/dd159986229fa87a6b80b82e1658883175ac9678031564d766bc4a824c3e4c03-primary.xml.gz INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Factory// repodata/repomd.xml INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Factory// repodata/8e1eaed4d2891f27e5be81856ffe0cacea6b5b296ea9641908a3733bfaacbf37-primary.xml.gz INFO: Packages to install: libgpg-error-lang, libgpg-error, libgcc, libsqlite3-0, libintl, libgcrypt , libidn-lang, zlib, libssh2, mozilla-nss, libidn, mozilla-nspr, libcurl INFO: Downloading: libgpg-error-lang INFO: Extracting: libgpg-error-lang WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 INFO: Downloading: libgpg-error INFO: Extracting: libgpg-error WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 INFO: Downloading: libgcc INFO: Extracting: libgcc WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 INFO: Downloading: libsqlite3-0 INFO: Extracting: libsqlite3-0 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 INFO: Downloading: libintl INFO: Extracting: libintl WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 INFO: Downloading: libgcrypt INFO: Extracting: libgcrypt WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at depreca
Re: [julia-users] Error Pkg.add("LightXML"), where is problem ?on my comp or on server?
the most usefull way:) Big Thx, working Paul W dniu 2014-06-05 17:33, Isaiah Norton pisze: Probably need to restart Julia. Otherwise, no idea. It works for me on Windows. On Thu, Jun 5, 2014 at 11:24 AM, Paul Analyst <mailto:paul.anal...@mail.com>> wrote: julia> Pkg.build("LightXML") INFO: Building LibCURL INFO: Updating WinRPM package list INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory// repodata/repomd.xml INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Factory// repodata/repomd.xml INFO: Building LightXML INFO: Packages to install: zlib, libxml2 INFO: Downloading: zlib INFO: Extracting: zlib INFO: Downloading: libxml2 INFO: Extracting: libxml2 INFO: Success julia> using LightXML julia> xdoc = parse_file("ex1.xml") ERROR: parse_file not defined file is in this dir... Paul W dniu 2014-06-05 17:21, Isaiah Norton pisze: try Pkg.build("LightXML") On Thu, Jun 5, 2014 at 11:03 AM, Paul Analyst mailto:paul.anal...@mail.com>> wrote: new verison and new errors (mu Julia is not instaled on drive C, is on D ) _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "help()" to list help topics | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.3.0-prerelease+3431 (2014-06-03 20:06 UTC) _/ |\__'_|_|_|\__'_| | Commit 1769118* (1 day old master) |__/ | x86_64-w64-mingw32 julia> Pkg.a add available julia> Pkg.ad ERROR: ad not defined julia> Pkg.add("LightXML") INFO: Nothing to be done INFO: METADATA is out-of-date - you may not have the latest version of LightXML INFO: Use `Pkg.update()` to get the latest versions of your packages julia> Pkg.update() INFO: Updating METADATA... INFO: Updating cache of Color... INFO: Updating cache of WinRPM... INFO: Updating Distributions... INFO: Computing changes... INFO: Upgrading Color: v0.2.9 => v0.2.10 INFO: Upgrading WinRPM: v0.0.13 => v0.0.14 INFO: Building LibCURL INFO: Updating WinRPM package list INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory// repodata/repomd.xml INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory// repodata/dd159986229fa87a6b80b82e1658883175ac9678031564d766bc4a824c3e4c03-primary.xml.gz INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Factory// repodata/repomd.xml INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Factory// repodata/8e1eaed4d2891f27e5be81856ffe0cacea6b5b296ea9641908a3733bfaacbf37-primary.xml.gz INFO: Packages to install: libgpg-error-lang, libgpg-error, libgcc, libsqlite3-0, libintl, libgcrypt , libidn-lang, zlib, libssh2, mozilla-nss, libidn, mozilla-nspr, libcurl INFO: Downloading: libgpg-error-lang INFO: Extracting: libgpg-error-lang WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 INFO: Downloading: libgpg-error INFO: Extracting: libgpg-error WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 INFO: Downloading: libgcc INFO: Extracting: libgcc WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 INFO: Downloading: libsqlite3-0 INFO: Extracting: libsqlite3-0 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead. in depwarn at deprecated.jl:36 WARNING: readsfrom(cmd,args...) is deprecated, use open(cmd,"r",args...) instead.
Re: [julia-users] Re: How to read and change the content of web pages to the vector ?
Thx James, i will try Paul. W dniu 2014-06-09 19:04, James Porter pisze: https://github.com/porterjamesj/GumboParser.jl
[julia-users] How use two contition to filtred array?
How use two conditions to filtred array? Left and right side this code separatly are good. But how use booth conditions in filter ? (take rows with <1 and >500 in col 2) klient[klient[:,2].<=10;:] & klient[klient[:,2].>500;:] Paul
[julia-users] Re: How use two contition to filtred array?
Is ok , big thx. How to join another condition but another vector of the same lengths as "client"? Prerequisite: anothervector = 0 julia> klient[ 500 .< klient[:,2] .<= 10 anothervector=0,:] ERROR: syntax: unexpected comma in matrix expression Paul W dniu wtorek, 10 czerwca 2014 20:50:03 UTC+2 użytkownik Andrea Pagnani napisał: > > I think > > klient[ 500 .< klient[:,2] .<= 10,:] > > should work > > Andrea > > On Tuesday, June 10, 2014 8:41:17 PM UTC+2, paul analyst wrote: >> >> How use two conditions to filtred array? >> >> Left and right side this code separatly are good. But how use booth >> conditions in filter ? (take rows with <1 and >500 in col 2) >> >> klient[klient[:,2].<=10;:] & klient[klient[:,2].>500;:] >> >> Paul >> >
[julia-users] How to find the index of maximum but omitting to check any field eg not x [5,7]
I have a random vector x = rand (10) how to find the index of maximum but omitting to check any field eg not x [ 5,7] some like: indmax y = (x [but not read [5,7]]) Paul
[julia-users] How Delete row or col of array? like deleteat! in vectors
a=rand(5,5) how Delete row(s) or col(s) of array ? Paul
[julia-users] Re: How to find the index of maximum but omitting to check any field eg not x [5,7]
No sugestion ? Paul W dniu poniedziałek, 16 czerwca 2014 14:06:23 UTC+2 użytkownik paul analyst napisał: > > I have a random vector x = rand (10) > how to find the index of maximum but omitting to check any field eg not x > [5,7] > some like: > indmax y = (x [but not read [5,7]]) > Paul >
Re: [julia-users] Re: How to find the index of maximum but omitting to check any field eg not x [5,7]
Big thx, it work, Paul W dniu 2014-06-16 21:24, Dahua Lin pisze: |u =trues(length(x)) u[[5,7]]=false ir =0 vr =-Inf fori =1:length(x) ifu[i]&&x[i]>vr ir =i vr =x[i] end end |
Re: [julia-users] Re: How Delete row or col of array? like deleteat! in vectors
Thx, for this info But not about items I need delete some rows ... How fast delete rows in arrray, one [3,:]or more [[2,4],:] ? Paul W dniu 2014-06-16 21:22, Stefan Schwarz pisze: deleting in place a matrix is not supported and does not make sense. why is that? you've for instance a 5x5 matrix and you want to delete an item. deleteat! shifts subsequent items to fill the resulting gap, so you're loosing dimensionality. basically what you can do is this: a = deleteat!(a[1:end], 1) which is deleting item at position 1. if you want to bring that back into a matrix representation the problems rear up. what dimension you'll have afterwards? 6x4? if you delete another one you'll have 23 elements left, which is really hard to bring into a 2D shape. in the end you've to come up with your own scheme with deleting an item at (i, j). deleting an item and presuming deleting means zeroing it out: a[2,2] = convert(eltype(a), 0) deleting the 2nd column: a[:,2] = convert(eltype(a), 0) deleting the 1st row: a[1, 1:end] = convert(eltype(a), 0) don't know if this tackles your question, but hope this helps.
Re: [julia-users] Re: How Delete row or col of array? like deleteat! in vectors
Is possible or not ? Delete rows in array ? Paul W dniu 2014-06-17 07:49, Paul Analyst pisze: Thx, for this info But not about items I need delete some rows ... How fast delete rows in arrray, one [3,:]or more [[2,4],:] ? Paul W dniu 2014-06-16 21:22, Stefan Schwarz pisze: deleting in place a matrix is not supported and does not make sense. why is that? you've for instance a 5x5 matrix and you want to delete an item. deleteat! shifts subsequent items to fill the resulting gap, so you're loosing dimensionality. basically what you can do is this: a = deleteat!(a[1:end], 1) which is deleting item at position 1. if you want to bring that back into a matrix representation the problems rear up. what dimension you'll have afterwards? 6x4? if you delete another one you'll have 23 elements left, which is really hard to bring into a 2D shape. in the end you've to come up with your own scheme with deleting an item at (i, j). deleting an item and presuming deleting means zeroing it out: a[2,2] = convert(eltype(a), 0) deleting the 2nd column: a[:,2] = convert(eltype(a), 0) deleting the 1st row: a[1, 1:end] = convert(eltype(a), 0) don't know if this tackles your question, but hope this helps.
Re: [julia-users] Re: How Delete row or col of array? like deleteat! in vectors
number removal line is dynamic. This time 4 then maybe 2 maybe 3 etc Question now : How to construct fromvector [1:10] new vector without [2,4] like this [1,3,5:10] Paul W dniu 2014-06-18 12:53, Tim Holy pisze: A = rand(5,5) A = A[[1:2,3:5], :] --Tim On Wednesday, June 18, 2014 11:26:36 AM Paul Analyst wrote: Is possible or not ? Delete rows in array ? Paul W dniu 2014-06-17 07:49, Paul Analyst pisze: Thx, for this info But not about items I need delete some rows ... How fast delete rows in arrray, one [3,:]or more [[2,4],:] ? Paul W dniu 2014-06-16 21:22, Stefan Schwarz pisze: deleting in place a matrix is not supported and does not make sense. why is that? you've for instance a 5x5 matrix and you want to delete an item. deleteat! shifts subsequent items to fill the resulting gap, so you're loosing dimensionality. basically what you can do is this: a = deleteat!(a[1:end], 1) which is deleting item at position 1. if you want to bring that back into a matrix representation the problems rear up. what dimension you'll have afterwards? 6x4? if you delete another one you'll have 23 elements left, which is really hard to bring into a 2D shape. in the end you've to come up with your own scheme with deleting an item at (i, j). deleting an item and presuming deleting means zeroing it out: a[2,2] = convert(eltype(a), 0) deleting the 2nd column: a[:,2] = convert(eltype(a), 0) deleting the 1st row: a[1, 1:end] = convert(eltype(a), 0) don't know if this tackles your question, but hope this helps.
Re: [julia-users] Re: How Delete row or col of array? like deleteat! in vectors
Ok, txh, A have lot of long vectors. Is it good time or look for something faster? julia> a=[1:1:10^6]; julia> b=[1:10:10^6]; julia> @time setdiff(a,b) elapsed time: 1.339431633 seconds (252659008 bytes allocated, 14.36% gc time) 90-element Array{Int64,1}: Paul W dniu 2014-06-18 13:38, Tim Holy pisze: setdiff --Tim On Wednesday, June 18, 2014 01:29:05 PM Paul Analyst wrote: number removal line is dynamic. This time 4 then maybe 2 maybe 3 etc Question now : How to construct fromvector [1:10] new vector without [2,4] like this [1,3,5:10] Paul W dniu 2014-06-18 12:53, Tim Holy pisze: A = rand(5,5) A = A[[1:2,3:5], :] --Tim On Wednesday, June 18, 2014 11:26:36 AM Paul Analyst wrote: Is possible or not ? Delete rows in array ? Paul W dniu 2014-06-17 07:49, Paul Analyst pisze: Thx, for this info But not about items I need delete some rows ... How fast delete rows in arrray, one [3,:]or more [[2,4],:] ? Paul W dniu 2014-06-16 21:22, Stefan Schwarz pisze: deleting in place a matrix is not supported and does not make sense. why is that? you've for instance a 5x5 matrix and you want to delete an item. deleteat! shifts subsequent items to fill the resulting gap, so you're loosing dimensionality. basically what you can do is this: a = deleteat!(a[1:end], 1) which is deleting item at position 1. if you want to bring that back into a matrix representation the problems rear up. what dimension you'll have afterwards? 6x4? if you delete another one you'll have 23 elements left, which is really hard to bring into a 2D shape. in the end you've to come up with your own scheme with deleting an item at (i, j). deleting an item and presuming deleting means zeroing it out: a[2,2] = convert(eltype(a), 0) deleting the 2nd column: a[:,2] = convert(eltype(a), 0) deleting the 1st row: a[1, 1:end] = convert(eltype(a), 0) don't know if this tackles your question, but hope this helps.
Re: [julia-users] Re: How Delete row or col of array? like deleteat! in vectors
Thanks, but I'm an analyst market, not a programmer;/ Still, I really like Julia. Historically, only SPSS. I can so deeply programmed? Any tips? Paul W dniu środa, 18 czerwca 2014 14:51:03 UTC+2 użytkownik Tim Holy napisał: > > If you left them as ranges rather than converting them to vectors (if that > fits > your usual usage case), it would be possible to have a special version of > setdiff operating on ranges that would be much faster. Would be great if > you > could write & submit that. > > --Tim > > On Wednesday, June 18, 2014 02:40:59 PM Paul Analyst wrote: > > Ok, txh, > > > > A have lot of long vectors. Is it good time or look for something > faster? > > > > julia> a=[1:1:10^6]; > > > > julia> b=[1:10:10^6]; > > > > julia> @time setdiff(a,b) > > elapsed time: 1.339431633 seconds (252659008 bytes allocated, 14.36% gc > > time) > > 90-element Array{Int64,1}: > > > > Paul > > > > W dniu 2014-06-18 13:38, Tim Holy pisze: > > > setdiff > > > > > > --Tim > > > > > > On Wednesday, June 18, 2014 01:29:05 PM Paul Analyst wrote: > > >> number removal line is dynamic. This time 4 then maybe 2 maybe 3 etc > > >> > > >> Question now : > > >> How to construct fromvector [1:10] new vector without [2,4] like this > > >> [1,3,5:10] > > >> > > >> Paul > > >> > > >> W dniu 2014-06-18 12:53, Tim Holy pisze: > > >>> A = rand(5,5) > > >>> A = A[[1:2,3:5], :] > > >>> > > >>> --Tim > > >>> > > >>> On Wednesday, June 18, 2014 11:26:36 AM Paul Analyst wrote: > > >>>> Is possible or not ? Delete rows in array ? > > >>>> Paul > > >>>> > > >>>> W dniu 2014-06-17 07:49, Paul Analyst pisze: > > >>>>> Thx, for this info > > >>>>> But not about items I need delete some rows ... > > >>>>> > > >>>>> How fast delete rows in arrray, one [3,:]or more [[2,4],:] ? > > >>>>> > > >>>>> Paul > > >>>>> > > >>>>> W dniu 2014-06-16 21:22, Stefan Schwarz pisze: > > >>>>>> deleting in place a matrix is not supported and does not make > sense. > > >>>>>> > > >>>>>> why is that? > > >>>>>> > > >>>>>> you've for instance a 5x5 matrix and you want to delete an item. > > >>>>>> deleteat! shifts subsequent items to fill the resulting gap, so > > >>>>>> you're > > >>>>>> loosing dimensionality. > > >>>>>> > > >>>>>> basically what you can do is this: > > >>>>>> a = deleteat!(a[1:end], 1) > > >>>>>> > > >>>>>> which is deleting item at position 1. > > >>>>>> > > >>>>>> if you want to bring that back into a matrix representation the > > >>>>>> problems rear up. > > >>>>>> > > >>>>>> what dimension you'll have afterwards? 6x4? > > >>>>>> if you delete another one you'll have 23 elements left, which is > > >>>>>> really hard to bring > > >>>>>> into a 2D shape. > > >>>>>> > > >>>>>> in the end you've to come up with your own scheme with deleting > an > > >>>>>> item at (i, j). > > >>>>>> > > >>>>>> deleting an item and presuming deleting means zeroing it out: > > >>>>>> a[2,2] = convert(eltype(a), 0) > > >>>>>> > > >>>>>> deleting the 2nd column: > > >>>>>> a[:,2] = convert(eltype(a), 0) > > >>>>>> > > >>>>>> deleting the 1st row: > > >>>>>> a[1, 1:end] = convert(eltype(a), 0) > > >>>>>> > > >>>>>> don't know if this tackles your question, but hope this helps. > >
Re: [julia-users] Re: How Delete row or col of array? like deleteat! in vectors
Great lesson thanks, I'll try :) Paul W dniu 2014-06-18 16:51, Tim Holy pisze: On Wednesday, June 18, 2014 06:06:24 AM paul analyst wrote: >Thanks, but I'm an analyst market, not a programmer;/ Still, I really like >Julia. Historically, only SPSS. I can so deeply programmed? Any tips? Yes, with Julia it's easy to reach in "deep." First you might want to look at existing methods for setdiff: julia> methods(setdiff) # 3 methods for generic function "setdiff": setdiff(a::IntSet,b::IntSet) at intset.jl:90 setdiff(a::Set{T},b::Set{T}) at set.jl:73 setdiff(a,b) at array.jl:1352 From this, personally I'd guess the implementation in array.jl will be closest to what you want. So open up an editor and look at the implementation in base/array.jl (I'll add a few comments to help you): # from array.jl, line 1352: function setdiff(a, b) # The first few lines initialize an empty output Vector # with the correct element type, # and convert b to a Set so that it's fast to test whether # an element of a can be found in b. args_type = promote_type(eltype(a), eltype(b)) bset = Set(b) ret = Array(args_type,0) # seen is to make sure we return just the unique values in a seen = Set() for a_elem in a # loop over all the elements in a # test that we haven't seen a_elem before, # and that it's not present in b if !in(a_elem, seen) && !in(a_elem, bset) push!(ret, a_elem) # keep the element push!(seen, a_elem)# mark it as seen end end ret# return the result end That's it! For implementing your own version, start like this: import Base.setdiff function setdiff(a::Ranges, b::Ranges) # code goes here end This means your version will be called whenever both inputs are Range-type objects. For the actual implementation, here's another hint: you probably noticed that most of the "magic" was taken care of by the "in" function. Why not check to see whether there are any methods already defined for Range objects? If so, you can expect that they might be more efficient that for Sets. Also, you probably don't have to worry about "seen" because the elements of the range are guaranteed to be unique (if step(a) != 0). So, you could almost cut-and-paste that implementation for arrays, but delete all the parts that deal with Sets. Once you've developed the code, try posting it here for comments. Eventually you might want to learn git, but let's take one step at a time:-). --Tim
[julia-users] how to get vec with index (position) of a particular value (eg 1) in vector
How to Do a vector indicating the position of a particular value (eg 1) in another vector? by this question: (1)? [0 0 1 01] expected vector [3,5] Paul
[julia-users] How to convert vector to a series of possible pairs of elements ?
How to convert vector to a series of possible pairs of elements ? [1,2,3] I expect [1,1] [1,2] [1,3] [2,1] [2,2] [2,3] [3,1] [3,2] [3,3]
Re: [julia-users] Re: How to convert vector to a series of possible pairs of elements ?
Thank you. Do loops is the fastest way? I have a lot of such vectors ... Is it ready, optimized command from combinatorics? Paul W dniu 2014-06-19 21:55, Ethan Anderes pisze: … I probably should not have been sloppy about the typing the comprehensions in my previous answer. I think this is probably better |julia> x = [1,2,3] 3-element Array{Int64,1}: 1 2 3 julia> pairs_any = [[i,j] for i in x, j in x] |> vec 9-element Array{Any,1}: [1,1] [2,1] [3,1] [1,2] [2,2] [3,2] [1,3] [2,3] [3,3] julia> pairs_int = Vector{eltype(x)}[[i,j] for i in x, j in x] |> vec 9-element Array{Array{Int64,1},1}: [1,1] [2,1] [3,1] [1,2] [2,2] [3,2] [1,3] [2,3] [3,3] | btw, I’m a bit puzzled what Array{Array{T,1},1} means when T is not defined. This is what I get when I did the sloppy version |julia> pairs_T = Vector[[i,j] for i in x, j in x] |> vec 9-element Array{Array{T,1},1}: [1,1] [2,1] [3,1] [1,2] [2,2] [3,2] [1,3] [2,3] [3,3] julia> T ERROR: T not defined | On Thursday, June 19, 2014 12:49:21 PM UTC-7, Ethan Anderes wrote: Comprehensions will give you what you want |x = [1,2,3] pairs = Vector[[i,j] for i in x, j in x] |> vec | On Thursday, June 19, 2014 12:16:32 PM UTC-7, paul analyst wrote: How to convert vector to a series of possible pairs of elements ? [1,2,3] I expect [1,1] [1,2] [1,3] [2,1] [2,2] [2,3] [3,1] [3,2] [3,3]
[julia-users] Please help, I can't to deploy a simple parallelization .
Despite many attempts, I can't to deploy a simple parallelization and ask for help on a specific the example. Array WS can be broken down into clones, and at the finish may then add them, but WS is great and it would be better without cloning it. D=readcsv("D.txt"); k,l=size(D) 10,1 WS=zeros(l,l); Dt=int(D.>0); for i=1:k; kosz=findin(Dt[i,:],1); for o in kosz,p in kosz; para=[o,p]; #println(para); WS[para[1],para[2]]+=1; println(i); end; end; Paul
[julia-users] Sort error, How to find reserved word in big text ?
I have a very long vector (5*10^6 ) with the words in a foreign language. I can not sort julia> sort (y1u) ERROR: no method isless (Float64, substring {UTF8String}) in the sort! at sort.jl: 233 in the sort! at sort.jl: 277 in next at string.jl: 630 Probably there is a word reserved for Julia. How to find them? Where is the list of such words? Paul
[julia-users] how use find ?
I need all indexes where a[:] >5 julia> a=rand(10)*10 10-element Array{Float64,1}: 4.84005 8.29994 8.8531 3.42319 2.60318 7.25313 0.816263 4.44463 6.71836 4.65337 julia> a.>5 10-element BitArray{1}: false true true false false true false false true false julia> find(a.>5,a) ERROR: no method find(BitArray{1}, Array{Float64,1}) julia> find([a.>5],a) ERROR: no method find(BitArray{1}, Array{Float64,1}) julia>
Re: [julia-users] Sort error, How to find reserved word in big text ?
What about "space" ? the data: a,a,conj+interj+prep:nom+qub aa,aa,interj AA,AA,subst:pl:acc:m3+subst:pl:acc:n2+subst:pl:acc:p1+subst:pl:dat:m3+subst:pl:dat:n2+subst:pl:dat:p1+subst:pl:gen:m3+subst:pl:gen:n2+subst:pl:gen:p1+subst:pl:inst:m3+subst:pl:inst:n2+subst:pl:inst:p1+subst:pl:loc:m3+subst:pl:loc:n2+subst:pl:loc:p1+subst:pl:nom:m3+subst:pl:nom:n2+subst:pl:nom:p1+subst:pl:voc:m3+subst:pl:voc:n2+subst:pl:voc:p1+subst:sg:acc:m3+subst:sg:acc:n2+subst:sg:dat:m3+subst:sg:dat:n2+subst:sg:gen:m3+subst:sg:gen:n2+subst:sg:inst:m3+subst:sg:inst:n2+subst:sg:loc:m3+subst:sg:loc:n2+subst:sg:nom:m3+subst:sg:nom:n2+subst:sg:voc:m3+subst:sg:voc:n2 aa,*ad acta*,brev:npun Aachen,Aachen,subst:pl:acc:m3+subst:pl:acc:n2+subst:pl:dat:m3+subst:pl:dat:n2+subst:pl:gen:m3+subst:pl:gen:n2+subst:pl:inst:m3+subst:pl:inst:n2+subst:pl:loc:m3+subst:pl:loc:n2+su in line 5 Error julia> for i=1:k, j=1:l yp[i,j]=parse(y[i,j]; raise=true) println(i) end 1 1 2 2 3 3 4 ERROR: ParseError("extra token \"acta\" after end of expression") in parse at string.jl:1221 in parse at string.jl:1234 Paul W dniu 2014-07-12 21:08, Stefan Karpinski pisze: Yes, parse(str; raise=true) is the kind of thing I mean. How does Inf get turned into a floating-point value if you're not doing any parsing? If you just read the input as strings using readlines then Inf will just be a string like all the other data. On Sat, Jul 12, 2014 at 11:58 AM, programista wpf mailto:programista...@gmail.com>> wrote: no prasing, for what is parsing ? Like : parse(str; raise=true) ? Paul ? W dniu 2014-07-12 19:59, Stefan Karpinski pisze: You probably shouldn't be parsing these the way you're parsing them. Are you using parse? On Sat, Jul 12, 2014 at 9:56 AM, mailto:programista...@gmail.com>> wrote: Not, i found this: it was row with "inf" inerwacjom *Inf* infam infama how to defend against such cases? I have a dynamic dictionaries from the network. Paul W dniu sobota, 12 lipca 2014 18:14:39 UTC+2 użytkownik Stefan Karpinski napisał: The problem here seems to be that you're comparing types of values that are incomparable like a float and a string. On Sat, Jul 12, 2014 at 7:17 AM, paul analyst wrote: I have a very long vector (5*10^6 ) with the words in a foreign language. I can not sort julia> sort (y1u) ERROR: no method isless (Float64, substring {UTF8String}) in the sort! at sort.jl: 233 in the sort! at sort.jl: 277 in next at string.jl: 630 Probably there is a word reserved for Julia. How to find them? Where is the list of such words? Paul
Re: [julia-users] Sort error, How to find reserved word in big text ?
At first I did and it was a problem with the "Inf". I realized that parse a cure for "Inf" and the like. Paul W dniu 2014-07-13 08:57, Stefan Karpinski pisze: You should NOT use parse to parse your data. Is that how you're doing it? On Sat, Jul 12, 2014 at 11:54 PM, Paul Analyst <mailto:paul.anal...@mail.com>> wrote: What about "space" ? the data: a,a,conj+interj+prep:nom+qub aa,aa,interj AA,AA,subst:pl:acc:m3+subst:pl:acc:n2+subst:pl:acc:p1+subst:pl:dat:m3+subst:pl:dat:n2+subst:pl:dat:p1+subst:pl:gen:m3+subst:pl:gen:n2+subst:pl:gen:p1+subst:pl:inst:m3+subst:pl:inst:n2+subst:pl:inst:p1+subst:pl:loc:m3+subst:pl:loc:n2+subst:pl:loc:p1+subst:pl:nom:m3+subst:pl:nom:n2+subst:pl:nom:p1+subst:pl:voc:m3+subst:pl:voc:n2+subst:pl:voc:p1+subst:sg:acc:m3+subst:sg:acc:n2+subst:sg:dat:m3+subst:sg:dat:n2+subst:sg:gen:m3+subst:sg:gen:n2+subst:sg:inst:m3+subst:sg:inst:n2+subst:sg:loc:m3+subst:sg:loc:n2+subst:sg:nom:m3+subst:sg:nom:n2+subst:sg:voc:m3+subst:sg:voc:n2 aa,*ad acta*,brev:npun Aachen,Aachen,subst:pl:acc:m3+subst:pl:acc:n2+subst:pl:dat:m3+subst:pl:dat:n2+subst:pl:gen:m3+subst:pl:gen:n2+subst:pl:inst:m3+subst:pl:inst:n2+subst:pl:loc:m3+subst:pl:loc:n2+su in line 5 Error julia> for i=1:k, j=1:l yp[i,j]=parse(y[i,j]; raise=true) println(i) end 1 1 2 2 3 3 4 ERROR: ParseError("extra token \"acta\" after end of expression") in parse at string.jl:1221 in parse at string.jl:1234 Paul W dniu 2014-07-12 21:08, Stefan Karpinski pisze: Yes, parse(str; raise=true) is the kind of thing I mean. How does Inf get turned into a floating-point value if you're not doing any parsing? If you just read the input as strings using readlines then Inf will just be a string like all the other data. On Sat, Jul 12, 2014 at 11:58 AM, programista wpf mailto:programista...@gmail.com>> wrote: no prasing, for what is parsing ? Like : parse(str; raise=true) ? Paul ? W dniu 2014-07-12 19:59, Stefan Karpinski pisze: You probably shouldn't be parsing these the way you're parsing them. Are you using parse? On Sat, Jul 12, 2014 at 9:56 AM, mailto:programista...@gmail.com>> wrote: Not, i found this: it was row with "inf" inerwacjom *Inf* infam infama how to defend against such cases? I have a dynamic dictionaries from the network. Paul W dniu sobota, 12 lipca 2014 18:14:39 UTC+2 użytkownik Stefan Karpinski napisał: The problem here seems to be that you're comparing types of values that are incomparable like a float and a string. On Sat, Jul 12, 2014 at 7:17 AM, paul analyst wrote: I have a very long vector (5*10^6 ) with the words in a foreign language. I can not sort julia> sort (y1u) ERROR: no method isless (Float64, substring {UTF8String}) in the sort! at sort.jl: 233 in the sort! at sort.jl: 277 in next at string.jl: 630 Probably there is a word reserved for Julia. How to find them? Where is the list of such words? Paul
Re: [julia-users] Sort error, How to find reserved word in big text ?
ok, now : julia> data=readcsv("data.txt"); julia> du=unique(data[:,1]); julia> dus=sort(du); ERROR: no method isless(Float64, SubString{UTF8String}) in sort! at sort.jl:233 in sort! at sort.jl:277 in next at string.jl:630 julia> because the data is "inf". How you defend against such situations? Paul W dniu 2014-07-13 09:03, John Myles White pisze: parse isn’t a cure for anything. parse interprets inputs under the assumption that they are valid Julia code. Your data isn’t valid Julia code, so you should not use parse. — John On Jul 13, 2014, at 12:01 AM, Paul Analyst <mailto:paul.anal...@mail.com>> wrote: At first I did and it was a problem with the "Inf". I realized that parse a cure for "Inf" and the like. Paul W dniu 2014-07-13 08:57, Stefan Karpinski pisze: You should NOT use parse to parse your data. Is that how you're doing it? On Sat, Jul 12, 2014 at 11:54 PM, Paul Analyst mailto:paul.anal...@mail.com>> wrote: What about "space" ? the data: a,a,conj+interj+prep:nom+qub aa,aa,interj AA,AA,subst:pl:acc:m3+subst:pl:acc:n2+subst:pl:acc:p1+subst:pl:dat:m3+subst:pl:dat:n2+subst:pl:dat:p1+subst:pl:gen:m3+subst:pl:gen:n2+subst:pl:gen:p1+subst:pl:inst:m3+subst:pl:inst:n2+subst:pl:inst:p1+subst:pl:loc:m3+subst:pl:loc:n2+subst:pl:loc:p1+subst:pl:nom:m3+subst:pl:nom:n2+subst:pl:nom:p1+subst:pl:voc:m3+subst:pl:voc:n2+subst:pl:voc:p1+subst:sg:acc:m3+subst:sg:acc:n2+subst:sg:dat:m3+subst:sg:dat:n2+subst:sg:gen:m3+subst:sg:gen:n2+subst:sg:inst:m3+subst:sg:inst:n2+subst:sg:loc:m3+subst:sg:loc:n2+subst:sg:nom:m3+subst:sg:nom:n2+subst:sg:voc:m3+subst:sg:voc:n2 aa,*ad acta*,brev:npun Aachen,Aachen,subst:pl:acc:m3+subst:pl:acc:n2+subst:pl:dat:m3+subst:pl:dat:n2+subst:pl:gen:m3+subst:pl:gen:n2+subst:pl:inst:m3+subst:pl:inst:n2+subst:pl:loc:m3+subst:pl:loc:n2+su in line 5 Error julia> for i=1:k, j=1:l yp[i,j]=parse(y[i,j]; raise=true) println(i) end 1 1 2 2 3 3 4 ERROR: ParseError("extra token \"acta\" after end of expression") in parse at string.jl:1221 in parse at string.jl:1234 Paul W dniu 2014-07-12 21:08, Stefan Karpinski pisze: Yes, parse(str; raise=true) is the kind of thing I mean. How does Inf get turned into a floating-point value if you're not doing any parsing? If you just read the input as strings using readlines then Inf will just be a string like all the other data. On Sat, Jul 12, 2014 at 11:58 AM, programista wpf mailto:programista...@gmail.com>> wrote: no prasing, for what is parsing ? Like : parse(str; raise=true) ? Paul ? W dniu 2014-07-12 19:59, Stefan Karpinski pisze: You probably shouldn't be parsing these the way you're parsing them. Are you using parse? On Sat, Jul 12, 2014 at 9:56 AM, mailto:programista...@gmail.com>> wrote: Not, i found this: it was row with "inf" inerwacjom *Inf* infam infama how to defend against such cases? I have a dynamic dictionaries from the network. Paul W dniu sobota, 12 lipca 2014 18:14:39 UTC+2 użytkownik Stefan Karpinski napisał: The problem here seems to be that you're comparing types of values that are incomparable like a float and a string. On Sat, Jul 12, 2014 at 7:17 AM, paul analyst wrote: I have a very long vector (5*10^6 ) with the words in a foreign language. I can not sort julia> sort (y1u) ERROR: no method isless (Float64, substring {UTF8String}) in the sort! at sort.jl: 233 in the sort! at sort.jl: 277 in next at string.jl: 630 Probably there is a word reserved for Julia. How to find them? Where is the list of such words? Paul
Re: [julia-users] Sort error, How to find reserved word in big text ?
THX, it work! Paul W dniu 2014-07-13 09:31, Stefan Karpinski pisze: readcsv("data.txt", UTF8String) should help. On Sun, Jul 13, 2014 at 12:15 AM, Paul Analyst <mailto:paul.anal...@mail.com>> wrote: ok, now : julia> data=readcsv("data.txt"); julia> du=unique(data[:,1]); julia> dus=sort(du); ERROR: no method isless(Float64, SubString{UTF8String}) in sort! at sort.jl:233 in sort! at sort.jl:277 in next at string.jl:630 julia> because the data is "inf". How you defend against such situations? Paul W dniu 2014-07-13 09:03, John Myles White pisze: parse isn’t a cure for anything. parse interprets inputs under the assumption that they are valid Julia code. Your data isn’t valid Julia code, so you should not use parse. — John On Jul 13, 2014, at 12:01 AM, Paul Analyst mailto:paul.anal...@mail.com>> wrote: At first I did and it was a problem with the "Inf". I realized that parse a cure for "Inf" and the like. Paul W dniu 2014-07-13 08:57, Stefan Karpinski pisze: You should NOT use parse to parse your data. Is that how you're doing it? On Sat, Jul 12, 2014 at 11:54 PM, Paul Analyst mailto:paul.anal...@mail.com>> wrote: What about "space" ? the data: a,a,conj+interj+prep:nom+qub aa,aa,interj AA,AA,subst:pl:acc:m3+subst:pl:acc:n2+subst:pl:acc:p1+subst:pl:dat:m3+subst:pl:dat:n2+subst:pl:dat:p1+subst:pl:gen:m3+subst:pl:gen:n2+subst:pl:gen:p1+subst:pl:inst:m3+subst:pl:inst:n2+subst:pl:inst:p1+subst:pl:loc:m3+subst:pl:loc:n2+subst:pl:loc:p1+subst:pl:nom:m3+subst:pl:nom:n2+subst:pl:nom:p1+subst:pl:voc:m3+subst:pl:voc:n2+subst:pl:voc:p1+subst:sg:acc:m3+subst:sg:acc:n2+subst:sg:dat:m3+subst:sg:dat:n2+subst:sg:gen:m3+subst:sg:gen:n2+subst:sg:inst:m3+subst:sg:inst:n2+subst:sg:loc:m3+subst:sg:loc:n2+subst:sg:nom:m3+subst:sg:nom:n2+subst:sg:voc:m3+subst:sg:voc:n2 aa,*ad acta*,brev:npun Aachen,Aachen,subst:pl:acc:m3+subst:pl:acc:n2+subst:pl:dat:m3+subst:pl:dat:n2+subst:pl:gen:m3+subst:pl:gen:n2+subst:pl:inst:m3+subst:pl:inst:n2+subst:pl:loc:m3+subst:pl:loc:n2+su in line 5 Error julia> for i=1:k, j=1:l yp[i,j]=parse(y[i,j]; raise=true) println(i) end 1 1 2 2 3 3 4 ERROR: ParseError("extra token \"acta\" after end of expression") in parse at string.jl:1221 in parse at string.jl:1234 Paul W dniu 2014-07-12 21:08, Stefan Karpinski pisze: Yes, parse(str; raise=true) is the kind of thing I mean. How does Inf get turned into a floating-point value if you're not doing any parsing? If you just read the input as strings using readlines then Inf will just be a string like all the other data. On Sat, Jul 12, 2014 at 11:58 AM, programista wpf mailto:programista...@gmail.com>> wrote: no prasing, for what is parsing ? Like : parse(str; raise=true) ? Paul ? W dniu 2014-07-12 19:59, Stefan Karpinski pisze: You probably shouldn't be parsing these the way you're parsing them. Are you using parse? On Sat, Jul 12, 2014 at 9:56 AM, mailto:programista...@gmail.com>> wrote: Not, i found this: it was row with "inf" inerwacjom *Inf* infam infama how to defend against such cases? I have a dynamic dictionaries from the network. Paul W dniu sobota, 12 lipca 2014 18:14:39 UTC+2 użytkownik Stefan Karpinski napisał: The problem here seems to be that you're comparing types of values that are incomparable like a float and a string. On Sat, Jul 12, 2014 at 7:17 AM, paul analyst wrote: I have a very long vector (5*10^6 ) with the words in a foreign language. I can not sort julia> sort (y1u) ERROR: no method isless (Float64, substring {UTF8String}) in the sort! at sort.jl: 233 in the sort! at sort.jl: 277 in next at string.jl: 630 Probably there is a word reserved for Julia. How to find them? Where is the list of such words? Paul
[julia-users] How cartesianmap take into variable ?
Julia Documentation: cartesianmap(f, dims) Given a dims tuple of integers (m, n, ...), call f on all combinations of integers in the ranges 1:m, 1:n, etc. Example: julia> cartesianmap(println, (2,2)) 11 21 12 22 julia>x= cartesianmap(2,2) ERROR: no method cartesianmap(Int64, Int64) How to take variable (array) x= 11 21 12 22 ? Paul