hanalyze-frame: Data I/O layer of hanalyze: loaders, cleaning, tidy wrangling

[ bsd3, library, machine-learning, math, numeric, statistics ] [ Propose Tags ] [ Report a vulnerability ]

The data I/O layer of the hanalyze toolkit, built on Hackage's dataframe as the single data representation. CSV TSV SSV Parquet JSON loaders with delimiter and header sniffing, a health checker that reports suspicious data as warning codes plus a cleaning DSL to act on them, and tidyverse-style wrangling: dplyr-style summarise mutate groupBy, forcats-style factors, stringr-style text helpers, and reshape operations (pivotWider oneHot lag / rolling). . Module names match the umbrella package hanalyze, which re-exports everything, so downstream imports stay identical. See README.md for the module map and a standalone usage example.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2.0.1
Dependencies array (>=0.5 && <0.6), base (>=4.14 && <5), bytestring (>=0.11 && <0.13), cassava (>=0.5 && <0.6), containers (>=0.6 && <0.8), dataframe-core (>=1.1 && <1.2), dataframe-csv (>=1.0.2 && <1.1), dataframe-json (>=1.0 && <1.1), dataframe-operations (>=1.1.1 && <1.2), dataframe-parquet (>=1.1 && <1.2), deepseq (>=1.4 && <1.6), hanalyze-core (==0.2.0.1), regex-tdfa (>=1.3 && <1.4), temporary (>=1.3 && <1.4), text (>=1.2 && <2.2), unicode-transforms (>=0.4 && <0.5), unordered-containers (>=0.2 && <0.3), vector (>=0.12 && <0.14) [details]
Tested with ghc ==9.6.7
License BSD-3-Clause
Copyright 2026 Aelysce Project (Toshiaki Honda)
Author Toshiaki Honda
Maintainer frenzieddoll@gmail.com
Uploaded by frenzieddoll at 2026-08-13T05:54:45Z
Category Math, Statistics, Numeric, Machine Learning
Distributions
Reverse Dependencies 4 direct, 2 indirect [details]
Downloads 1 total (1 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-08-13 [all 1 reports]

Readme for hanalyze-frame-0.2.0.1

[back to package description]

hanalyze-frame

The data I/O layer of hanalyze. It adopts Hackage's dataframe as the single data representation and covers everything from loading dirty data to tidyverse-style wrangling.

It depends on hanalyze-core plus dataframe-* / cassava / regex-tdfa and friends. Together with -bayes it sits directly on top of core, and the upper layers (-models / -design / -viz) all assume the data representation defined here.

Main modules (14 in total)

Loading (Hanalyze.DataIO.*)

Module Role
DataIO.CSV CSV / TSV / SSV loaders returning a DataFrame directly. loadAuto dispatches on the extension; loadAutoSafe is the defensive variant returning Either plus a log
DataIO.Sniff Guesses delimiter, comment marker, header presence and NA tokens from the first 8 KB
DataIO.Health Flags suspicious patterns in a loaded DataFrame as warning codes W001–W008
DataIO.Clean A per-column cleaning DSL that turns Health warnings into numeric rules
DataIO.Log Structured warnings shared by loaders and preprocessing (LogEntry / LogReport)
DataIO.External Parquet / JSON loaders (via dataframe)
DataIO.Convert Safe extraction of numeric / text columns from a DataFrame into Vector

Wrangling (Hanalyze.Data.* / DataIO.*)

Module Role
Data.Wrangle dplyr-style summarise / mutate / groupBy, DataFrame in and out. Designed symmetrically with hgg's pipe notation
Data.Transform dplyr-style ranking / offsets / cumulatives / binning as pure [a] -> [b]
Data.Factor forcats-style factor type and level operations (fct_*)
Data.Strings stringr-style pure Text operations (str_*)
Data.ColumnSource Minimal "column name → numeric column" abstraction (plot-independent)
DataIO.Reshape Reshape operations dataframe lacks (pivotWider / oneHot / lag & lead / rolling)
DataIO.Preprocess Missing-value detection, removal and imputation / column selection / derived columns / melt

Using it standalone

build-depends: hanalyze-frame, dataframe-core
{-# LANGUAGE OverloadedStrings #-}
import           Hanalyze.DataIO.CSV  (loadAuto)
import           Hanalyze.Data.Wrangle
import           DataFrame.Operators         ((|>))

main = do
  Right df <- loadAuto "flights.csv"      -- IO (Either ParseError DataFrame)
  let out = df |> groupBy ["month"]
               |> summarise [ "mean" =: meanOf "dep_delay"
                            , "q95"  =: quantileOf 0.95 "dep_delay"
                            , "n"    =: nOf ]
  print out
  -- month |        mean        |        q95         |  n
  -- ------|--------------------|--------------------|----
  -- 1     | 4.5                | 11.549999999999999 | 3
  -- 2     | 11.166666666666666 | 23.25              | 3

Aggregators drop NAs by default (dplyr's na.rm = TRUE), and groups come out in ascending key order.

Normally you would just depend on the umbrella package hanalyze and reach these through import Hanalyze. Naming a layer directly is only worth it when you want to minimise dependencies.

repository README