How to convert values ​​from <string> to <double> in a Deedle frame?

I need to do something like:

var myTotal = myFrame.Sum();

However, the values ​​are string types, and I get an error. How to convert frame values ​​to double type?

I use only 3 decimal places "0.000", is there anything more practical than double that Deedle can handle ?

+4
source share
2 answers

How to convert frame values ​​to double type?

Assuming that this myFrameis some collection of strings that are processed using double, you need to first parse these strings into double ones and then call the sum:

var myTotal = myFrame.Sum(x => double.Parse(x));
0
source

, :

var myTimeSeriesColumn = myFrame.GetColumn<double>("Column Title"); // Returns <series>

, :

myNewDoubleValuesFrame.AddColumn("my Column Title", myTimeSeriesColumn ); 
0

All Articles