Rename dataframe describe to summary so that the normal describe isn't overloaded (#7176)

This closes #6770.
This commit is contained in:
Leon 2022-11-24 02:58:28 +10:00 committed by GitHub
parent ed7aea8dd3
commit bdca31cc2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -1,6 +1,5 @@
mod append;
mod columns;
mod describe;
mod drop;
mod drop_duplicates;
mod drop_nulls;
@ -20,6 +19,7 @@ mod shape;
mod slice;
mod sql_context;
mod sql_expr;
mod summary;
mod take;
mod to_arrow;
mod to_csv;
@ -32,7 +32,6 @@ use nu_protocol::engine::StateWorkingSet;
pub use append::AppendDF;
pub use columns::ColumnsDF;
pub use describe::DescribeDF;
pub use drop::DropDF;
pub use drop_duplicates::DropDuplicates;
pub use drop_nulls::DropNulls;
@ -52,6 +51,7 @@ pub use shape::ShapeDF;
pub use slice::SliceDF;
pub use sql_context::SQLContext;
pub use sql_expr::parse_sql_expr;
pub use summary::Summary;
pub use take::TakeDF;
pub use to_arrow::ToArrow;
pub use to_csv::ToCSV;
@ -75,7 +75,7 @@ pub fn add_eager_decls(working_set: &mut StateWorkingSet) {
AppendDF,
ColumnsDF,
DataTypes,
DescribeDF,
Summary,
DropDF,
DropDuplicates,
DropNulls,

View File

@ -15,15 +15,15 @@ use polars::{
};
#[derive(Clone)]
pub struct DescribeDF;
pub struct Summary;
impl Command for DescribeDF {
impl Command for Summary {
fn name(&self) -> &str {
"describe"
"summary"
}
fn usage(&self) -> &str {
"Describes dataframes numeric columns"
"For a dataframe, produces descriptive statistics (summary statistics) for its numeric columns."
}
fn signature(&self) -> Signature {
@ -34,15 +34,15 @@ impl Command for DescribeDF {
.named(
"quantiles",
SyntaxShape::Table,
"optional quantiles for describe",
"provide optional quantiles",
Some('q'),
)
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "dataframe description",
example: "[[a b]; [1 1] [1 1]] | into df | describe",
description: "list dataframe descriptives",
example: "[[a b]; [1 1] [1 1]] | into df | summary",
result: Some(
NuDataFrame::try_from_columns(vec![
Column::new(
@ -266,6 +266,6 @@ mod test {
#[test]
fn test_examples() {
test_dataframe(vec![Box::new(DescribeDF {})])
test_dataframe(vec![Box::new(Summary {})])
}
}