Crates.io | dfsql |
lib.rs | dfsql |
version | |
source | src |
created_at | 2023-12-05 00:43:01.377803 |
updated_at | 2024-11-02 19:53:06.768322 |
description | SQL REPL for Data Frames |
homepage | |
repository | https://github.com/Banyc/dfsql |
max_upload_size | |
id | 1058235 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
dfsql
count
command is replaced with len
, so make sure to replace (count)
and col "count"
with len
and col "len"
respectively.
count <col>
command is unaffected.cargo install dfsql
dfsql --input your.csv --output a-new.csv
# ...or
dfsql -i your.csv -o a-new.csv
exit
/quit
: exit the REPL loop.
exit
undo
: undo the previous successful operation.
undo
reset
: reset all the changes and go back to the original data frame.
reset
schema
: show column names and types of the data frame.
schema
save
: save the current data frame to a file.
save a-new.csv
select
select <expr>*
select last_name first_name
group (<col> | <var>)* agg <expr>*
group first_name agg (count)
filter
filter <expr>
filter first_name = "John"
limit
limit <int>
limit 5
reverse
reverse
sort
sort ((asc | desc | ()) <col>)*
sort icpsr_id
use
use <var>
use other
other
.(left | right | inner | full) join <var> on <col> <col>?
left join other on id ID
other
on my column id
and its column ID
col
: reference to a column.
col : (<str> | <var>) -> <expr>
select col first_name
exclude
: remove columns from the data frame.
exclude : <expr>* -> <expr>
select exclude last_name first_name
42
, "John"
, 1.0
, and null
.select a * b
select -a
select sum a
alias
: assign a name to a column.
alias : (<col> | <var>) <expr> -> <expr>
select alias product a * b
<conditional> : if <expr> then <expr> (if <expr> then <expr>)* otherwise <expr> -> <expr>
select if class = 0 then "A" if class = 1 then "B" else null
cast
: cast a column to either type str
, int
, or float
.
cast : <type> <expr> -> <expr>
select cast str id
str
and collect the result.