Is there a way to convert a DataArray from a string eltype to a numeric eltype and vice versa

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there a way to convert a DataArray from a string eltype to a numeric eltype and vice versa

Min-Woong Sohn
The title says it all.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to convert a DataArray from a string eltype to a numeric eltype and vice versa

Cedric St-Jean-2
Something like

d = DataArray(ASCIIString[string(s) for s in data_array], data_array.na)

and

d
= DataArray(Float64[float(s) for s in data_array], data_array.na)

You might get more answers if you post these questions in julia-users

On Saturday, April 9, 2016 at 12:34:31 AM UTC-4, Min-Woong Sohn wrote:
The title says it all.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Is there a way to convert a DataArray from a string eltype to a numeric eltype and vice versa

Min-Woong Sohn
Thank you so much!

On Monday, April 11, 2016 at 9:58:33 AM UTC-4, Cedric St-Jean wrote:
Something like

d = DataArray(ASCIIString[string(s) for s in data_array], data_array.na)

and

d
= DataArray(Float64[float(s) for s in data_array], data_array.na)

You might get more answers if you post these questions in julia-users

On Saturday, April 9, 2016 at 12:34:31 AM UTC-4, Min-Woong Sohn wrote:
The title says it all.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.