Why "/" not work ?
julia> I
4-element Array{Int64,1}:
1
1
2
3
julia> J
4-element Array{Int64,1}:
1
1
2
3
julia> V
4-element Array{Int64,1}:
2
5
1
1
julia> sparse(I,J,V,3,3,*)
3x3 sparse matrix with 3 Int64 entries:
[1, 1] = 10
[2, 2] = 1
[3, 3] = 1
julia
Why "/" and "div" not work ?
julia> I
4-element Array{Int64,1}:
1
1
2
3
julia> J
4-element Array{Int64,1}:
1
1
2
3
julia> V
4-element Array{Int64,1}:
2
5
1
1
julia> sparse(I,J,V,3,3,*)
3x3 sparse matrix with 3 Int64 entries:
[1, 1] = 10
[2, 2] = 1
[3, 3] =
How to convert Char to Float? What wrong ?
julia> eltype(sort(unique(dane[:,4]))[3])
Char
julia> (sort(unique(dane[:,4]))[3])
"-.097"
julia> convert(Float64(sort(unique(dane[:,4]))[3]))
ERROR: MethodError: `convert` has no method matching convert(::Type{Float64},
::UTF8String)
This may have ar
Yes, thx.
P.
W dniu 2016-10-30 14:14, Cedric St-Jean pisze:
Dict(zip(slow[:,1], slow[:,2])) ?
On Sunday, October 30, 2016 at 8:34:29 AM UTC-4, program...@gmail.com
wrote:
Dict() how to creat in 5.0 ?
julia> typeof(slow)
Array{Any,2}
julia> D=Dict(slow[:,1],slow[:,2])
ERR
Dict() how to creat in 5.0 ?
julia> typeof(slow)
Array{Any,2}
julia> D=Dict(slow[:,1],slow[:,2])
ERROR: MethodError: no method matching Dict{K,V}(::Array{Any,1},
::Array{Any,1})
Closest candidates are:
Dict{K,V}(::Any) at dict.jl:383
Dict{K,V}{T}(::Any) at sysimg.jl:53
It is working code fr
BIG THX, but what about Float array ?
julia> Int.(rand(Bool,10))
10-element Array{Int64,1}:
1
0
1
1
1
0
1
0
0
0
julia> Int.(rand(10))
ERROR: InexactError()
in macro expansion at .\broadcast.jl:129 [inlined]
in macro expansion at .\simdloop.jl:73 [inlined]
in macro expansion at .\broad
in ver 0.5 how to convert to Int f.e bool or Float
julia> int(rand(Bool,10))
ERROR: UndefVarError: int not defined
julia> convert(Int64,rand(Bool,10))
ERROR: MethodError: Cannot `convert` an object of type Array{Bool,1} to an
object of type Int64
This may have arisen from a call to the construct
Between n comma and last comma
Paul
W dniu 2016-10-20 21:45, Kristoffer Carlsson pisze:
What do you actually want to do? Extract all characters after a comma?
On Thursday, October 20, 2016 at 9:26:01 PM UTC+2, programistawpf wrote:
Ok, I finded: findin(temp,[","])...
f
Ok, I finded: findin(temp,[","])...
for i=1:nol
temp=(collect(graphemes(readline(o
poz=(findin(temp,[","])[end])+1
write(io, temp[poz])
write(io, "\n")
if mod(i,10^6)==0 println(i) end
end
But is very slow :/ someting faster ? I have 10^ 8 line of tekst :/
Paul
W dniu 2016-10-20 20:28, pr
Thx, i slower but works:) and next question : ho to find Char in collection
?
julia> str="abc"
"abc"
julia> findin(str,"c")
1-element Array{Int64,1}:
3
julia>
julia> temp=collect(graphemes(str))
3-element Array{SubString{String},1}:
"a"
"b"
"c"
julia> findin(temp,"c")
0-element Array{Int64
Big Thx but how to work with this data ?
Paul
W dniu czwartek, 20 października 2016 19:43:47 UTC+2 użytkownik Kristoffer
Carlsson napisał:
>
> Specifically,
>
>
>- Conceptually, a string is a *partial function* from indices to
>characters: for some index values, no character value is
W dniu czwartek, 20 października 2016 19:35:41 UTC+2 użytkownik
program...@gmail.com napisał:
>
> Julia ver Version 0.5.0 (2016-09-19 18:14 UTC) 64 bits
> File is UTF8 without BOM
>
>sa sdś aa,1
Julia ver Version 0.5.0 (2016-09-19 18:14 UTC) 64 bits
File is UTF8 without BOM
What wrong ?
julia> o=open("string.txt","w")
IOStream()
julia> write(o,b)
12
julia> close(o)
julia> o=open("string.txt")
IOStream()
julia> temp=readline()
"\r\n"
julia> temp=readline(o)
"sa sdś aa,1"
julia>
julia> temp[6]
'ś'
julia> temp[7]
ERROR: UnicodeError: invalid character index
i
Julia ver 5 is OK , but is new problem with space after ś, ć . More in new
post...
Paul
W dniu środa, 19 października 2016 15:04:13 UTC+2 użytkownik Milan
Bouchet-Valat napisał:
>
> Le mercredi 19 octobre 2016 à 06:02 -0700, program...@gmail.com
> a
> écrit :
> > Version 0.3.12, udate to 5
I need list of "," [3,6,8] ... but not only first .. "3"
Paul
W dniu 2016-10-19 16:03, Krisztián Pintér pisze:
On Wednesday, October 19, 2016 at 1:46:38 PM UTC+2,
program...@gmail.com wrote:
julia> temp[61:65]
"aźdz"
julia> findin(temp[61:65],"d")
ERROR: invalid UTF-8 chara
Version 0.3.12, udate to 5 ?
W dniu środa, 19 października 2016 14:56:15 UTC+2 użytkownik Milan
Bouchet-Valat napisał:
>
> Le mercredi 19 octobre 2016 à 04:46 -0700, program...@gmail.com
> a
> écrit :
> > Data file is coding UTF8 but i cant procedsed this datain Julia ?
> > What wrong ?
> >
Data file is coding UTF8 but i cant procedsed this datain Julia ? What
wrong ?
o=open("data.txt")
julia> temp=readline(io)
"3699778,13,2,gdbiehz jablej gupując szybgi Injehnej dg 26 paździehniga,1\n"
julia> temp[61:65]
"aźdz"
julia> findin(temp[61:65],"d")
ERROR: invalid UTF-8 character index
THX, :)
W dniu czwartek, 13 października 2016 14:13:14 UTC+2 użytkownik Michele
Zaffalon napisał:
>
> What about a newline with write(f, "\n") before writing the next block of
> data into the file?
>
> On Thu, Oct 13, 2016 at 1:08 PM, >
> wrote:
>
>> How to write data to new line in outfile.txt
How to write data to new line in outfile.txt file, in this script data i
still writing in the same line
io=open("outfile.txt", "w"
o=open("dump.txt")
for i=1:100
temp=readline(o)
poz=findin(temp,",")[3]
write(io, temp[1:poz-1])
end
close(o)
close(io)
Paul
how to save string data to file? What wrong ?
julia> dset = d_create(g, "/dane", datatype(String), dataspace(nol))
ERROR: `datatype` has no method matching datatype(::Type{String})
julia> dset = d_create(g, "/dane", datatype(UTF8String), dataspace(nol))
ERROR: `datatype` has no method matching da
ThX, Paul
W dniu piątek, 12 sierpnia 2016 18:28:26 UTC+2 użytkownik Kristoffer
Carlsson napisał:
>
> try sparse(I,J,V,m,n,(a,b) ->a)
>
> On Friday, August 12, 2016 at 5:06:29 PM UTC+2, program...@gmail.com
> wrote:
>>
>> How to switfh off combine functrion in sparse? I need to ingore new
>> va
How to switfh off combine functrion in sparse? I need to ingore new value
if in data is duplicat row/col. Somthing like this : sparse(I,J,V,m,n,+=0)
but this dont work.
Paul
BigTHX,
W dniu czwartek, 23 czerwca 2016 12:04:40 UTC+2 użytkownik Tamas Papp
napisał:
>
> vcat(unique([A[i,:] for i in 1:size(A,1)])...)
>
> On Thu, Jun 23 2016, programistawpf wrote:
>
> > Thx, like below:
> > How to crate one matix of result?
> >
>
sub, convert to vectors, etc, depending
> on what you need it for.
>
> On Thu, Jun 23 2016, programistawpf wrote:
>
> > how to get all combination of rows in array ?
> >
> > 10x3 Array{Int64,2}:
> > 0 4 4
> > 4 2 0
> > 1 4 3
>
how to get all combination of rows in array ?
10x3 Array{Int64,2}:
0 4 4
4 2 0
1 4 3
2 5 1
2 2 2
2 2 3
3 0 1
4 1 4
4 4 1
1 3 4
i.e...
001
014
020
ect
Paul
How to convert pgm graphics file to array 0-255 ?
Paul
Big thx.
In documentation is :
find(f, A)
Return a vector of the linear indexes of A where f returns true.
(function, OBJECT)
What You think, s it error in documention ?
Paul
W dniu sobota, 12 lipca 2014 17:52:05 UTC+2 użytkownik Cameron McBride
napisał:
>
> julia> find( a .> 5 )
>
> cheers,
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 comparin
29 matches
Mail list logo