4

I need to perform something like:

var myTotal = myFrame.Sum();

However, the values are string type and I get an error. How could I convert the values of the frame to a double type?

I'm using only 3 decimals "0.000", is there anything more practical than double that Deedle can handle?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Jorge Thomas
  • 127
  • 5
  • Unlike forum sites, we don't use "Thanks", or "Any help appreciated", or signatures on [so]. See "[Should 'Hi', 'thanks,' taglines, and salutations be removed from posts?](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts). BTW, it's "Thanks in advance", not "Thanks in advanced". – John Saunders Jun 06 '15 at 23:20

2 Answers2

0

How could I convert the values of the frame to a double type?

Assuming myFrame is some sort of a collection of strings which are parseable to double, you'll want to parse those strings first into doubles, and then invoke a sum:

var myTotal = myFrame.Sum(x => double.Parse(x));
Yuval Itzchakov
  • 146,575
  • 32
  • 257
  • 321
0

It is possible to build a Time Series with the Values as double, so:

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

Then a new Frame can be created and later just add the columns:

myNewDoubleValuesFrame.AddColumn("my Column Title", myTimeSeriesColumn ); 
Jorge Thomas
  • 127
  • 5