@@ -486,10 +486,10 @@ worth keeping in memory while you explore your dataset.
486486
487487It is also possible to construct dataframes from basic Nushell primitives, such
488488as integers, decimals, or strings. Let' s create a small dataframe using the
489- command `to- df`.
489+ command `into df`.
490490
491491```shell
492- > let a = ([[a b]; [1 2] [3 4] [5 6]] | to- df)
492+ > let a = ([[a b]; [1 2] [3 4] [5 6]] | into df)
493493> $a
494494
495495───┬───┬───
@@ -547,7 +547,7 @@ format](https://arrow.apache.org/docs/format/Columnar.html)). The other
547547optimization trick is the fact that whenever possible, the columns from the
548548dataframes are shared between dataframes, avoiding memory duplication for the
549549same data. This means that dataframes `$a` and `$a2` are sharing the same two
550- columns we created using the `to- df` command. For this reason, it isn' t
550+ columns we created using the `into df` command. For this reason, it isn' t
551551possible to change the value of a column in a dataframe. However, you can
552552create new columns based on data from other columns or dataframes.
553553
@@ -557,11 +557,11 @@ A `Series` is the building block of a `DataFrame`. Each Series represents a
557557column with the same data type, and we can create multiple Series of different
558558types, such as float, int or string.
559559
560- Let' s start our exploration with Series by creating one using the `to- df`
560+ Let' s start our exploration with Series by creating one using the `into df`
561561command:
562562
563563```shell
564- > let new = ([9 8 4] | to- df)
564+ > let new = ([9 8 4] | into df)
565565> $new
566566
567567───┬───
@@ -714,7 +714,7 @@ Now we have a new dataframe with only the values where the mask was true.
714714The masks can also be created from Nushell lists, for example:
715715
716716```shell
717- > let mask1 = ([true true false] | to- df)
717+ > let mask1 = ([true true false] | into df)
718718> $new_df | filter-with $mask1
719719
720720───┬───┬───┬─────────┬────────
@@ -757,7 +757,7 @@ We can also create a mask by checking if some values exist in other Series.
757757Using the first dataframe that we created we can do something like this
758758
759759```shell
760- > let mask3 = ($df.first | is-in ([b c] | to- df))
760+ > let mask3 = ($df.first | is-in ([b c] | into df))
761761
762762───┬──────
763763 # │ first
@@ -824,7 +824,7 @@ from our original dataframe. With that in mind, we can use the next command to
824824extract that information
825825
826826` ` ` shell
827- > let indices = ([1 4 6] | to- df)
827+ > let indices = ([1 4 6] | into df)
828828> $df | take $indices
829829
830830───┬───────┬───────┬─────────┬─────────┬───────┬────────┬───────┬────────
@@ -886,7 +886,7 @@ And finally, we can create new Series by setting a new value in the marked
886886indices. Have a look at the next command
887887
888888```shell
889- > let indices = ([0 2] | to- df);
889+ > let indices = ([0 2] | into df);
890890> $df.int_1 | set-with-idx 123 --indices $indices
891891
892892───┬───────
@@ -991,7 +991,7 @@ operations.
991991Let' s create a small example of a lazy dataframe
992992
993993` ` ` shell
994- > let a = ([[a b]; [1 a] [2 b] [3 c] [4 d]] | to- lazy)
994+ > let a = ([[a b]; [1 a] [2 b] [3 c] [4 d]] | into lazy)
995995> $a
996996────────────────┬────────────────────────────────────────────────
997997 plan │ DATAFRAME(in-memory): [" a" , " b" ];
@@ -1088,7 +1088,7 @@ Let's try something more complicated and create aggregations from a lazy
10881088dataframe
10891089
10901090```shell
1091- > let a = ( [[name value]; [one 1 ] [two 2 ] [one 1 ] [two 3 ]] | to - lazy )
1091+ > let a = ( [[name value]; [one 1 ] [two 2 ] [one 1 ] [two 3 ]] | into lazy )
10921092> $a
10931093::: | group-by name
10941094::: | agg [
@@ -1108,7 +1108,7 @@ And we could join on a lazy dataframe that hasn't being collected. Let's join
11081108the resulting group by to the original lazy frame
11091109
11101110```shell
1111- > let a = ( [[name value]; [one 1 ] [two 2 ] [one 1 ] [two 3 ]] | to - lazy )
1111+ > let a = ( [[name value]; [one 1 ] [two 2 ] [one 1 ] [two 3 ]] | into lazy )
11121112> let group = ($a
11131113::: | group-by name
11141114::: | agg [
@@ -1181,10 +1181,10 @@ whenever possible, their analogous Nushell command.
11811181| slice | DataFrame | Creates new dataframe from a slice of rows | |
11821182| sort-by | DataFrame, Series | Creates new sorted dataframe or series | sort |
11831183| take | DataFrame, Series | Creates new dataframe using the given indices | |
1184- | to- csv | DataFrame | Saves dataframe to csv file | to csv |
1185- | to-df | | Converts a pipelined Table or List into Dataframe | |
1186- | to- dummies | DataFrame | Creates a new dataframe with dummy variables | |
1187- | to- parquet | DataFrame | Saves dataframe to parquet file | |
1184+ | to csv | DataFrame | Saves dataframe to csv file | to csv |
1185+ | into df | | Converts a pipelined Table or List into Dataframe | |
1186+ | dummies | DataFrame | Creates a new dataframe with dummy variables | |
1187+ | to parquet | DataFrame | Saves dataframe to parquet file | |
11881188| unique | Series | Returns unique values from a series | uniq |
11891189| value-counts | Series | Returns a dataframe with the counts for unique values in series | |
11901190| where | DataFrame | Filter dataframe to match the condition | where |
0 commit comments