File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import DataFrame.Internal.Column (Columnable)
1414import DataFrame.Internal.Expression (Expr (.. ))
1515
1616import qualified Data.Text as T
17+ import System.Random
1718
1819-- A re-implementation of the state monad.
1920-- `mtl` might be too heavy a dependency just to get
@@ -61,6 +62,9 @@ renameM expr newName = deriveM newName expr
6162filterWhereM :: Expr Bool -> FrameM ()
6263filterWhereM p = modifyM (D. filterWhere p)
6364
65+ sampleM :: (RandomGen g ) => g -> Double -> FrameM ()
66+ sampleM pureGen p = modifyM (D. sample pureGen p)
67+
6468filterJustM :: (Columnable a ) => Expr (Maybe a ) -> FrameM (Expr a )
6569filterJustM (Col name) = FrameM $ \ df ->
6670 let df' = D. filterJust name df
Original file line number Diff line number Diff line change @@ -18,11 +18,23 @@ import qualified Prelude
1818
1919import Control.Exception (throw )
2020import Data.Function ((&) )
21- import Data.Maybe (fromJust , fromMaybe , isJust , isNothing )
21+ import Data.Maybe (
22+ fromJust ,
23+ fromMaybe ,
24+ isJust ,
25+ isNothing ,
26+ )
2227import Data.Type.Equality (TestEquality (.. ))
23- import DataFrame.Errors (DataFrameException (.. ), TypeErrorContext (.. ))
28+ import DataFrame.Errors (
29+ DataFrameException (.. ),
30+ TypeErrorContext (.. ),
31+ )
2432import DataFrame.Internal.Column
25- import DataFrame.Internal.DataFrame (DataFrame (.. ), empty , getColumn )
33+ import DataFrame.Internal.DataFrame (
34+ DataFrame (.. ),
35+ empty ,
36+ getColumn ,
37+ )
2638import DataFrame.Internal.Expression
2739import DataFrame.Internal.Interpreter
2840import DataFrame.Operations.Core
You can’t perform that action at this time.
0 commit comments