# \[ANN\] Cleaner.jl: A toolbox of simple solutions for common data cleaning problems v1.0

**URL:** https://discourse.julialang.org/t/ann-cleaner-jl-a-toolbox-of-simple-solutions-for-common-data-cleaning-problems-v1-0/75902
**Category:** Package Announcements
**Tags:** package, announcement, dataframes, tables
**Created:** [February 6, 2022, 4:57pm UTC](https://discourse.julialang.org/t/ann-cleaner-jl-a-toolbox-of-simple-solutions-for-common-data-cleaning-problems-v1-0/75902 "2022-02-06T16:57:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![TheRoniOne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/theronione/32/17359_2.png) [@TheRoniOne](https://discourse.julialang.org/u/TheRoniOne)
#### Post date: [February 6, 2022, 4:57pm UTC](https://discourse.julialang.org/t/ann-cleaner-jl-a-toolbox-of-simple-solutions-for-common-data-cleaning-problems-v1-0/75902/1 "2022-02-06T16:57:55Z")

</div>

After months of development, I finally consider [Cleaner.jl](https://github.com/TheRoniOne/Cleaner.jl) to be feature complete and stable enough to release version 1.0

Current features are:

- Format column names to make them unique and fit `snake_case` or `camelCase` style.
- Remove rows and columns filled with different kinds of empty values. e.g: `missing` , `""` , `"NA"` , `"None"`
- Delete columns filled with just a constant value.
- Delete rows with at least one missing value.
- Use a row as the names of the columns.
- Minimize the amount of element types for each column without making the column of type `Any` .
- Add a row index to your table.
- Automatically use multiple threads if your data is big enough (and you are running `Julia` with more than 1 thread).
- Rematerialize your original source [Tables.jl](https://github.com/JuliaData/Tables.jl) type, as `CleanTable` implements the [Tables.jl](https://github.com/JuliaData/Tables.jl) interface too.
- Apply `Cleaner` transformations on your original table implementation and have the resulting table be of the same type as the original.
- Get all repeated values or value combinations that are supposed to be unique.
- Get the percentage distribution of the different categories that make up your table.
- Compare tables to help solve `join` or `merge` problems caused by having different schemas.

# Examples:

```julia-auto
julia> using DataFrames: DataFrame

julia> using Cleaner

julia> df = DataFrame(" Some bad Name" => [missing, missing, missing], "Another_weird name " => [1, "x", 3])
3×2 DataFrame
 Row │ Some bad Name Another_weird name
     │ Missing Any
─────┼─────────────────────────────────────
   1 │ missing 1
   2 │ missing x
   3 │ missing 3

julia> df2 = df |> polish_names |> compact_columns! |> reinfer_schema! |> DataFrame
3×1 DataFrame
 Row │ another_weird_name
     │ Union…
─────┼────────────────────
   1 │ 1
   2 │ x
   3 │ 3

julia> df3 = add_index(df)
┌───────────┬────────────────┬─────────────────────┐
│ row_index │ Some bad Name │ Another_weird name │
│ Int64 │ Missing │ Any │
├───────────┼────────────────┼─────────────────────┤
│ 1 │ missing │ 1 │
│ 2 │ missing │ x │
│ 3 │ missing │ 3 │
└───────────┴────────────────┴─────────────────────┘

julia> compare_table_columns(df, df2, df3)
┌─────────────────────┬─────────┬──────────────────────┬─────────┐
│ column_name │ tbl1 │ tbl2 │ tbl3 │
│ Symbol │ Type │ Type │ Type │
├─────────────────────┼─────────┼──────────────────────┼─────────┤
│ Some bad Name │ Missing │ Nothing │ Missing │
│ Another_weird name │ Any │ Nothing │ Any │
│ another_weird_name │ Nothing │ Union{Int64, String} │ Nothing │
│ row_index │ Nothing │ Nothing │ Int64 │
└─────────────────────┴─────────┴──────────────────────┴─────────┘

```

If you just want to use a few Cleaner transformations and keep the original table type, we also offer the ROT function variants.

```julia-auto
julia> add_index_ROT(df)
3×3 DataFrame
 Row │ row_index Some bad Name Another_weird name
     │ Int64 Missing Any
─────┼────────────────────────────────────────────────
   1 │ 1 missing 1
   2 │ 2 missing x
   3 │ 3 missing 3

```

For more examples and a comprehensive guide about using [Cleaner.jl](https://github.com/TheRoniOne/Cleaner.jl), feel free to refer to the [current stable documentation](https://theronione.github.io/Cleaner.jl/stable/).

---

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [February 6, 2022, 11:54pm UTC](https://discourse.julialang.org/t/ann-cleaner-jl-a-toolbox-of-simple-solutions-for-common-data-cleaning-problems-v1-0/75902/2 "2022-02-06T23:54:42Z")

</div>

Nice one. [DataConvenience.jl](https://github.com/xiaodaigh/DataConvenience.jl) has some complimentary functions too. It also has a `cleannames!` function inspired by janitor
