packages feed

dataframe 2.1.0.0 → 2.1.0.1

raw patch · 3 files changed

+317/−201 lines, 3 filesdep +deepseqdep ~dataframePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: deepseq

Dependency ranges changed: dataframe

API changes (from Hackage documentation)

- DataFrame.IO.Arrow: arrowToDataframe :: Ptr () -> Ptr () -> IO DataFrame
- DataFrame.IO.Arrow: columnToArrow :: Text -> Column -> IO (Ptr ArrowSchema, Ptr ArrowArray)
- DataFrame.IO.Arrow: dataframeToArrow :: DataFrame -> IO (Ptr ArrowSchema, Ptr ArrowArray)
- DataFrame.IO.Arrow: releaseArrayImpl :: Ptr ArrowArray -> IO ()
- DataFrame.IO.Arrow: releaseSchemaImpl :: Ptr ArrowSchema -> IO ()
- DataFrame.IR: AggSpec :: Text -> Text -> Text -> AggSpec
- DataFrame.IR: Correlation :: Text -> Text -> PlanNode -> PlanNode
- DataFrame.IR: Derive :: Text -> Value -> PlanNode -> PlanNode
- DataFrame.IR: Describe :: PlanNode -> PlanNode
- DataFrame.IR: Distinct :: PlanNode -> PlanNode
- DataFrame.IR: Drop :: Int -> PlanNode -> PlanNode
- DataFrame.IR: DropLast :: Int -> PlanNode -> PlanNode
- DataFrame.IR: Exclude :: [Text] -> PlanNode -> PlanNode
- DataFrame.IR: Filter :: Value -> PlanNode -> PlanNode
- DataFrame.IR: Frequencies :: Text -> PlanNode -> PlanNode
- DataFrame.IR: FromArrow :: Word64 -> Word64 -> PlanNode
- DataFrame.IR: GroupBy :: [Text] -> [AggSpec] -> PlanNode -> PlanNode
- DataFrame.IR: Join :: Text -> [Text] -> PlanNode -> PlanNode -> PlanNode
- DataFrame.IR: Limit :: Int -> PlanNode -> PlanNode
- DataFrame.IR: Range :: Int -> Int -> PlanNode -> PlanNode
- DataFrame.IR: ReadCsv :: FilePath -> PlanNode
- DataFrame.IR: ReadJson :: FilePath -> PlanNode
- DataFrame.IR: ReadParquet :: FilePath -> PlanNode
- DataFrame.IR: ReadTsv :: FilePath -> PlanNode
- DataFrame.IR: Rename :: [(Text, Text)] -> PlanNode -> PlanNode
- DataFrame.IR: ScanCsv :: FilePath -> [(Text, Text)] -> PlanNode
- DataFrame.IR: ScanParquet :: FilePath -> [(Text, Text)] -> PlanNode
- DataFrame.IR: Select :: [Text] -> PlanNode -> PlanNode
- DataFrame.IR: Sort :: [Text] -> Bool -> PlanNode -> PlanNode
- DataFrame.IR: TakeLast :: Int -> PlanNode -> PlanNode
- DataFrame.IR: WriteCsv :: FilePath -> PlanNode -> PlanNode
- DataFrame.IR: [aggCol] :: AggSpec -> Text
- DataFrame.IR: [aggFn] :: AggSpec -> Text
- DataFrame.IR: [aggName] :: AggSpec -> Text
- DataFrame.IR: data AggSpec
- DataFrame.IR: data PlanNode
- DataFrame.IR: executePlan :: CsvReader -> PlanNode -> IO DataFrame
- DataFrame.IR: instance Data.Aeson.Types.FromJSON.FromJSON DataFrame.IR.AggSpec
- DataFrame.IR: instance Data.Aeson.Types.FromJSON.FromJSON DataFrame.IR.PlanNode
- DataFrame.IR: instance GHC.Show.Show DataFrame.IR.AggSpec
- DataFrame.IR: instance GHC.Show.Show DataFrame.IR.PlanNode
- DataFrame.IR.ExprJson: [SomeExpr] :: forall a. Columnable a => TypeRep a -> Expr a -> SomeExpr
- DataFrame.IR.ExprJson: data SomeExpr
- DataFrame.IR.ExprJson: decodeExprAny :: Value -> Either String SomeExpr
- DataFrame.IR.ExprJson: decodeExprAt :: Columnable a => Value -> Either String (Expr a)
- DataFrame.IR.ExprJson: encodeExpr :: Columnable a => Expr a -> Either String Value
- DataFrame.IR.ExprJson: encodeExprToBytes :: Columnable a => Expr a -> Either String ByteString
- DataFrame.IR.ExprJson: parseSomeExpr :: Value -> Parser SomeExpr
- DataFrame.IR.ExprJson: typeTagOf :: Typeable a => Maybe Text
- DataFrame.IR.ExprJson: withFracTypeTag :: Text -> (forall a. (Columnable a, Fractional a) => Proxy a -> Parser r) -> Parser r
- DataFrame.IR.ExprJson: withNumTypeTag :: Text -> (forall a. (Columnable a, Num a) => Proxy a -> Parser r) -> Parser r
- DataFrame.IR.ExprJson: withOrdTypeTag :: Text -> (forall a. (Columnable a, Ord a) => Proxy a -> Parser r) -> Parser r
- DataFrame.IR.ExprJson: withRealTypeTag :: Text -> (forall a. (Columnable a, Real a) => Proxy a -> Parser r) -> Parser r
- DataFrame.IR.ExprJson: withTypeTag :: Text -> (forall a. Columnable a => Proxy a -> Parser r) -> Parser r
+ DataFrame: Branch :: !Expr Bool -> !Tree a -> !Tree a -> Tree a
+ DataFrame: CarePoint :: !Int -> !Direction -> CarePoint
+ DataFrame: ColumnOrdering :: Map SomeTypeRep OrdDict -> ColumnOrdering
+ DataFrame: EitherRead :: SafeReadMode
+ DataFrame: FULL_OUTER :: JoinType
+ DataFrame: GoLeft :: Direction
+ DataFrame: GoRight :: Direction
+ DataFrame: INNER :: JoinType
+ DataFrame: InferFromSample :: Int -> TypeSpec
+ DataFrame: LEFT :: JoinType
+ DataFrame: Leaf :: !a -> Tree a
+ DataFrame: MaybeRead :: SafeReadMode
+ DataFrame: NDouble :: !Expr Double -> NumExpr
+ DataFrame: NMaybeDouble :: !Expr (Maybe Double) -> NumExpr
+ DataFrame: NoHeader :: HeaderSpec
+ DataFrame: NoInference :: TypeSpec
+ DataFrame: NoSafeRead :: SafeReadMode
+ DataFrame: ParquetReadOptions :: Maybe [Text] -> Maybe (Expr Bool) -> Maybe (Int, Int) -> Bool -> ParquetReadOptions
+ DataFrame: ParseOptions :: [Text] -> Int -> SafeReadMode -> [(Text, SafeReadMode)] -> DateFormat -> ParseOptions
+ DataFrame: ProvideNames :: [Text] -> HeaderSpec
+ DataFrame: RIGHT :: JoinType
+ DataFrame: ReadOptions :: HeaderSpec -> TypeSpec -> SafeReadMode -> [(Text, SafeReadMode)] -> String -> Char -> Maybe Int -> [Text] -> RaggedRowPolicy -> UnclosedQuotePolicy -> Bool -> ReadOptions
+ DataFrame: SpecifyTypes :: [(Text, SchemaType)] -> TypeSpec -> TypeSpec
+ DataFrame: SynthConfig :: Int -> Int -> [(Text, Text)] -> Double -> Bool -> Bool -> Bool -> SynthConfig
+ DataFrame: TreeConfig :: Int -> Int -> Int -> [Int] -> Int -> SynthConfig -> Int -> Double -> ColumnOrdering -> TreeConfig
+ DataFrame: TruncateConfig :: Int -> Int -> Int -> TruncateConfig
+ DataFrame: UseFirstRow :: HeaderSpec
+ DataFrame: [Asc] :: forall a. (Columnable a, Ord a) => Expr a -> SortOrder
+ DataFrame: [Desc] :: forall a. (Columnable a, Ord a) => Expr a -> SortOrder
+ DataFrame: [OrdDict] :: forall a. (Columnable a, Ord a) => Proxy a -> OrdDict
+ DataFrame: [boolExpansion] :: SynthConfig -> Int
+ DataFrame: [columnSeparator] :: ReadOptions -> Char
+ DataFrame: [complexityPenalty] :: SynthConfig -> Double
+ DataFrame: [cpCorrectDir] :: CarePoint -> !Direction
+ DataFrame: [cpIndex] :: CarePoint -> !Int
+ DataFrame: [dateFormat] :: ReadOptions -> String
+ DataFrame: [disallowedCombinations] :: SynthConfig -> [(Text, Text)]
+ DataFrame: [enableArithOps] :: SynthConfig -> Bool
+ DataFrame: [enableCrossCols] :: SynthConfig -> Bool
+ DataFrame: [enableStringOps] :: SynthConfig -> Bool
+ DataFrame: [fastCsvOnRaggedRow] :: ReadOptions -> RaggedRowPolicy
+ DataFrame: [fastCsvOnUnclosedQuote] :: ReadOptions -> UnclosedQuotePolicy
+ DataFrame: [fastCsvTrimUnquoted] :: ReadOptions -> Bool
+ DataFrame: [headerSpec] :: ReadOptions -> HeaderSpec
+ DataFrame: [maxCellWidth] :: TruncateConfig -> Int
+ DataFrame: [maxColumns] :: TruncateConfig -> Int
+ DataFrame: [maxExprDepth] :: SynthConfig -> Int
+ DataFrame: [maxRows] :: TruncateConfig -> Int
+ DataFrame: [missingIndicators] :: ReadOptions -> [Text]
+ DataFrame: [missingValues] :: ParseOptions -> [Text]
+ DataFrame: [numColumns] :: ReadOptions -> Maybe Int
+ DataFrame: [parseDateFormat] :: ParseOptions -> DateFormat
+ DataFrame: [parseSafeOverrides] :: ParseOptions -> [(Text, SafeReadMode)]
+ DataFrame: [parseSafe] :: ParseOptions -> SafeReadMode
+ DataFrame: [predicate] :: ParquetReadOptions -> Maybe (Expr Bool)
+ DataFrame: [rowRange] :: ParquetReadOptions -> Maybe (Int, Int)
+ DataFrame: [safeColumns] :: ParquetReadOptions -> Bool
+ DataFrame: [safeReadOverrides] :: ReadOptions -> [(Text, SafeReadMode)]
+ DataFrame: [safeRead] :: ReadOptions -> SafeReadMode
+ DataFrame: [sampleSize] :: ParseOptions -> Int
+ DataFrame: [selectedColumns] :: ParquetReadOptions -> Maybe [Text]
+ DataFrame: [typeSpec] :: ReadOptions -> TypeSpec
+ DataFrame: aggregate :: [NamedExpr] -> GroupedDataFrame -> DataFrame
+ DataFrame: apply :: (Columnable b, Columnable c) => (b -> c) -> Text -> DataFrame -> DataFrame
+ DataFrame: applyAtIndex :: Columnable a => Int -> (a -> a) -> Text -> DataFrame -> DataFrame
+ DataFrame: applyDouble :: Columnable b => (Double -> b) -> Text -> DataFrame -> DataFrame
+ DataFrame: applyInt :: Columnable b => (Int -> b) -> Text -> DataFrame -> DataFrame
+ DataFrame: applyMany :: (Columnable b, Columnable c) => (b -> c) -> [Text] -> DataFrame -> DataFrame
+ DataFrame: applyWhere :: (Columnable a, Columnable b) => (a -> Bool) -> Text -> (b -> b) -> Text -> DataFrame -> DataFrame
+ DataFrame: boolExprs :: DataFrame -> [Expr Bool] -> [Expr Bool] -> Int -> Int -> [Expr Bool]
+ DataFrame: buildGreedyTree :: (Columnable a, Ord a) => TreeConfig -> Int -> Text -> [Expr Bool] -> DataFrame -> Tree a
+ DataFrame: buildProbTree :: (Columnable a, Ord a) => Tree a -> Text -> DataFrame -> Vector Int -> ProbTree a
+ DataFrame: buildTree :: (Columnable a, Ord a) => TreeConfig -> Int -> Text -> [Expr Bool] -> DataFrame -> Expr a
+ DataFrame: byIndexRange :: (Int, Int) -> SelectionCriteria
+ DataFrame: byName :: Text -> SelectionCriteria
+ DataFrame: byNameProperty :: (Text -> Bool) -> SelectionCriteria
+ DataFrame: byNameRange :: (Text, Text) -> SelectionCriteria
+ DataFrame: byProperty :: (Column -> Bool) -> SelectionCriteria
+ DataFrame: calculateGini :: (Columnable a, Ord a) => Text -> DataFrame -> Double
+ DataFrame: class HasSchema a where {
+ DataFrame: cloneColumn :: Text -> Text -> DataFrame -> DataFrame
+ DataFrame: columnAsDoubleVector :: (Columnable a, Num a) => Expr a -> DataFrame -> Either DataFrameException (Vector Double)
+ DataFrame: columnAsFloatVector :: (Columnable a, Num a) => Expr a -> DataFrame -> Either DataFrameException (Vector Float)
+ DataFrame: columnAsIntVector :: (Columnable a, Num a) => Expr a -> DataFrame -> Either DataFrameException (Vector Int)
+ DataFrame: columnAsList :: Columnable a => Expr a -> DataFrame -> [a]
+ DataFrame: columnAsUnboxedVector :: (Columnable a, Unbox a) => Expr a -> DataFrame -> Either DataFrameException (Vector a)
+ DataFrame: columnAsVector :: Columnable a => Expr a -> DataFrame -> Either DataFrameException (Vector a)
+ DataFrame: columnNames :: DataFrame -> [Text]
+ DataFrame: combineNumExprs :: NumExpr -> NumExpr -> [NumExpr]
+ DataFrame: computeTreeLoss :: Columnable a => Text -> DataFrame -> Vector Int -> Tree a -> Double
+ DataFrame: correlation :: Text -> Text -> DataFrame -> Maybe Double
+ DataFrame: countCarePointErrors :: Expr Bool -> DataFrame -> [CarePoint] -> Int
+ DataFrame: cube :: (Int, Int) -> DataFrame -> DataFrame
+ DataFrame: data Any
+ DataFrame: data CarePoint
+ DataFrame: data Column
+ DataFrame: data DataFrame
+ DataFrame: data Direction
+ DataFrame: data Expr a
+ DataFrame: data GroupedDataFrame
+ DataFrame: data HeaderSpec
+ DataFrame: data JoinType
+ DataFrame: data LazyDataFrame
+ DataFrame: data NumExpr
+ DataFrame: data OrdDict
+ DataFrame: data ParquetReadOptions
+ DataFrame: data ParseOptions
+ DataFrame: data ReadOptions
+ DataFrame: data SafeReadMode
+ DataFrame: data SelectionCriteria
+ DataFrame: data SortOrder
+ DataFrame: data SynthConfig
+ DataFrame: data Tree a
+ DataFrame: data TreeConfig
+ DataFrame: data TruncateConfig
+ DataFrame: data TypeSpec
+ DataFrame: declareColumns :: DataFrame -> DecsQ
+ DataFrame: declareColumnsFromCsvFile :: String -> DecsQ
+ DataFrame: declareColumnsFromCsvWithOpts :: ReadOptions -> String -> DecsQ
+ DataFrame: declareColumnsFromParquetFile :: String -> DecsQ
+ DataFrame: declareColumnsWithPrefix :: Text -> DataFrame -> DecsQ
+ DataFrame: declareColumnsWithPrefix' :: Maybe Text -> DataFrame -> DecsQ
+ DataFrame: defaultColumnOrdering :: ColumnOrdering
+ DataFrame: defaultParquetReadOptions :: ParquetReadOptions
+ DataFrame: defaultParseOptions :: ParseOptions
+ DataFrame: defaultReadOptions :: ReadOptions
+ DataFrame: defaultSynthConfig :: SynthConfig
+ DataFrame: defaultTreeConfig :: TreeConfig
+ DataFrame: defaultTruncateConfig :: TruncateConfig
+ DataFrame: derive :: Columnable a => Text -> Expr a -> DataFrame -> DataFrame
+ DataFrame: deriveMany :: [NamedExpr] -> DataFrame -> DataFrame
+ DataFrame: deriveSchema :: Name -> DecsQ
+ DataFrame: deriveWithExpr :: Columnable a => Text -> Expr a -> DataFrame -> (Expr a, DataFrame)
+ DataFrame: describeColumns :: DataFrame -> DataFrame
+ DataFrame: dimensions :: DataFrame -> (Int, Int)
+ DataFrame: distinct :: DataFrame -> DataFrame
+ DataFrame: drop :: Int -> DataFrame -> DataFrame
+ DataFrame: dropLast :: Int -> DataFrame -> DataFrame
+ DataFrame: effectiveSafeRead :: SafeReadMode -> [(Text, SafeReadMode)] -> Text -> SafeReadMode
+ DataFrame: empty :: DataFrame
+ DataFrame: exclude :: [Text] -> DataFrame -> DataFrame
+ DataFrame: filter :: Columnable a => Expr a -> (a -> Bool) -> DataFrame -> DataFrame
+ DataFrame: filterAllJust :: DataFrame -> DataFrame
+ DataFrame: filterAllNothing :: DataFrame -> DataFrame
+ DataFrame: filterBy :: Columnable a => (a -> Bool) -> Expr a -> DataFrame -> DataFrame
+ DataFrame: filterJust :: Text -> DataFrame -> DataFrame
+ DataFrame: filterNothing :: Text -> DataFrame -> DataFrame
+ DataFrame: filterWhere :: Expr Bool -> DataFrame -> DataFrame
+ DataFrame: findBestGreedySplit :: (Columnable a, Ord a) => TreeConfig -> Text -> [Expr Bool] -> DataFrame -> Maybe (Expr Bool)
+ DataFrame: findBestSplit :: (Columnable a, Ord a) => TreeConfig -> Text -> [Expr Bool] -> DataFrame -> Maybe (Expr Bool)
+ DataFrame: findBestSplitTAO :: Columnable a => TreeConfig -> Text -> [Expr Bool] -> DataFrame -> Vector Int -> Tree a -> Tree a -> Expr Bool -> Expr Bool
+ DataFrame: fitDecisionTree :: (Columnable a, Ord a) => TreeConfig -> Expr a -> DataFrame -> Expr a
+ DataFrame: fitProbTree :: (Columnable a, Ord a) => TreeConfig -> Expr a -> DataFrame -> Map a (Expr Double)
+ DataFrame: fold :: (a -> DataFrame -> DataFrame) -> [a] -> DataFrame -> DataFrame
+ DataFrame: frequencies :: (Columnable a, Ord a) => Expr a -> DataFrame -> DataFrame
+ DataFrame: fromAny :: Columnable a => Any -> Maybe a
+ DataFrame: fromColumns :: HasSchema a => DataFrame -> Either Text [a]
+ DataFrame: fromCsv :: String -> IO (Either String DataFrame)
+ DataFrame: fromCsvBytes :: ByteString -> IO DataFrame
+ DataFrame: fromDataFrame :: DataFrame -> LazyDataFrame
+ DataFrame: fromList :: (Columnable a, ColumnifyRep (KindOf a) a) => [a] -> Column
+ DataFrame: fromNamedColumns :: [(Text, Column)] -> DataFrame
+ DataFrame: fromRecords :: HasSchema a => [a] -> DataFrame
+ DataFrame: fromRows :: [Text] -> [[Any]] -> DataFrame
+ DataFrame: fromUnboxedVector :: (Columnable a, Unbox a) => Vector a -> Column
+ DataFrame: fromUnnamedColumns :: [Column] -> DataFrame
+ DataFrame: fromVector :: (Columnable a, ColumnifyRep (KindOf a) a) => Vector a -> Column
+ DataFrame: fullOuterJoin :: [Text] -> DataFrame -> DataFrame -> DataFrame
+ DataFrame: generateConditionsOld :: TreeConfig -> DataFrame -> [Expr Bool]
+ DataFrame: generateNumericConds :: TreeConfig -> DataFrame -> [Expr Bool]
+ DataFrame: genericPercentile :: (Columnable a, Ord a) => Int -> Expr a -> DataFrame -> a
+ DataFrame: getCounts :: (Columnable a, Ord a) => Text -> DataFrame -> Map a Int
+ DataFrame: groupBy :: [Text] -> DataFrame -> GroupedDataFrame
+ DataFrame: hasElemType :: Columnable a => Column -> Bool
+ DataFrame: hasMissing :: Column -> Bool
+ DataFrame: identifyCarePoints :: Columnable a => Text -> DataFrame -> Vector Int -> Tree a -> Tree a -> [CarePoint]
+ DataFrame: impute :: ImputeOp a => Expr a -> BaseType a -> DataFrame -> DataFrame
+ DataFrame: imputeWith :: (ImputeOp a, Columnable (BaseType a)) => (Expr (BaseType a) -> Expr (BaseType a)) -> Expr a -> DataFrame -> DataFrame
+ DataFrame: innerJoin :: [Text] -> DataFrame -> DataFrame -> DataFrame
+ DataFrame: insert :: (Columnable a, Foldable t) => Text -> t a -> DataFrame -> DataFrame
+ DataFrame: insertColumn :: Text -> Column -> DataFrame -> DataFrame
+ DataFrame: insertUnboxedVector :: (Columnable a, Unbox a) => Text -> Vector a -> DataFrame -> DataFrame
+ DataFrame: insertVector :: Columnable a => Text -> Vector a -> DataFrame -> DataFrame
+ DataFrame: insertVectorWithDefault :: Columnable a => a -> Text -> Vector a -> DataFrame -> DataFrame
+ DataFrame: insertWithDefault :: (Columnable a, Foldable t) => a -> Text -> t a -> DataFrame -> DataFrame
+ DataFrame: interQuartileRange :: (Columnable a, Real a, Unbox a) => Expr a -> DataFrame -> Double
+ DataFrame: isNumeric :: Column -> Bool
+ DataFrame: join :: JoinType -> [Text] -> DataFrame -> DataFrame -> DataFrame
+ DataFrame: kFolds :: RandomGen g => g -> Int -> DataFrame -> [DataFrame]
+ DataFrame: leftJoin :: [Text] -> DataFrame -> DataFrame -> DataFrame
+ DataFrame: majorityValue :: (Columnable a, Ord a) => Text -> DataFrame -> a
+ DataFrame: majorityValueFromIndices :: (Columnable a, Ord a) => Text -> DataFrame -> Vector Int -> a
+ DataFrame: makeSchema :: [(Text, SchemaType)] -> Schema
+ DataFrame: mean :: (Columnable a, Real a, Unbox a) => Expr a -> DataFrame -> Double
+ DataFrame: meanMaybe :: (Columnable a, Real a) => Expr (Maybe a) -> DataFrame -> Double
+ DataFrame: median :: (Columnable a, Real a, Unbox a) => Expr a -> DataFrame -> Double
+ DataFrame: medianMaybe :: (Columnable a, Real a) => Expr (Maybe a) -> DataFrame -> Double
+ DataFrame: mkRandom :: (RandomGen g, Columnable a, ColumnifyRep (KindOf a) a, UniformRange a) => g -> Int -> a -> a -> Column
+ DataFrame: nColumns :: DataFrame -> Int
+ DataFrame: nRows :: DataFrame -> Int
+ DataFrame: newtype ColumnOrdering
+ DataFrame: null :: DataFrame -> Bool
+ DataFrame: numExprCols :: NumExpr -> [Text]
+ DataFrame: numExprEq :: NumExpr -> NumExpr -> Bool
+ DataFrame: numericCols :: DataFrame -> [NumExpr]
+ DataFrame: numericConditions :: TreeConfig -> DataFrame -> [Expr Bool]
+ DataFrame: numericExprs :: SynthConfig -> DataFrame -> [NumExpr] -> Int -> Int -> [NumExpr]
+ DataFrame: numericExprsWithTerms :: SynthConfig -> DataFrame -> [NumExpr]
+ DataFrame: optimizeAtDepth :: (Columnable a, Ord a) => TreeConfig -> Text -> [Expr Bool] -> DataFrame -> Vector Int -> Tree a -> Int -> Int -> Tree a
+ DataFrame: optimizeDepthLevel :: (Columnable a, Ord a) => TreeConfig -> Text -> [Expr Bool] -> DataFrame -> Vector Int -> Tree a -> Int -> Tree a
+ DataFrame: optimizeNode :: (Columnable a, Ord a) => TreeConfig -> Text -> [Expr Bool] -> DataFrame -> Vector Int -> Tree a -> Tree a
+ DataFrame: orderable :: (Columnable a, Ord a) => ColumnOrdering
+ DataFrame: parseDefaults :: ParseOptions -> DataFrame -> DataFrame
+ DataFrame: partitionDataFrame :: Expr Bool -> DataFrame -> (DataFrame, DataFrame)
+ DataFrame: partitionIndices :: Expr Bool -> DataFrame -> Vector Int -> (Vector Int, Vector Int)
+ DataFrame: percentile :: (Columnable a, Real a, Unbox a) => Int -> Expr a -> DataFrame -> Double
+ DataFrame: predictWithTree :: Columnable a => Text -> DataFrame -> Int -> Tree a -> a
+ DataFrame: prettyPrint :: Expr a -> String
+ DataFrame: probExprs :: (Columnable a, Ord a) => ProbTree a -> Map a (Expr Double)
+ DataFrame: probsFromIndices :: (Columnable a, Ord a) => Text -> DataFrame -> Vector Int -> Map a Double
+ DataFrame: pruneDead :: Tree a -> Tree a
+ DataFrame: pruneExpr :: Columnable a => Expr a -> Expr a
+ DataFrame: pruneTree :: Columnable a => Expr a -> Expr a
+ DataFrame: randomSplit :: RandomGen g => g -> Double -> DataFrame -> (DataFrame, DataFrame)
+ DataFrame: range :: (Int, Int) -> DataFrame -> DataFrame
+ DataFrame: readCsv :: FilePath -> IO DataFrame
+ DataFrame: readCsvWithOpts :: ReadOptions -> FilePath -> IO DataFrame
+ DataFrame: readCsvWithSchema :: CsvReader
+ DataFrame: readParquet :: FilePath -> IO DataFrame
+ DataFrame: readParquetFiles :: FilePath -> IO DataFrame
+ DataFrame: readParquetFilesWithOpts :: ParquetReadOptions -> FilePath -> IO DataFrame
+ DataFrame: readParquetWithOpts :: ParquetReadOptions -> FilePath -> IO DataFrame
+ DataFrame: readSeparated :: ReadOptions -> FilePath -> IO DataFrame
+ DataFrame: readTsv :: FilePath -> IO DataFrame
+ DataFrame: rename :: Text -> Text -> DataFrame -> DataFrame
+ DataFrame: renameMany :: [(Text, Text)] -> DataFrame -> DataFrame
+ DataFrame: rightJoin :: [Text] -> DataFrame -> DataFrame -> DataFrame
+ DataFrame: rowValue :: Expr a -> [(Text, Any)] -> Maybe a
+ DataFrame: runDataFrame :: LazyDataFrame -> IO DataFrame
+ DataFrame: safeApply :: (Columnable b, Columnable c) => (b -> c) -> Text -> DataFrame -> Either DataFrameException DataFrame
+ DataFrame: sample :: RandomGen g => g -> Double -> DataFrame -> DataFrame
+ DataFrame: scanCsv :: Schema -> Text -> LazyDataFrame
+ DataFrame: scanCsvWith :: CsvReader -> Schema -> Text -> LazyDataFrame
+ DataFrame: scanParquet :: Schema -> Text -> LazyDataFrame
+ DataFrame: scanSeparated :: Char -> Schema -> Text -> LazyDataFrame
+ DataFrame: scanSeparatedWith :: CsvReader -> Char -> Schema -> Text -> LazyDataFrame
+ DataFrame: schemaType :: (Columnable a, Read a) => SchemaType
+ DataFrame: select :: [Text] -> DataFrame -> DataFrame
+ DataFrame: selectBy :: [SelectionCriteria] -> DataFrame -> DataFrame
+ DataFrame: showDerivedExpressions :: DataFrame -> [NamedExpr]
+ DataFrame: shuffle :: RandomGen g => g -> DataFrame -> DataFrame
+ DataFrame: skewness :: (Columnable a, Real a, Unbox a) => Expr a -> DataFrame -> Double
+ DataFrame: sortBy :: [SortOrder] -> DataFrame -> DataFrame
+ DataFrame: standardDeviation :: (Columnable a, Real a, Unbox a) => Expr a -> DataFrame -> Double
+ DataFrame: stratifiedSample :: forall a g. (SplittableGen g, Columnable a) => g -> Double -> Expr a -> DataFrame -> DataFrame
+ DataFrame: stratifiedSplit :: forall a g. (SplittableGen g, Columnable a) => g -> Double -> Expr a -> DataFrame -> (DataFrame, DataFrame)
+ DataFrame: sum :: (Columnable a, Num a) => Expr a -> DataFrame -> a
+ DataFrame: summarize :: DataFrame -> DataFrame
+ DataFrame: take :: Int -> DataFrame -> DataFrame
+ DataFrame: takeLast :: Int -> DataFrame -> DataFrame
+ DataFrame: taoIteration :: (Columnable a, Ord a) => TreeConfig -> Text -> [Expr Bool] -> DataFrame -> Vector Int -> Tree a -> Tree a
+ DataFrame: taoOptimize :: (Columnable a, Ord a) => TreeConfig -> Text -> [Expr Bool] -> DataFrame -> Vector Int -> Tree a -> Tree a
+ DataFrame: toAny :: Columnable a => a -> Any
+ DataFrame: toColumns :: HasSchema a => [a] -> [(Text, Column)]
+ DataFrame: toCsv :: DataFrame -> Text
+ DataFrame: toCsv' :: DataFrame -> String
+ DataFrame: toDoubleMatrix :: DataFrame -> Either DataFrameException (Vector (Vector Double))
+ DataFrame: toFloatMatrix :: DataFrame -> Either DataFrameException (Vector (Vector Float))
+ DataFrame: toIntMatrix :: DataFrame -> Either DataFrameException (Vector (Vector Int))
+ DataFrame: toList :: Columnable a => Column -> [a]
+ DataFrame: toMarkdown :: DataFrame -> Text
+ DataFrame: toMarkdown' :: DataFrame -> String
+ DataFrame: toRecords :: HasSchema a => DataFrame -> Either Text [a]
+ DataFrame: toRowList :: DataFrame -> [[(Text, Any)]]
+ DataFrame: toRowVector :: [Text] -> DataFrame -> Vector Row
+ DataFrame: toSeparated :: Char -> DataFrame -> Text
+ DataFrame: toVector :: forall a v. (Vector v a, Columnable a) => Column -> Either DataFrameException (v a)
+ DataFrame: treeDepth :: Tree a -> Int
+ DataFrame: treeToExpr :: Columnable a => Tree a -> Expr a
+ DataFrame: type ProbTree a = Tree Map a Double
+ DataFrame: type Row = Vector Any
+ DataFrame: type Schema a :: [Type];
+ DataFrame: type family Schema a :: [Type]
+ DataFrame: valueCounts :: (Ord a, Columnable a) => Expr a -> DataFrame -> [(a, Int)]
+ DataFrame: valueProportions :: (Ord a, Columnable a) => Expr a -> DataFrame -> [(a, Double)]
+ DataFrame: variance :: (Columnable a, Real a, Unbox a) => Expr a -> DataFrame -> Double
+ DataFrame: withOrdFrom :: Columnable a => ColumnOrdering -> (Ord a => r) -> Maybe r
+ DataFrame: writeCsv :: FilePath -> DataFrame -> IO ()
+ DataFrame: writeSeparated :: Char -> FilePath -> DataFrame -> IO ()
+ DataFrame: }
+ DataFrame.Typed: (.&&.) :: forall (cols :: [Type]). TExpr cols Bool -> TExpr cols Bool -> TExpr cols Bool
+ DataFrame.Typed: (.*) :: forall a b (cols :: [Type]). (NumericWidenOp (BaseType a) (BaseType b), NullLift2Op a b (Promote (BaseType a) (BaseType b)) (WidenResult a b), Num (Promote (BaseType a) (BaseType b))) => TExpr cols a -> TExpr cols b -> TExpr cols (WidenResult a b)
+ DataFrame.Typed: (.+) :: forall a b (cols :: [Type]). (NumericWidenOp (BaseType a) (BaseType b), NullLift2Op a b (Promote (BaseType a) (BaseType b)) (WidenResult a b), Num (Promote (BaseType a) (BaseType b))) => TExpr cols a -> TExpr cols b -> TExpr cols (WidenResult a b)
+ DataFrame.Typed: (.-) :: forall a b (cols :: [Type]). (NumericWidenOp (BaseType a) (BaseType b), NullLift2Op a b (Promote (BaseType a) (BaseType b)) (WidenResult a b), Num (Promote (BaseType a) (BaseType b))) => TExpr cols a -> TExpr cols b -> TExpr cols (WidenResult a b)
+ DataFrame.Typed: (./) :: forall a b (cols :: [Type]). (DivWidenOp (BaseType a) (BaseType b), NullLift2Op a b (PromoteDiv (BaseType a) (BaseType b)) (WidenResultDiv a b), Fractional (PromoteDiv (BaseType a) (BaseType b))) => TExpr cols a -> TExpr cols b -> TExpr cols (WidenResultDiv a b)
+ DataFrame.Typed: (./=) :: forall a b (cols :: [Type]). (NumericWidenOp (BaseType a) (BaseType b), NullLift2Op a b Bool (NullCmpResult a b), Eq (Promote (BaseType a) (BaseType b))) => TExpr cols a -> TExpr cols b -> TExpr cols (NullCmpResult a b)
+ DataFrame.Typed: (./=.) :: forall a (cols :: [Type]). (Columnable a, Eq a) => TExpr cols a -> TExpr cols a -> TExpr cols Bool
+ DataFrame.Typed: (.<) :: forall a b (cols :: [Type]). (NumericWidenOp (BaseType a) (BaseType b), NullLift2Op a b Bool (NullCmpResult a b), Ord (Promote (BaseType a) (BaseType b))) => TExpr cols a -> TExpr cols b -> TExpr cols (NullCmpResult a b)
+ DataFrame.Typed: (.<.) :: forall a (cols :: [Type]). (Columnable a, Ord a) => TExpr cols a -> TExpr cols a -> TExpr cols Bool
+ DataFrame.Typed: (.<=) :: forall a b (cols :: [Type]). (NumericWidenOp (BaseType a) (BaseType b), NullLift2Op a b Bool (NullCmpResult a b), Ord (Promote (BaseType a) (BaseType b))) => TExpr cols a -> TExpr cols b -> TExpr cols (NullCmpResult a b)
+ DataFrame.Typed: (.<=.) :: forall a (cols :: [Type]). (Columnable a, Ord a) => TExpr cols a -> TExpr cols a -> TExpr cols Bool
+ DataFrame.Typed: (.==) :: forall a b (cols :: [Type]). (NumericWidenOp (BaseType a) (BaseType b), NullLift2Op a b Bool (NullCmpResult a b), Eq (Promote (BaseType a) (BaseType b))) => TExpr cols a -> TExpr cols b -> TExpr cols (NullCmpResult a b)
+ DataFrame.Typed: (.==.) :: forall a (cols :: [Type]). (Columnable a, Eq a) => TExpr cols a -> TExpr cols a -> TExpr cols Bool
+ DataFrame.Typed: (.>) :: forall a b (cols :: [Type]). (NumericWidenOp (BaseType a) (BaseType b), NullLift2Op a b Bool (NullCmpResult a b), Ord (Promote (BaseType a) (BaseType b))) => TExpr cols a -> TExpr cols b -> TExpr cols (NullCmpResult a b)
+ DataFrame.Typed: (.>.) :: forall a (cols :: [Type]). (Columnable a, Ord a) => TExpr cols a -> TExpr cols a -> TExpr cols Bool
+ DataFrame.Typed: (.>=) :: forall a b (cols :: [Type]). (NumericWidenOp (BaseType a) (BaseType b), NullLift2Op a b Bool (NullCmpResult a b), Ord (Promote (BaseType a) (BaseType b))) => TExpr cols a -> TExpr cols b -> TExpr cols (NullCmpResult a b)
+ DataFrame.Typed: (.>=.) :: forall a (cols :: [Type]). (Columnable a, Ord a) => TExpr cols a -> TExpr cols a -> TExpr cols Bool
+ DataFrame.Typed: (.||.) :: forall (cols :: [Type]). TExpr cols Bool -> TExpr cols Bool -> TExpr cols Bool
+ DataFrame.Typed: IdentityCase :: NameCase
+ DataFrame.Typed: SchemaOptions :: (String -> String) -> Maybe String -> Bool -> SchemaOptions
+ DataFrame.Typed: SnakeCase :: NameCase
+ DataFrame.Typed: TExpr :: Expr a -> TExpr (cols :: [Type]) a
+ DataFrame.Typed: That :: b -> These a b
+ DataFrame.Typed: These :: a -> b -> These a b
+ DataFrame.Typed: This :: a -> These a b
+ DataFrame.Typed: [Asc] :: forall a (cols :: [Type]). (Columnable a, Ord a) => TExpr cols a -> TSortOrder cols
+ DataFrame.Typed: [Desc] :: forall a (cols :: [Type]). (Columnable a, Ord a) => TExpr cols a -> TSortOrder cols
+ DataFrame.Typed: [generateInstance] :: SchemaOptions -> Bool
+ DataFrame.Typed: [nameTransform] :: SchemaOptions -> String -> String
+ DataFrame.Typed: [schemaTypeName] :: SchemaOptions -> Maybe String
+ DataFrame.Typed: [unTExpr] :: TExpr (cols :: [Type]) a -> Expr a
+ DataFrame.Typed: aggregate :: forall (keys :: [Symbol]) (cols :: [Type]) (aggs :: [Type]). (TAgg keys cols ('[] :: [Type]) -> TAgg keys cols aggs) -> TypedGrouped keys cols -> TypedDataFrame (Append (GroupKeyColumns keys cols) (Reverse aggs))
+ DataFrame.Typed: aggregateUntyped :: forall (keys :: [Symbol]) (cols :: [Type]). [NamedExpr] -> TypedGrouped keys cols -> DataFrame
+ DataFrame.Typed: append :: forall (cols :: [Type]). TypedDataFrame cols -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: as :: forall (name :: Symbol) a (keys :: [Symbol]) (cols :: [Type]) (aggs :: [Type]). (KnownSymbol name, Columnable a) => TExpr cols a -> TAgg keys cols aggs -> TAgg keys cols (Column name a ': aggs)
+ DataFrame.Typed: asc :: forall a (cols :: [Type]). (Columnable a, Ord a) => TExpr cols a -> TSortOrder cols
+ DataFrame.Typed: castExpr :: forall b (cols :: [Type]) src. (Columnable b, Columnable src, Read b) => TExpr cols src -> TExpr cols (Maybe b)
+ DataFrame.Typed: castExprEither :: forall b (cols :: [Type]) src. (Columnable b, Columnable src, Read b) => TExpr cols src -> TExpr cols (Either Text b)
+ DataFrame.Typed: castExprWithDefault :: forall b (cols :: [Type]) src. (Columnable b, Columnable src, Read b) => b -> TExpr cols src -> TExpr cols b
+ DataFrame.Typed: class AllKnownSymbol (names :: [Symbol])
+ DataFrame.Typed: class HasSchema a where {
+ DataFrame.Typed: class KnownSchema (cols :: [Type])
+ DataFrame.Typed: cloneColumn :: forall (old :: Symbol) (new :: Symbol) (cols :: [Type]). (KnownSymbol old, KnownSymbol new, AssertPresent old cols, AssertAbsent new cols) => TypedDataFrame cols -> TypedDataFrame (Column new (Lookup old cols) ': cols)
+ DataFrame.Typed: col :: forall (name :: Symbol) (cols :: [Type]) a. (KnownSymbol name, a ~ SafeLookup name cols, Columnable a, AssertPresent name cols) => TExpr cols a
+ DataFrame.Typed: collect :: forall a (cols :: [Type]). Columnable a => TExpr cols a -> TExpr cols [a]
+ DataFrame.Typed: columnAsList :: forall (name :: Symbol) (cols :: [Type]) a. (KnownSymbol name, a ~ SafeLookup name cols, Columnable a, AssertPresent name cols) => TypedDataFrame cols -> [a]
+ DataFrame.Typed: columnAsVector :: forall (name :: Symbol) (cols :: [Type]) a. (KnownSymbol name, a ~ SafeLookup name cols, Columnable a, AssertPresent name cols) => TypedDataFrame cols -> Vector a
+ DataFrame.Typed: columnNames :: forall (cols :: [Type]). TypedDataFrame cols -> [Text]
+ DataFrame.Typed: count :: forall a (cols :: [Type]). Columnable a => TExpr cols a -> TExpr cols Int
+ DataFrame.Typed: countAll :: forall (cols :: [Type]). TExpr cols Int
+ DataFrame.Typed: cube :: forall (cols :: [Type]). (Int, Int) -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: data Column (name :: Symbol) a
+ DataFrame.Typed: data NameCase
+ DataFrame.Typed: data SchemaOptions
+ DataFrame.Typed: data TSortOrder (cols :: [Type])
+ DataFrame.Typed: data These a b
+ DataFrame.Typed: data TypedDataFrame (cols :: [Type])
+ DataFrame.Typed: data TypedGrouped (keys :: [Symbol]) (cols :: [Type])
+ DataFrame.Typed: defaultSchemaOptions :: SchemaOptions
+ DataFrame.Typed: derive :: forall (name :: Symbol) a (cols :: [Type]). (KnownSymbol name, Columnable a, AssertAbsent name cols) => TExpr cols a -> TypedDataFrame cols -> TypedDataFrame (Snoc cols (Column name a))
+ DataFrame.Typed: deriveSchema :: String -> DataFrame -> DecsQ
+ DataFrame.Typed: deriveSchemaFromCsvFile :: String -> String -> DecsQ
+ DataFrame.Typed: deriveSchemaFromCsvFileWith :: ReadOptions -> String -> String -> DecsQ
+ DataFrame.Typed: deriveSchemaFromType :: Name -> DecsQ
+ DataFrame.Typed: deriveSchemaFromTypeWith :: SchemaOptions -> Name -> DecsQ
+ DataFrame.Typed: desc :: forall a (cols :: [Type]). (Columnable a, Ord a) => TExpr cols a -> TSortOrder cols
+ DataFrame.Typed: dimensions :: forall (cols :: [Type]). TypedDataFrame cols -> (Int, Int)
+ DataFrame.Typed: distinct :: forall (cols :: [Type]). TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: drop :: forall (cols :: [Type]). Int -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: dropColumn :: forall (name :: Symbol) (cols :: [Type]). (KnownSymbol name, AssertPresent name cols) => TypedDataFrame cols -> TypedDataFrame (RemoveColumn name cols)
+ DataFrame.Typed: dropLast :: forall (cols :: [Type]). Int -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: exclude :: forall (names :: [Symbol]) (cols :: [Type]). AllKnownSymbol names => TypedDataFrame cols -> TypedDataFrame (ExcludeSchema names cols)
+ DataFrame.Typed: filter :: forall a (cols :: [Type]). Columnable a => TExpr cols a -> (a -> Bool) -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: filterAllJust :: forall (cols :: [Type]). TypedDataFrame cols -> TypedDataFrame (StripAllMaybe cols)
+ DataFrame.Typed: filterBy :: forall a (cols :: [Type]). Columnable a => (a -> Bool) -> TExpr cols a -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: filterJust :: forall (name :: Symbol) (cols :: [Type]). (KnownSymbol name, AssertPresent name cols) => TypedDataFrame cols -> TypedDataFrame (StripMaybeAt name cols)
+ DataFrame.Typed: filterNothing :: forall (name :: Symbol) (cols :: [Type]). (KnownSymbol name, AssertPresent name cols) => TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: filterWhere :: forall (cols :: [Type]). TExpr cols Bool -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: freeze :: forall (cols :: [Type]). KnownSchema cols => DataFrame -> Maybe (TypedDataFrame cols)
+ DataFrame.Typed: freezeWithError :: forall (cols :: [Type]). KnownSchema cols => DataFrame -> Either Text (TypedDataFrame cols)
+ DataFrame.Typed: fromColumns :: HasSchema a => DataFrame -> Either Text [a]
+ DataFrame.Typed: fromRecordsTyped :: HasSchema a => [a] -> TypedDataFrame (Schema a)
+ DataFrame.Typed: fullOuterJoin :: forall (keys :: [Symbol]) (left :: [Type]) (right :: [Type]). AllKnownSymbol keys => TypedDataFrame left -> TypedDataFrame right -> TypedDataFrame (FullOuterJoinSchema keys left right)
+ DataFrame.Typed: genericFromColumns :: (Generic a, GHasColumns (Rep a)) => DataFrame -> Either Text [a]
+ DataFrame.Typed: genericToColumns :: (Generic a, GHasColumns (Rep a)) => [a] -> [(Text, Column)]
+ DataFrame.Typed: groupBy :: forall (keys :: [Symbol]) (cols :: [Type]). (AllKnownSymbol keys, AssertAllPresent keys cols) => TypedDataFrame cols -> TypedGrouped keys cols
+ DataFrame.Typed: ifThenElse :: forall a (cols :: [Type]). Columnable a => TExpr cols Bool -> TExpr cols a -> TExpr cols a -> TExpr cols a
+ DataFrame.Typed: impute :: forall (name :: Symbol) a (cols :: [Type]). (KnownSymbol name, Columnable a, Maybe a ~ Lookup name cols) => a -> TypedDataFrame cols -> TypedDataFrame (Impute name cols)
+ DataFrame.Typed: infix 4 .>
+ DataFrame.Typed: infixl 4 .>.
+ DataFrame.Typed: infixl 6 .-
+ DataFrame.Typed: infixl 7 ./
+ DataFrame.Typed: infixr 2 .||.
+ DataFrame.Typed: infixr 3 .&&.
+ DataFrame.Typed: innerJoin :: forall (keys :: [Symbol]) (left :: [Type]) (right :: [Type]). AllKnownSymbol keys => TypedDataFrame left -> TypedDataFrame right -> TypedDataFrame (InnerJoinSchema keys left right)
+ DataFrame.Typed: insert :: forall (name :: Symbol) a (cols :: [Type]) t. (KnownSymbol name, Columnable a, Foldable t, AssertAbsent name cols) => t a -> TypedDataFrame cols -> TypedDataFrame (Column name a ': cols)
+ DataFrame.Typed: insertColumn :: forall (name :: Symbol) a (cols :: [Type]). (KnownSymbol name, Columnable a, AssertAbsent name cols) => Column -> TypedDataFrame cols -> TypedDataFrame (Column name a ': cols)
+ DataFrame.Typed: insertVector :: forall (name :: Symbol) a (cols :: [Type]). (KnownSymbol name, Columnable a, AssertAbsent name cols) => Vector a -> TypedDataFrame cols -> TypedDataFrame (Column name a ': cols)
+ DataFrame.Typed: leftJoin :: forall (keys :: [Symbol]) (left :: [Type]) (right :: [Type]). AllKnownSymbol keys => TypedDataFrame left -> TypedDataFrame right -> TypedDataFrame (LeftJoinSchema keys left right)
+ DataFrame.Typed: lift :: forall a b (cols :: [Type]). (Columnable a, Columnable b) => (a -> b) -> TExpr cols a -> TExpr cols b
+ DataFrame.Typed: lift2 :: forall a b c (cols :: [Type]). (Columnable a, Columnable b, Columnable c) => (a -> b -> c) -> TExpr cols a -> TExpr cols b -> TExpr cols c
+ DataFrame.Typed: lit :: forall a (cols :: [Type]). Columnable a => a -> TExpr cols a
+ DataFrame.Typed: maximum :: forall a (cols :: [Type]). (Columnable a, Ord a) => TExpr cols a -> TExpr cols a
+ DataFrame.Typed: mean :: forall a (cols :: [Type]). (Columnable a, Real a) => TExpr cols a -> TExpr cols Double
+ DataFrame.Typed: minimum :: forall a (cols :: [Type]). (Columnable a, Ord a) => TExpr cols a -> TExpr cols a
+ DataFrame.Typed: nColumns :: forall (cols :: [Type]). TypedDataFrame cols -> Int
+ DataFrame.Typed: nRows :: forall (cols :: [Type]). TypedDataFrame cols -> Int
+ DataFrame.Typed: newtype TExpr (cols :: [Type]) a
+ DataFrame.Typed: not :: forall (cols :: [Type]). TExpr cols Bool -> TExpr cols Bool
+ DataFrame.Typed: nullLift :: forall a r (cols :: [Type]). (NullLift1Op a r (NullLift1Result a r), Columnable (NullLift1Result a r)) => (BaseType a -> r) -> TExpr cols a -> TExpr cols (NullLift1Result a r)
+ DataFrame.Typed: nullLift2 :: forall a b r (cols :: [Type]). (NullLift2Op a b r (NullLift2Result a b r), Columnable (NullLift2Result a b r)) => (BaseType a -> BaseType b -> r) -> TExpr cols a -> TExpr cols b -> TExpr cols (NullLift2Result a b r)
+ DataFrame.Typed: over :: forall (names :: [Symbol]) (cols :: [Type]) a. (Columnable a, AllKnownSymbol names, AssertAllPresent names cols) => TExpr cols a -> TExpr cols a
+ DataFrame.Typed: range :: forall (cols :: [Type]). (Int, Int) -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: rename :: forall (old :: Symbol) (new :: Symbol) (cols :: [Type]). (KnownSymbol old, KnownSymbol new) => TypedDataFrame cols -> TypedDataFrame (RenameInSchema old new cols)
+ DataFrame.Typed: renameMany :: forall (pairs :: [(Symbol, Symbol)]) (cols :: [Type]). AllKnownPairs pairs => TypedDataFrame cols -> TypedDataFrame (RenameManyInSchema pairs cols)
+ DataFrame.Typed: replaceColumn :: forall (name :: Symbol) a (cols :: [Type]). (KnownSymbol name, Columnable a, a ~ SafeLookup name cols, AssertPresent name cols) => TExpr cols a -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: rightJoin :: forall (keys :: [Symbol]) (left :: [Type]) (right :: [Type]). AllKnownSymbol keys => TypedDataFrame left -> TypedDataFrame right -> TypedDataFrame (RightJoinSchema keys left right)
+ DataFrame.Typed: sample :: forall g (cols :: [Type]). RandomGen g => g -> Double -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: schemaEvidence :: KnownSchema cols => [(Text, SomeTypeRep)]
+ DataFrame.Typed: select :: forall (names :: [Symbol]) (cols :: [Type]). (AllKnownSymbol names, AssertAllPresent names cols) => TypedDataFrame cols -> TypedDataFrame (SubsetSchema names cols)
+ DataFrame.Typed: shuffle :: forall g (cols :: [Type]). RandomGen g => g -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: sortBy :: forall (cols :: [Type]). [TSortOrder cols] -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: sum :: forall a (cols :: [Type]). (Columnable a, Num a) => TExpr cols a -> TExpr cols a
+ DataFrame.Typed: symbolVals :: AllKnownSymbol names => [Text]
+ DataFrame.Typed: take :: forall (cols :: [Type]). Int -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: takeLast :: forall (cols :: [Type]). Int -> TypedDataFrame cols -> TypedDataFrame cols
+ DataFrame.Typed: thaw :: forall (cols :: [Type]). TypedDataFrame cols -> DataFrame
+ DataFrame.Typed: toColumns :: HasSchema a => [a] -> [(Text, Column)]
+ DataFrame.Typed: toDouble :: forall a (cols :: [Type]). (Columnable a, Real a) => TExpr cols a -> TExpr cols Double
+ DataFrame.Typed: toRecordsTyped :: HasSchema a => TypedDataFrame (Schema a) -> Either Text [a]
+ DataFrame.Typed: type Schema a :: [Type];
+ DataFrame.Typed: type SchemaOf a = RepToSchema 'SnakeCase Rep a
+ DataFrame.Typed: type SchemaOfRaw a = RepToSchema 'IdentityCase Rep a
+ DataFrame.Typed: type family AssertPresent (name :: Symbol) (cols :: [Type])
+ DataFrame.Typed: unsafeCastExpr :: forall b (cols :: [Type]) src. (Columnable b, Columnable src, Read b) => TExpr cols src -> TExpr cols b
+ DataFrame.Typed: unsafeFreeze :: forall (cols :: [Type]). DataFrame -> TypedDataFrame cols
+ DataFrame.Typed: }

Files

README.md view
@@ -1,3 +1,15 @@+<!--+  This file is the runnable scripths source for the project README.+  Every ```haskell block below executes in order in a single shared session+  (later blocks see bindings from earlier blocks), and scripths inserts each+  block's output beneath it as a blockquote.++  Regenerate the rendered README with:+      scripths docs/base_scripts/base_readme.md -o README.md+  (run from the repo root, so the ./data/... paths resolve).++  Blocks tagged ```text are intentional compile-error demos and are NOT run.+--> <h1 align="center">   <a href="https://dataframe.readthedocs.io/en/latest/">     <img width="100" height="100" src="https://raw.githubusercontent.com/mchav/dataframe/master/docs/_static/haskell-logo.svg" alt="dataframe logo">@@ -29,6 +41,8 @@ - **Typed** (`import qualified DataFrame.Typed as T`) — phantom-type schema tracking with compile-time column validation. - **Monadic API** — write your transformation as a self contained pipeline. +> **This README is a runnable [scripths](https://github.com/DataHaskell/scripths) notebook.** Every Haskell block runs top-to-bottom in one shared session against the datasets in [`./data`](./data). Reproduce every output below with `scripths docs/base_scripts/base_readme.md -o README.md` from the repo root.+ ## Why this library?  * Concise, declarative, composable data pipelines using the `|>` pipe operator.@@ -38,148 +52,166 @@  ## Install + ```bash cabal update cabal install dataframe ``` + To use as a dependency in a project: + ``` build-depends: base >= 4, dataframe ``` + Works with GHC 9.4 through 9.12. A custom REPL with all imports pre-loaded is available after installing: + ```bash dataframe ``` + ## Quick Start -Save this as `Example.hs` and run with `cabal run Example.hs`:+Group sales by product and compute totals. The first block carries the+`scripths` cabal directives and the imports shared by the rest of the document;+you can also drop the same code into an `Example.hs` and run it with+`cabal run Example.hs` after adding a `#!/usr/bin/env cabal` header. -```haskell-#!/usr/bin/env cabal-{- cabal:-  build-depends: base >= 4, dataframe--}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TypeApplications #-} +```haskell+-- cabal: build-depends: dataframe, text+-- cabal: default-extensions: OverloadedStrings, TypeApplications, TemplateHaskell, DataKinds, TypeFamilies, FlexibleInstances, FlexibleContexts, ScopedTypeVariables, DeriveGeneric, UndecidableInstances import qualified DataFrame as D import qualified DataFrame.Functions as F+import qualified DataFrame.Typed as DT import DataFrame.Operators+import Data.Text (Text)+import Data.Int (Int64) -main :: IO ()-main = do-    let sales = D.fromNamedColumns-            [ ("product", D.fromList [1, 1, 2, 2, 3, 3 :: Int])-            , ("amount",  D.fromList [100, 120, 50, 20, 40, 30 :: Int])-            ]+sales = D.fromNamedColumns+    [ ("product", D.fromList [1, 1, 2, 2, 3, 3 :: Int])+    , ("amount",  D.fromList [100, 120, 50, 20, 40, 30 :: Int])+    ] -    -- Group by product and compute totals-    print $ sales-        |> D.groupBy ["product"]-        |> D.aggregate [ F.sum (F.col @Int "amount") `as` "total"-                       , F.count (F.col @Int "amount") `as` "orders"-                       ]+-- Group by product and compute totals+sales+    |> D.groupBy ["product"]+    |> D.aggregate [ F.sum (F.col @Int "amount") `as` "total"+                   , F.count (F.col @Int "amount") `as` "orders"+                   ]+    |> D.toMarkdown' ``` -```-------------------------product | total | orders---------|-------|--------  Int   |  Int  |  Int---------|-------|--------1       | 220   | 2-2       | 70    | 2-3       | 70    | 2-```+> <!-- sabela:mime text/plain -->+> | product<br>Int | total<br>Int | orders<br>Int |+> | ---------------|--------------|-------------- |+> | 1              | 220          | 2             |+> | 3              | 70           | 2             |+> | 2              | 70           | 2             | + Reading from files works the same way: + ```haskell-df <- D.readCsv "data.csv"-df <- D.readParquet "data.parquet"+fileDf <- D.readCsv "./data/housing.csv"+fileDf <- D.readParquet "./data/mtcars.parquet" --- Hugging Face datasets-df <- D.readParquet "hf://datasets/scikit-learn/iris/default/train/0000.parquet"+-- Hugging Face datasets (needs network access):+-- fileDf <- D.readParquet "hf://datasets/scikit-learn/iris/default/train/0000.parquet"++D.dimensions fileDf ``` +> <!-- sabela:mime text/plain -->+> (32,12)++ ## Interactive REPL -The `dataframe` REPL comes with all imports pre-loaded. Here's a typical exploration session:+The `dataframe` REPL comes with all imports pre-loaded. Here's a typical exploration session (each block runs as a cell): + ```haskell-dataframe> df <- D.readCsv "./data/housing.csv"-dataframe> D.dimensions df-(20640, 10)+df <- D.readCsv "./data/housing.csv"+D.dimensions df+``` -dataframe> D.describeColumns df--------------------------------------------------------------------------    Column Name     | ## Non-null Values | ## Null Values |     Type---------------------|--------------------|----------------|--------------        Text        |         Int        |      Int       |     Text---------------------|--------------------|----------------|-------------- total_bedrooms     | 20433              | 207            | Maybe Double- ocean_proximity    | 20640              | 0              | Text- median_house_value | 20640              | 0              | Double- median_income      | 20640              | 0              | Double- households         | 20640              | 0              | Double- population         | 20640              | 0              | Double- total_rooms        | 20640              | 0              | Double- housing_median_age | 20640              | 0              | Double- latitude           | 20640              | 0              | Double- longitude          | 20640              | 0              | Double+> <!-- sabela:mime text/plain -->+> (20640,10)++++```haskell+D.describeColumns df |> D.toMarkdown' ``` -The `:declareColumns` macro generates typed column references from a dataframe, so you can use column names directly in expressions instead of writing `F.col @Double "median_income"` every time:+> <!-- sabela:mime text/plain -->+> | Column Name<br>Text | # Non-null Values<br>Int | # Null Values<br>Int | Type<br>Text |+> | --------------------|--------------------------|----------------------|------------- |+> | total_bedrooms      | 20433                    | 207                  | Maybe Double |+> | ocean_proximity     | 20640                    | 0                    | Text         |+> | median_house_value  | 20640                    | 0                    | Double       |+> | median_income       | 20640                    | 0                    | Double       |+> | households          | 20640                    | 0                    | Double       |+> | population          | 20640                    | 0                    | Double       |+> | total_rooms         | 20640                    | 0                    | Double       |+> | housing_median_age  | 20640                    | 0                    | Double       |+> | latitude            | 20640                    | 0                    | Double       |+> | longitude           | 20640                    | 0                    | Double       | ++The `:declareColumns` macro (`$(D.declareColumns df)` outside the REPL) generates typed column references from a dataframe, so you can use column names directly in expressions instead of writing `F.col @Double "median_income"` every time:++ ```haskell-dataframe> :declareColumns df-"longitude :: Expr Double"-"latitude :: Expr Double"-"housing_median_age :: Expr Double"-"total_rooms :: Expr Double"-"total_bedrooms :: Expr (Maybe Double)"-"population :: Expr Double"-"households :: Expr Double"-"median_income :: Expr Double"-"median_house_value :: Expr Double"-"ocean_proximity :: Expr Text"+$(D.declareColumns df)+``` -dataframe> df |> D.groupBy ["ocean_proximity"]-              |> D.aggregate [F.mean median_house_value `as` "avg_value"]--------------------------------------- ocean_proximity |     avg_value------------------|--------------------      Text       |       Double------------------|-------------------- <1H OCEAN       | 240084.28546409807- INLAND          | 124805.39200122119- ISLAND          | 380440.0- NEAR BAY        | 259212.31179039303- NEAR OCEAN      | 249433.97742663656+> <!-- sabela:mime text/plain -->++++```haskell+df |> D.groupBy ["ocean_proximity"]+   |> D.aggregate [F.mean median_house_value `as` "avg_value"]+   |> D.toMarkdown' ``` +> <!-- sabela:mime text/plain -->+> | ocean_proximity<br>Text | avg_value<br>Double |+> | ------------------------|-------------------- |+> | NEAR BAY                | 259212.31179039303  |+> | NEAR OCEAN              | 249433.97742663656  |+> | INLAND                  | 124805.39200122119  |+> | <1H OCEAN               | 240084.28546409807  |+> | ISLAND                  | 380440.0            |++ Create new columns from existing ones: + ```haskell-dataframe> df |> D.derive "rooms_per_household" (total_rooms / households) |> D.take 3------------------------------------------------------------------------------------------------------------------- longitude | latitude | housing_median_age | total_rooms | ... | ocean_proximity | rooms_per_household------------|----------|--------------------|-------------|-----|-----------------|---------------------  Double   |  Double  |       Double       |   Double    | ... |      Text       |       Double------------|----------|--------------------|-------------|-----|-----------------|--------------------- -122.23   | 37.88    | 41.0               | 880.0       | ... | NEAR BAY        | 6.984126984126984- -122.22   | 37.86    | 21.0               | 7099.0      | ... | NEAR BAY        | 6.238137082601054- -122.24   | 37.85    | 52.0               | 1467.0      | ... | NEAR BAY        | 8.288135593220339+df |> D.derive "rooms_per_household" (total_rooms / households) |> D.take 3 |> D.toMarkdown' ``` +> <!-- sabela:mime text/plain -->+> | longitude<br>Double | latitude<br>Double | housing_median_age<br>Double | total_rooms<br>Double | total_bedrooms<br>Maybe Double | population<br>Double | households<br>Double | median_income<br>Double | median_house_value<br>Double | ocean_proximity<br>Text | rooms_per_household<br>Double |+> | --------------------|--------------------|------------------------------|-----------------------|--------------------------------|----------------------|----------------------|-------------------------|------------------------------|-------------------------|------------------------------ |+> | -122.23             | 37.88              | 41.0                         | 880.0                 | Just 129.0                     | 322.0                | 126.0                | 8.3252                  | 452600.0                     | NEAR BAY                | 6.984126984126984             |+> | -122.22             | 37.86              | 21.0                         | 7099.0                | Just 1106.0                    | 2401.0               | 1138.0               | 8.3014                  | 358500.0                     | NEAR BAY                | 6.238137082601054             |+> | -122.24             | 37.85              | 52.0                         | 1467.0                | Just 190.0                     | 496.0                | 177.0                | 7.2574                  | 352100.0                     | NEAR BAY                | 8.288135593220339             |++ Type mismatches are caught as compile errors — adding a `Double` column to a `Text` column won't silently produce garbage: -```haskell++```text dataframe> df |> D.derive "nonsense" (latitude + ocean_proximity)  <interactive>:14:47: error: [GHC-83865]@@ -191,6 +223,7 @@         '(latitude + ocean_proximity)' ``` + ## Template Haskell  For scripts and projects, Template Haskell can generate column bindings at compile time.@@ -200,14 +233,8 @@ `declareColumnsFromCsvFile` (in `DataFrame.TH`, also re-exported from `DataFrame`) reads your CSV at compile time and generates typed `Expr` bindings for every column: -```haskell-{-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE OverloadedStrings #-} -import qualified DataFrame as D-import qualified DataFrame.Functions as F-import DataFrame.Operators-+```haskell -- Reads housing.csv at compile time and generates: --   latitude :: Expr Double --   total_rooms :: Expr Double@@ -215,44 +242,63 @@ --   ... one binding per column $(D.declareColumnsFromCsvFile "./data/housing.csv") -main :: IO ()-main = do-    df <- D.readCsv "./data/housing.csv"-    print $ df-        |> D.derive "rooms_per_household" (total_rooms / households)-        |> D.filterWhere (median_income .>. 5)-        |> D.groupBy ["ocean_proximity"]-        |> D.aggregate [F.mean median_house_value `as` "avg_value"]+df <- D.readCsv "./data/housing.csv"+df |> D.derive "rooms_per_household" (total_rooms / households)+   |> D.filterWhere (median_income .>. 5)+   |> D.groupBy ["ocean_proximity"]+   |> D.aggregate [F.mean median_house_value `as` "avg_value"]+   |> D.toMarkdown' ``` +> <!-- sabela:mime text/plain -->+> | ocean_proximity<br>Text | avg_value<br>Double |+> | ------------------------|-------------------- |+> | NEAR BAY                | 361441.9354304636   |+> | NEAR OCEAN              | 380041.63071895426  |+> | INLAND                  | 234817.86695906433  |+> | <1H OCEAN               | 333411.75125531096  |++ Compare this to the manual version which requires spelling out every column name and type: + ```haskell -- Without TH — every column needs its name and type spelled out df |> D.derive "rooms_per_household"         (F.col @Double "total_rooms" / F.col @Double "households")    |> D.filterWhere (F.col @Double "median_income" .>. F.lit 5)+   |> D.take 5+   |> D.toMarkdown' ``` +> <!-- sabela:mime text/plain -->+> | longitude<br>Double | latitude<br>Double | housing_median_age<br>Double | total_rooms<br>Double | total_bedrooms<br>Maybe Double | population<br>Double | households<br>Double | median_income<br>Double | median_house_value<br>Double | ocean_proximity<br>Text | rooms_per_household<br>Double |+> | --------------------|--------------------|------------------------------|-----------------------|--------------------------------|----------------------|----------------------|-------------------------|------------------------------|-------------------------|------------------------------ |+> | -122.23             | 37.88              | 41.0                         | 880.0                 | Just 129.0                     | 322.0                | 126.0                | 8.3252                  | 452600.0                     | NEAR BAY                | 6.984126984126984             |+> | -122.22             | 37.86              | 21.0                         | 7099.0                | Just 1106.0                    | 2401.0               | 1138.0               | 8.3014                  | 358500.0                     | NEAR BAY                | 6.238137082601054             |+> | -122.24             | 37.85              | 52.0                         | 1467.0                | Just 190.0                     | 496.0                | 177.0                | 7.2574                  | 352100.0                     | NEAR BAY                | 8.288135593220339             |+> | -122.25             | 37.85              | 52.0                         | 1274.0                | Just 235.0                     | 558.0                | 219.0                | 5.6431000000000004      | 341300.0                     | NEAR BAY                | 5.8173515981735155            |+> | -122.29             | 37.82              | 49.0                         | 135.0                 | Just 29.0                      | 86.0                 | 23.0                 | 6.1183                  | 75000.0                      | NEAR BAY                | 5.869565217391305             |++ ### Generate a schema type from a CSV  `deriveSchemaFromCsvFile` generates a type synonym for use with the typed API — instead of manually writing out every column name and type: -```haskell-{-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE DataKinds #-} -import qualified DataFrame.Typed as T-+```haskell -- Generates:--- type HousingSchema = '[ T.Column "longitude" Double---                        , T.Column "latitude" Double---                        , T.Column "total_rooms" Double---                        , ...---                        ]-$(T.deriveSchemaFromCsvFile "HousingSchema" "./data/housing.csv")+-- type HousingSchema = '[ DT.Column "longitude" Double+--                       , DT.Column "latitude" Double+--                       , DT.Column "total_rooms" Double+--                       , ...+--                       ]+$(DT.deriveSchemaFromCsvFile "HousingSchema" "./data/housing.csv") ``` +> <!-- sabela:mime text/plain -->++ ### Generate a schema (and a row bridge) from a record ADT  When the canonical row shape lives in your code as a Haskell record,@@ -260,27 +306,18 @@ instance that converts between `[Order]` and a `DataFrame` (or `TypedDataFrame OrderSchema`) at runtime: -```haskell-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE TypeFamilies #-} -import Data.Int (Int64)-import qualified Data.Text as T-import qualified DataFrame as D-import qualified DataFrame.Typed as DT-+```haskell data Order = Order     { orderId :: Int64-    , region  :: T.Text+    , region  :: Text     , amount  :: Double     } deriving (Show, Eq)  $(DT.deriveSchemaFromType ''Order) -- expands to: --   type OrderSchema =---     '[DT.Column "order_id" Int64, DT.Column "region" T.Text, DT.Column "amount" Double]+--     '[DT.Column "order_id" Int64, DT.Column "region" Text, DT.Column "amount" Double] --   instance DT.HasSchema Order where --     type Schema Order = OrderSchema --     toColumns   = ...@@ -289,18 +326,45 @@ xs :: [Order] xs = [Order 1 "us" 10.0, Order 2 "eu" 20.5] --- Untyped: [Order] <-> DataFrame-df :: D.DataFrame-df = D.fromRecords xs+-- Untyped: [Order] -> DataFrame+ordersDf :: D.DataFrame+ordersDf = D.fromRecords xs -xs' :: Either T.Text [Order]-xs' = D.toRecords df          -- runtime-checked+ordersDf |> D.toMarkdown'+``` --- Typed: [Order] <-> TypedDataFrame OrderSchema-tdf :: DT.TypedDataFrame OrderSchema-tdf = DT.fromRecordsTyped xs+> <!-- sabela:mime text/plain -->+> | order_id<br>Int64 | region<br>Text | amount<br>Double |+> | ------------------|----------------|----------------- |+> | 1                 | us             | 10.0             |+> | 2                 | eu             | 20.5             |+++The runtime-checked round-trip back to records:+++```haskell+D.toRecords ordersDf :: Either Text [Order] ``` +> <!-- sabela:mime text/plain -->+> Right [Order {orderId = 1, region = "us", amount = 10.0},Order {orderId = 2, region = "eu", amount = 20.5}]+++And the typed bridge — `[Order]` to `TypedDataFrame OrderSchema` and back:+++```haskell+DT.thaw (DT.fromRecordsTyped xs :: DT.TypedDataFrame OrderSchema) |> D.toMarkdown'+```++> <!-- sabela:mime text/plain -->+> | order_id<br>Int64 | region<br>Text | amount<br>Double |+> | ------------------|----------------|----------------- |+> | 1                 | us             | 10.0             |+> | 2                 | eu             | 20.5             |++ Field names are translated `camelCase → snake_case` by default; override the translation with `deriveSchemaFromTypeWith defaultSchemaOptions{nameTransform = id}` (or any `String -> String`).@@ -309,6 +373,7 @@ typed-dataframe machinery), there's a companion splice in `DataFrame.Internal.Schema` (re-exported from `DataFrame`): + ```haskell $(D.deriveSchema ''Order) -- emits:@@ -323,92 +388,114 @@  orders :: IO D.DataFrame orders = do-    df <- D.readCsvWithSchema orderSchema "orders.csv"-    pure (D.filter orderAmount (> 100) df)+    raw <- D.readCsvWithSchema orderSchema "./data/orders.csv"+    pure (D.filter orderAmount (> 100) raw) ``` +> <!-- sabela:mime text/plain -->++ Each record field gets a typed accessor named `<lower-first TyConName><UpperFirst FieldName>`, so `data Order { customerId :: Int }` yields `orderCustomerId :: Expr Int = col "customer_id"`. That's the same shape as `$(D.declareColumns df)` produces from a runtime `DataFrame`, but driven off the ADT instead of an existing frame.  If you'd rather not depend on Template Haskell, the same schema is-available via `GHC.Generics`:+available via `GHC.Generics` (shown here on an equivalent record): -```haskell-{-# LANGUAGE DeriveGeneric #-}-{-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE UndecidableInstances #-} +```haskell import GHC.Generics (Generic) import DataFrame.Typed (Schema)-import qualified DataFrame.Typed as DT -data Order = Order { … } deriving (Generic)+data OrderG = OrderG+    { orderGId :: Int64+    , regionG  :: Text+    , amountG  :: Double+    } deriving (Generic) -type OrderSchema = DT.SchemaOf Order+type OrderGSchema = DT.SchemaOf OrderG -instance DT.HasSchema Order where-    type Schema Order = OrderSchema+instance DT.HasSchema OrderG where+    type Schema OrderG = OrderGSchema     toColumns   = DT.genericToColumns     fromColumns = DT.genericFromColumns ``` +> <!-- sabela:mime text/plain -->++ ## Typed API  When you want compile-time guarantees that column names exist and types match, wrap your `DataFrame` in a `TypedDataFrame`: -```haskell-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE TypeApplications #-}-{-# LANGUAGE OverloadedStrings #-} -import qualified DataFrame as D-import qualified DataFrame.Typed as T-import Data.Text (Text)-import DataFrame.Operators-+```haskell type EmployeeSchema =-    '[ T.Column "name"       Text-     , T.Column "department" Text-     , T.Column "salary"     Double+    '[ DT.Column "name"       Text+     , DT.Column "department" Text+     , DT.Column "salary"     Double      ] -main :: IO ()-main = do-    df <- D.readCsv "employees.csv"-    case T.freeze @EmployeeSchema df of-        Nothing  -> putStrLn "Schema mismatch!"-        Just tdf -> do-            let result = tdf-                    |> T.derive @"bonus" (T.col @"salary" * T.lit 0.1)-                    |> T.filterWhere (T.col @"salary" .>. T.lit 50000)-                    |> T.select @'["name", "bonus"]-            print (T.thaw result)+employees <- D.readCsv "./data/employees.csv"+case DT.freeze @EmployeeSchema employees of+    Nothing  -> "Schema mismatch!"+    Just tdf -> tdf+        |> DT.derive @"bonus" (DT.col @"salary" * DT.lit 0.1)+        |> DT.filterWhere (DT.col @"salary" DT..>. DT.lit 50000)+        |> DT.select @'["name", "bonus"]+        |> DT.thaw+        |> D.toMarkdown' ``` -`T.freeze` validates the runtime `DataFrame` against your schema once at the boundary. After that, every column access is checked at compile time:+> <!-- sabela:mime text/plain -->+> | name<br>Text | bonus<br>Double |+> | -------------|---------------- |+> | Alice        | 8500.0          |+> | Carol        | 12000.0         |+> | Dave         | 5200.0          |+> | Frank        | 6700.0          | -```haskell--- Typo in column name → compile error-tdf |> T.filterWhere (T.col @"slary" .>. T.lit 50000)++`DT.freeze` validates the runtime `DataFrame` against your schema once at the boundary. After that, every column access is checked at compile time:+++```text+-- Typo in column name -> compile error+tdf |> DT.filterWhere (DT.col @"slary" DT..>. DT.lit 50000) -- error: Column "slary" not found in schema --- Wrong type → compile error-tdf |> T.filterWhere (T.col @"name" .>. T.lit 50000)+-- Wrong type -> compile error+tdf |> DT.filterWhere (DT.col @"name" DT..>. DT.lit 50000) -- error: Couldn't match type 'Text' with 'Double' ``` + `filterAllJust` goes further — it strips `Maybe` from every column in the schema type, so downstream code can't accidentally treat cleaned columns as nullable: + ```haskell--- Before: TypedDataFrame '[Column "score" (Maybe Double), Column "name" Text]-let cleaned = T.filterAllJust tdf--- After:  TypedDataFrame '[Column "score" Double, Column "name" Text]+type ScoreSchema = '[ DT.Column "name" Text, DT.Column "score" (Maybe Double) ] -cleaned |> T.derive @"scaled" (T.col @"score" * T.lit 100)+scoresDf = D.fromNamedColumns+    [ ("name",  D.fromList ["a", "b", "c" :: Text])+    , ("score", D.fromList [Just 1.0, Nothing, Just 3.0 :: Maybe Double])+    ]++Just stdf = DT.freeze @ScoreSchema scoresDf++-- filterAllJust drops the null row and changes the column type from+-- (Maybe Double) to Double, so `scaled` can multiply it directly.+DT.thaw (DT.filterAllJust stdf |> DT.derive @"scaled" (DT.col @"score" * DT.lit 100)) |> D.toMarkdown' ``` +> <!-- sabela:mime text/plain -->+> | name<br>Text | score<br>Double | scaled<br>Double |+> | -------------|-----------------|----------------- |+> | a            | 1.0             | 100.0            |+> | c            | 3.0             | 300.0            |++ ## Features  **I/O**: CSV, TSV, Parquet (Snappy, ZSTD, Gzip), JSON. Read Parquet from HTTP URLs and Hugging Face datasets (`hf://` URIs). Column projection and predicate pushdown for Parquet reads.@@ -433,30 +520,49 @@  For files too large to fit in memory, `DataFrame.Lazy` provides a streaming query engine. Declare a schema, build a query plan with the same familiar operations, and `runDataFrame` runs it through an optimizer before streaming results batch-by-batch: + ```haskell import qualified DataFrame.Lazy as L-import qualified DataFrame.Functions as F-import DataFrame.Operators-import DataFrame.Internal.Schema (Schema, schemaType)-import Data.Text (Text)+import DataFrame.Internal.Schema (schemaType, makeSchema) -mySchema :: Schema-mySchema = [ ("name",   schemaType @Text)-           , ("weight", schemaType @Double)-           , ("height", schemaType @Double)-           ]+housingSchema = makeSchema+    [ ("longitude",          schemaType @Double)+    , ("latitude",           schemaType @Double)+    , ("housing_median_age", schemaType @Double)+    , ("total_rooms",        schemaType @Double)+    , ("total_bedrooms",     schemaType @(Maybe Double))+    , ("population",         schemaType @Double)+    , ("households",         schemaType @Double)+    , ("median_income",      schemaType @Double)+    , ("median_house_value", schemaType @Double)+    , ("ocean_proximity",    schemaType @Text)+    ] -main :: IO ()-main = do-    result <- L.runDataFrame $-        L.scanCsv mySchema "large_file.csv"-        |> L.filter  (F.col @Double "height" .>. F.lit 1.7)-        |> L.select  ["name", "weight", "height"]-        |> L.derive  "bmi" (F.col @Double "weight"-                           / (F.col @Double "height" * F.col @Double "height"))-        |> L.take 1000-    print result+lazyResult <- L.runDataFrame $+    L.scanCsv housingSchema "./data/housing.csv"+    |> L.filter  (F.col @Double "median_income" .>. F.lit 5)+    |> L.derive  "value_per_income"+                 (F.col @Double "median_house_value" / F.col @Double "median_income")+    |> L.select  ["ocean_proximity", "median_house_value", "value_per_income"]+    |> L.take 1000++D.take 10 lazyResult |> D.toMarkdown' ```++> <!-- sabela:mime text/plain -->+> | ocean_proximity<br>Text | median_house_value<br>Double | value_per_income<br>Double |+> | ------------------------|------------------------------|--------------------------- |+> | NEAR BAY                | 452600.0                     | 54365.06029885168          |+> | NEAR BAY                | 358500.0                     | 43185.48678536151          |+> | NEAR BAY                | 352100.0                     | 48515.997464656764         |+> | NEAR BAY                | 341300.0                     | 60480.94132657581          |+> | NEAR BAY                | 75000.0                      | 12258.307046074891         |+> | NEAR BAY                | 262500.0                     | 51554.49064163246          |+> | NEAR BAY                | 327600.0                     | 55908.25312308007          |+> | NEAR BAY                | 347600.0                     | 65748.65703260951          |+> | NEAR BAY                | 366100.0                     | 61467.42780389524          |+> | NEAR BAY                | 373600.0                     | 58895.860264211624         |+  The optimizer pushes the filter into the scan, drops unreferenced columns before reading, and stops pulling batches once 1000 rows have been collected. 
benchmark/Main.hs view
@@ -1,16 +1,27 @@ {-# LANGUAGE NumericUnderscores #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-}+{-# OPTIONS_GHC -fno-warn-orphans #-}  import qualified DataFrame as D import qualified DataFrame.Functions as F +import Control.DeepSeq (NFData (..)) import Control.Monad (void) import Criterion.Main+import DataFrame.Internal.DataFrame (forceDataFrame) import DataFrame.Operations.Join import DataFrame.Operators import System.Process hiding (env) import System.Random.Stateful++{- | Criterion's 'nf' and 'env' force benchmark inputs/results to normal form+via 'NFData'. The core library intentionally dropped its @instance NFData+DataFrame@ in favour of 'forceDataFrame', so we provide a thin orphan here+(scoped to the benchmark) that reuses it.+-}+instance NFData D.DataFrame where+    rnf df = forceDataFrame df `seq` ()  haskell :: IO () haskell = do
dataframe.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0 name:               dataframe-version:            2.1.0.0+version:            2.1.0.1  synopsis: A fast, safe, and intuitive DataFrame library. @@ -192,7 +192,6 @@         buildable: False     build-depends:         base        >= 4   && < 5,-        dataframe,         dataframe-core ^>= 1.0,         dataframe-csv ^>= 1.0,         dataframe-json ^>= 1.0,@@ -278,6 +277,7 @@     hs-source-dirs: benchmark     build-depends: base >= 4 && < 5,                    criterion >= 1 && < 2,+                   deepseq >= 1.4 && < 2,                    process >= 1.6 && < 2,                    dataframe >= 1 && < 3,                    random >= 1 && < 2,@@ -339,7 +339,6 @@                     dataframe-operations ^>= 1.0,                     dataframe-parquet ^>= 1.0,                     dataframe-parsing ^>= 1.0,-                    dataframe-th ^>= 1.0,                     HUnit ^>= 1.6,                     QuickCheck >= 2 && < 3,                     random-shuffle >= 0.0.4 && < 1,