Home Explore Blog CI



nushell

3rd chunk of `blog/2019-11-26-nushell-0_6_0.md`
e4036131ba17acd9bafbf9d857ae8da2b6615b73a9ceab1e00000001000016be
Contributor est31 did a ton of work soon after our first Nu release, but it wasn't until just recently that it fully paid off. With the Rust 1.39 release, Nu now fully works on stable Rust! We're excited for what this means for package authors, as they will now have a stable dependency they can use to build Nu from, rather than tracking nightly.

# New website! New blog! (sebastian-xyz)

We're starting to work on an actual website, complete with a blog. In fact, where you're seeing this now is on our new site. We're excited to finally have something more official, and looking forward to growing the website in the weeks to come.

If you're a web developer or designer and you want to help out, please join us! You can find us on the [website repo](https://github.com/nushell/nushell.github.io) and [blog repo](https://github.com/nushell/blog).

# New features

## histogram (andrasio)

As we extend Nu's ability to function as a shell, we also wanted to include some features that help with doing some data analysis on structured data you're working with. In this release is a new `histogram` feature which gives a quick histogram of the data you're looking at:

```shell
> open tests/fixtures/formats/caco3_plastics.csv | histogram origin
━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 # │ origin   │ frequency
───┼──────────┼─────────────────────────────────────────────────────────────────────────────────────────────────
 0 │ COLOMBIA │ ***********************************************************************************************
   │          │ *****
 1 │ SPAIN    │ ************************************************************
 2 │ TURKEY   │ ********************
━━━┷━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```

## split-by (andrasio)

When working with tables inside of tables, it's sometimes helpful to be able to group and regroup data so that the end result can be easily processed or charted. With this release, we've add a new command: `split-by`. Split-by is similar to `group-by`, in a way you can think of it as a re-group as it will create new groups to wrap your existing groups.

To see how this works, let's say we have some shipping data, and we want to group these by the region:

```shell
> open tests/fixtures/formats/caco3_plastics.csv | group-by origin

━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━
 SPAIN          │ COLOMBIA       │ TURKEY
────────────────┼────────────────┼────────────────
 [table 3 rows] │ [table 5 rows] │ [table 1 rows]
━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━
```

Next, let's say we know that inside of these new columns is a table that has a column called `shipped_at`. What we want to do is to `group-by` again, but this time use that new column to create new groups:

```shell
/home/sophia/Source/nushell(better_duration)> open tests/fixtures/formats/caco3_plastics.csv | group-by origin | split-by shipped_at
━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━
 18/03/2016  │ 27/07/2016  │ 24/06/2016  │ 07/07/2016     │ 01/01/1900     │ 01/11/2016     │ 04/10/2016
─────────────┼─────────────┼─────────────┼────────────────┼────────────────┼────────────────┼──────────────
 [row SPAIN] │ [row SPAIN] │ [row SPAIN] │ [row COLOMBIA] │ [row COLOMBIA] │ [row COLOMBIA] │ [row TURKEY]
━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━
```

What we have as a result is a kind of (row, column) grouping of the table data, which would allow you to graph for each date on one axis, and for each origin on the other.

## default and compact (andrasio)

One of the sticky issues working with tables is that sometimes you'll have gaps in the data. Perhaps there just isn't a value for that row.

To help with that, we've added two new commands: `default` and `compact`.

Default, as the name implies, will allow you to give blank spots a default value. Compact instead will allow you to remove a row if there's a blank in that position.

Title: Nushell 0.6.0: New Features - Histogram, Split-by, Default and Compact
Summary
Nushell 0.6.0 introduces several new features aimed at enhancing data analysis and table manipulation. The `histogram` command provides a quick visualization of data frequency. The `split-by` command allows for regrouping data within tables, similar to `group-by`, but with the ability to create new groups based on existing ones. Additionally, `default` and `compact` commands are added to handle missing data in tables, allowing users to either assign default values or remove rows with blank entries, respectively.