This is the call you should do to convert:
convert(Vector{Int}, Jcodes)
It would be nice to have convert work with only the element type, since its 
very unlikely that you want to convert your array into a single int.


Am Donnerstag, 4. Dezember 2014 16:44:27 UTC+1 schrieb paul analyst:
>
> I have a long vector J, which has little value. Unfortunately, these values 
> are very different (small and large) J = [1 3 7 2 12548745 2 
> 125485458544363456345 125485458544363456345 ... 3 12,548,545,854].
> The following is a very slow like:
> julia> J
> 1846623-element Array{Int64,1}:
>         930070
>        1475172
>    21474836496435345
>    21474836496435345    
> 4296445417
>        641
>        130
>        130
>        143
> ...
>     4296444827
>        143
>        148
>        144
>        145
>
> J1=zeros(J)
> suJ=sort(unique(J))
> l=length(suJ)
>
> for i =1:l
> temp=findin(J,[suJ[i]])
> J1[temp]=i;if mod(i,1000).==0 println(i) end;
> end;
>
> How fast reduce the Vector range of values (Recode for smaler numbers)?
> Paul
>

Reply via email to