diff --git a/__init__.py b/__init__.py index b9c0e72..9ca7431 100644 --- a/__init__.py +++ b/__init__.py @@ -133,6 +133,7 @@ from .modules.pytorch_wrapper.pt_to_latent import PtToLatent from .modules.pytorch_wrapper.pt_to_numpy import PtToNumpy from .modules.pytorch_wrapper.pt_to_rgb_tensors import PtToRgbTensors from .modules.seaborn_wrapper.sns_bar import SNSBar +from .modules.seaborn_wrapper.sns_boxplot import SNSBoxplot from .modules.seaborn_wrapper.sns_histogram import SNSHistogram from .modules.seaborn_wrapper.sns_line import SNSLine from .modules.seaborn_wrapper.sns_scatter import SNSScatter @@ -278,6 +279,7 @@ NODE_CLASS_MAPPINGS: Dict[str, Type[T]] = { "PyKvIntCreate": PyKvIntCreate, "PyKvStringCreate": PyKvStringCreate, "SNSBar": SNSBar, + "SNSBoxplot": SNSBoxplot, "SNSHistogram": SNSHistogram, "SNSLine": SNSLine, "SNSScatter": SNSScatter, @@ -423,6 +425,7 @@ NODE_DISPLAY_NAME_MAPPINGS: Dict[str, str] = { "PyKvIntCreate": "Py Kv Int Create", "PyKvStringCreate": "Py Kv String Create", "SNSBar": "SNS Bar Chart", + "SNSBoxplot": "SNS Boxplot", "SNSHistogram": "SNS Histogram", "SNSLine": "SNS Line Plot", "SNSScatter": "SNS Scatter Plot", diff --git a/docs/images/boxplot.png b/docs/images/boxplot.png new file mode 100644 index 0000000..b7edbc4 Binary files /dev/null and b/docs/images/boxplot.png differ diff --git a/docs/reference/node_reference.md b/docs/reference/node_reference.md index 8ebaa65..5f249d2 100644 --- a/docs/reference/node_reference.md +++ b/docs/reference/node_reference.md @@ -136,6 +136,7 @@ | [MPL Line Plot](mpl_line.md) | Generates a line plot from a pandas DataFrame. | | [MPL Scatter Plot](mpl_scatter.md) | Generates a scatter plot from a pandas DataFrame. | | [SNS Bar Chart](sns_bar.md) | Generates a bar chart from a Pandas DataFrame using Seaborn. | +| [SNS Boxplot](sns_boxplot.md) | Generates a boxplot from a Pandas DataFrame using Seaborn. | | [SNS Histogram](sns_histogram.md) | Generates a histogram from a Pandas DataFrame using Seaborn. | | [SNS Line Plot](sns_line.md) | Generates a line plot from a pandas DataFrame using Seaborn. | | [SNS Scatter Plot](sns_scatter.md) | Generates a scatter plot from a pandas DataFrame using Seaborn. | diff --git a/docs/reference/sns_boxplot.md b/docs/reference/sns_boxplot.md new file mode 100644 index 0000000..f6a1191 --- /dev/null +++ b/docs/reference/sns_boxplot.md @@ -0,0 +1,44 @@ +# SNS Boxplot +Generates a boxplot from a Pandas DataFrame using Seaborn. + +You can generate a boxplot from either a single column or two columns. +* For two columns, the first column should contain the category, and the second column should contain the corresponding numerical values. +* For a wide-format table, use the Pandas Melt node to create a category column first. This column is referred to as the "variable" column in melting. +* For a single-column dataset, leave the category field blank. + +For example, if you have a DataFrame tracking apple and banana prices at various stores: +``` + Fruit Price + apple 5 + apple 3 + apple 2 + appel 2.5 + banana 4 + banana 2 + banana 2 +``` +If you specify `Fruit` as the category and `Price` as the value, two boxplots will be generated: one for apples and one for bananas. + + + +Refer to [Seaborn documentation](https://seaborn.pydata.org/generated/seaborn.boxplot.html) for more information. + +## Input +| Name | Data type | +|---|---| +| dataframe | DataFrame | +| category_column_name | String | +| value_column_name | String | +| title | String | +| style | String | +| palette | String | + +## Output +| Data type | +|---| +| Image | + +