Can I separate unspaced data in Julia?/or round data

I got protein distance data in Julia.
And it’s like 0.03.9054839648883466.8782495592992210.390223770448832 … etc(millions of data)


And I can’t sort data one by one

It supposed to be 0.0;3.905483964888346;6.87824955929922;10.390223770448832

i can get separated data in julia when i designate specific site

image
(up in there dm means distance map)

OR if I cannot SPACE data, I want to round data like julia>round(dm.data; digits=3)

ERROR: MethodError: no method matching round(::Matrix{Float64}; digits=3)
Closest candidates are:
round(::Union{Dates.Day, Dates.Week, Dates.TimePeriod}, ::Union{Dates.Day, Dates.Week, Dates.TimePeriod}, ::RoundingMode{:NearestTiesUp}) at /builddir/build/BUILD/julia-1.6.5/build/usr/share/julia/stdlib/v1.6/Dates/src/rounding.jl:267 got unsupported keyword argument “digits”
round(::Union{Dates.Day, Dates.Week, Dates.TimePeriod, Dates.TimeType}, ::Dates.Period) at /builddir/build/BUILD/julia-1.6.5/build/usr/share/julia/stdlib/v1.6/Dates/src/rounding.jl:282 got unsupported keyword argument “digits”
round(::Union{Dates.Day, Dates.Week, Dates.TimePeriod, Dates.TimeType}, ::Dates.Period, ::RoundingMode{:Down}) at /builddir/build/BUILD/julia-1.6.5/build/usr/share/julia/stdlib/v1.6/Dates/src/rounding.jl:273 got unsupported keyword argument “digits”

but this error came out.

Can you help me to do something on this enormous data?

How do you know it is:

6.87824955929922 ; 10.390223770448832

and not:

6.878249559299221 ; 0.390223770448832

Is it by length of decimals? This task feels like it would contain ambiguities like this, especially if very big file.

I also recognize this can be ambiguous, so I got separate data by dm[1,4]=10.390223770448832 …
but I can’t do it one by one…

Yeah, automating this is important. But how did you manually know which value it was? Are values from a specific range?

It is not clear how you are printing the data, but for the problem with round the error indicates that you already have the data in a matrix and so you need to use broadcasting:

julia> v = [1.023 2.123 3.1]
1×3 Matrix{Float64}:
 1.023  2.123  3.1

julia> round.(v; digits=3)
1×3 Matrix{Float64}:
 1.023  2.123  3.1

i.e. using round.(...) rather than just round(...)

1 Like