Is there an easy way to apply bulk conversion to a Deedle frame?

I have a Deedle frame in fsharp with 45 columns, where each column contains floats. I would like to create a new frame by applying a transform to each record in the original frame. Conversion is a simple function as follows:

let minusLogOfOneLess x = -log (1.0-x)

Is there an easy way to do this?

+4
source share
1 answer

It looks like we missed the unary minus operator when adding operators to the Deedle framework! Along with the unary minus, the rest actually works already.

So you can just change -log(...)to -1.0 * log(...):

let minusLogOfOneLess (x:Frame<_, _>) = -1.0 * (log (1.0 - x))

frame [ "A" => series [1=>0.5; 2=>0.4]]
|> minusLogOfOneLess 
+3
source

Source: https://habr.com/ru/post/1531006/


All Articles