You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
correlation first second df =DI.reduceColumn @(VU.Vector (Double, Double)) SS.correlation <$> (DI.zipColumns <$> (DI.getColumn first df) <*> (DI.getColumn second df))
837
838
838
-
sum::T.Text->DataFrame->Double
839
-
sum name df =case name `MS.lookup`DI.columnIndices df of
840
-
Nothing-> throw $ColumnNotFoundException name "apply" (mapfst$M.toList $DI.columnIndices df)
841
-
Just i ->caseDI.columns df V.!? i of
842
-
Nothing->error"Internal error: Column is empty"
843
-
Just c ->case c of
844
-
Just ((UnboxedColumn (column ::VU.Vectora'))) ->case testEquality (typeRep @a') (typeRep @Int) of
845
-
JustRefl->VG.sum (VU.mapfromIntegral column)
846
-
Nothing->case testEquality (typeRep @a') (typeRep @Double) of
847
-
JustRefl->VG.sum column
848
-
Nothing->error$"Cannot get mean of non-numeric column: "++T.unpack name -- Not sure what to do with no numeric - return nothing???
849
-
Nothing->error$"Cannot get mean of non numeric column"++T.unpack name
850
-
851
-
applyStatistic:: (forallv. (VG.VectorvDouble)
852
-
=>vDouble->Double) ->T.Text->DataFrame->Double
853
-
applyStatistic f name df =case name `MS.lookup`DI.columnIndices df of
854
-
Nothing-> throw $ColumnNotFoundException name "apply" (mapfst$M.toList $DI.columnIndices df)
855
-
Just i ->caseDI.columns df V.!? i of
856
-
Nothing->error"Internal error: Column is empty"
857
-
Just c ->case c of
858
-
Just ((UnboxedColumn (column ::VU.Vectora'))) ->case testEquality (typeRep @a') (typeRep @Int) of
859
-
JustRefl-> f (VU.mapfromIntegral column)
860
-
Nothing->case testEquality (typeRep @a') (typeRep @Double) of
861
-
JustRefl-> f column
862
-
Nothing->case testEquality (typeRep @a') (typeRep @Float) of
863
-
JustRefl-> f (VG.maprealToFrac column)
864
-
Nothing->error$"Cannot get mean of non-numeric column: "++T.unpack name -- Not sure what to do with no numeric - return nothing???
865
-
_ ->error$"Cannot get mean of non numeric column: "++T.unpack name
0 commit comments