├── tests ├── __init__.py ├── cda │ ├── __init__.py │ ├── py_kev_int_create_test.py │ ├── py_kev_float_create_test.py │ ├── py_kev_string_create_test.py │ ├── py_string_to_int_test.py │ ├── py_int_to_string_test.py │ ├── py_float_to_string_test.py │ ├── py_list_to_string_test.py │ ├── py_string_to_float_test.py │ ├── utils_str_to_number_test.py │ ├── utils_str_to_number_with_default_test.py │ └── py_string_to_datetime_test.py ├── numpy_wrapper │ └── __init__.py └── pandas_wrapper │ ├── __init__.py │ ├── pandas_iloc_rows_slice_dataframe_test.py │ └── pandas_excel_file_sheet_names_test.py ├── modules ├── pandas_wrapper │ ├── __init__.py │ ├── pandas_transpose.py │ ├── pandas_cov.py │ ├── pandas_drop_duplicates.py │ ├── pandas_mode.py │ ├── pandas_index_to_string.py │ ├── pandas_dropna.py │ ├── pandas_max.py │ ├── pandas_mean.py │ ├── pandas_min.py │ ├── pandas_sum.py │ ├── pandas_isna.py │ ├── pandas_median.py │ ├── pandas_var.py │ ├── pandas_std.py │ ├── pandas_columns.py │ ├── pandas_count.py │ ├── pandas_index.py │ ├── pandas_to_string.py │ ├── pandas_summary.py │ ├── pandas_series_to_string.py │ ├── pandas_corr.py │ ├── pandas_as_string.py │ ├── pandas_to_numpy.py │ ├── pandas_create.py │ ├── pandas_as_float.py │ ├── pandas_as_int.py │ ├── pandas_exp.py │ ├── pandas_add_scalar_int.py │ ├── pandas_mul.py │ ├── pandas_load_csv.py │ ├── pandas_log.py │ ├── pandas_div.py │ ├── pandas_head.py │ ├── pandas_sub_scalar_int.py │ ├── pandas_vertical_concat.py │ ├── pandas_div_scalar_int.py │ ├── pandas_add_scalar_float.py │ ├── pandas_create_from_numpy.py │ ├── pandas_sub.py │ ├── pandas_pow_scalar_int.py │ └── pandas_create_from_tensor.py ├── matplotlib │ └── common.py └── cda │ ├── py_list_to_string.py │ ├── py_string_to_int.py │ ├── py_string_to_float.py │ ├── py_int_to_string.py │ ├── py_float_to_string.py │ ├── cda_int_create.py │ ├── cda_float_create.py │ ├── cda_text_create.py │ ├── cda_string_create.py │ ├── py_string_to_list.py │ ├── py_string_to_dict.py │ ├── py_kv_string_create.py │ ├── py_kv_int_create.py │ ├── py_kv_float_create.py │ └── cda_json_create.py ├── examples └── datasets │ ├── car_sales.csv │ ├── 0.html │ ├── test_file.xlsx │ ├── 1.html │ ├── 2.html │ ├── actor.csv │ └── movie.csv ├── docs ├── images │ ├── isna.png │ ├── load.jpg │ ├── melt.png │ ├── pivot.png │ ├── plots.png │ ├── sort.jpg │ ├── batting.png │ ├── boxplot.png │ ├── concat.png │ ├── create.png │ ├── sns_line.png │ ├── subset.jpg │ ├── summary.png │ ├── group_by1.png │ ├── group_by2.png │ ├── group_by3.png │ ├── inner_join.png │ ├── left_join.png │ ├── multiindex.png │ ├── outer_join.png │ ├── pie_chart.png │ ├── right_join.png │ ├── set_index1.png │ ├── set_index2.png │ ├── batting_head.png │ ├── batting_sort.png │ ├── blank_canvas.png │ ├── columns_index.png │ ├── loc_cell_str.png │ ├── search_nodes1.png │ ├── search_nodes2.png │ ├── baseball_final.png │ ├── baseball_join1.png │ ├── baseball_join2.png │ ├── baseball_join3.png │ ├── baseball_join4.png │ ├── baseball_join5.png │ ├── frequency_table.png │ ├── iloc_row_series.png │ ├── join_data_load.png │ ├── loc_row_series.png │ ├── people_columns.png │ ├── baseball_question.jpg │ ├── iloc_rows_dataframe.png │ ├── pandas_feature_split.png │ ├── batting_select_columns.png │ ├── load_csv_show_dataframe.png │ ├── load_csv_with_encoding.png │ ├── load_csv_with_encoding2.png │ ├── people_select_columns.png │ ├── red_pixel_distribution.png │ ├── load_csv_show_dataframe2.png │ └── load_csv_show_dataframe3.jpg └── reference │ ├── mpl_bar.md │ ├── mpl_line.md │ ├── mpl_scatter.md │ ├── sns_bar_pt.md │ ├── sns_histogram_pt.md │ ├── numpy_show.md │ ├── pandas_show_text.md │ ├── cda_show_int.md │ ├── py_string_to_int.md │ ├── pandas_load_csv.md │ ├── pandas_load_json.md │ ├── pandas_show_index.md │ ├── pandas_transpose.md │ ├── cda_int_create.md │ ├── cda_show_float.md │ ├── pandas_max.md │ ├── pandas_mean.md │ ├── pandas_min.md │ ├── pandas_show_series.md │ ├── pandas_sum.md │ ├── py_string_to_float.md │ ├── pandas_count.md │ ├── pandas_cov.md │ ├── pandas_isna.md │ ├── pandas_median.md │ ├── pandas_mode.md │ ├── pandas_var.md │ ├── py_int_to_string.md │ ├── cda_float_create.md │ ├── pandas_create.md │ ├── pandas_dropna.md │ ├── pandas_show_dataframe.md │ ├── py_float_to_string.md │ ├── py_list_to_string.md │ ├── sns_bar.md │ ├── cda_json_create.md │ ├── pandas_create_from_numpy.md │ ├── pandas_create_from_tensor.md │ ├── pandas_std.md │ ├── pandas_summary.md │ ├── pandas_to_numpy.md │ ├── cda_text_create.md │ ├── pandas_columns.md │ ├── pandas_create_series_from_list.md │ ├── pandas_index.md │ ├── pandas_index_to_string.md │ ├── pandas_save_csv.md │ ├── pandas_save_json.md │ ├── pandas_to_string.md │ ├── sns_scatter.md │ ├── cda_string_create.md │ ├── pandas_add.md │ ├── pandas_as_int.md │ ├── pandas_create_series_from_dict.md │ ├── pandas_drop_duplicates.md │ ├── pandas_series_to_string.md │ ├── pandas_skew.md │ ├── pandas_as_float.md │ ├── pandas_as_string.md │ ├── pandas_mul.md │ ├── pandas_pow.md │ ├── pandas_cos.md │ ├── pandas_sin.md │ ├── py_string_to_list.md │ ├── numpy_int_create.md │ ├── pandas_exp.md │ ├── pandas_head.md │ ├── pandas_tan.md │ ├── py_string_to_dict.md │ ├── pandas_add_scalar_int.md │ ├── pandas_cummax.md │ ├── pandas_cumsum.md │ ├── pandas_div.md │ ├── py_kv_int_create.md │ ├── pandas_add_series.md │ ├── pandas_cummin.md │ ├── pandas_cumprod.md │ ├── pandas_div_scalar_int.md │ ├── pandas_div_series.md │ ├── pandas_load_csv_with_encoding.md │ ├── pandas_log.md │ ├── pandas_sub.md │ ├── py_kv_float_create.md │ ├── pandas_mul_series.md │ ├── pandas_sub_scalar_int.md │ ├── pandas_sub_series.md │ ├── py_kv_string_create.md │ ├── sns_heatmap.md │ ├── numpy_float_create.md │ ├── pandas_pow_scalar_int.md │ ├── pandas_pow_series.md │ ├── pandas_mul_scalar_int.md │ ├── pandas_select_columns.md │ ├── pandas_sort.md │ ├── pandas_vertical_concat.md │ ├── pandas_add_scalar_float.md │ ├── pandas_div_scalar_float.md │ ├── pandas_fillna_scalar_int.md │ ├── pandas_mul_scalar_float.md │ ├── pandas_sub_scalar_float.md │ ├── pandas_eq_scalar_int.md │ ├── pandas_group_by.md │ ├── pandas_lt_scalar_int.md │ ├── pandas_series_to_dataframe.md │ ├── pandas_corr.md │ ├── pandas_gt_scalar_int.md │ ├── pandas_load_csv_with_index.md │ ├── pandas_ne_scalar_int.md │ ├── pandas_pow_scalar_float.md │ ├── sns_histogram.md │ ├── pandas_create_from_dict.md │ ├── pandas_eq_scalar_float.md │ ├── pandas_gt_scalar_float.md │ ├── pandas_lt_scalar_float.md │ ├── pandas_ne_scalar_float.md │ ├── pandas_select_column_as_series.md │ ├── pandas_create_with_index.md │ ├── pandas_ge_scalar_int.md │ ├── pandas_le_scalar_int.md │ ├── pandas_boolean_index.md │ ├── pandas_create_series_from_list_index_list.md │ ├── pandas_le_scalar_float.md │ ├── pandas_loc_row_series.md │ ├── pandas_vertical_split.md │ ├── pandas_ge_scalar_float.md │ ├── numpy_squeeze.md │ ├── pandas_horizontal_split.md │ ├── pandas_iat_int.md │ ├── pandas_iat_float.md │ ├── pandas_iat_string.md │ ├── pandas_join.md │ ├── pandas_eq.md │ ├── pandas_lt.md │ ├── sns_line_pt.md │ ├── pandas_gt.md │ ├── pandas_ne.md │ ├── pandas_select_rows.md │ ├── pandas_crosstab.md │ ├── pandas_le.md │ ├── pandas_ge.md │ ├── sns_scatter_pt.md │ ├── pandas_value_counts.md │ ├── pandas_at_int.md │ ├── pandas_iat_datetime.md │ ├── pandas_at_string.md │ ├── pandas_at_float.md │ ├── pandas_iloc_rows_dataframe.md │ ├── pandas_loc_cell_string.md │ ├── pandas_iat_set_int.md │ ├── pandas_at_datetime.md │ ├── pandas_iat_set_string.md │ ├── pandas_iat_set_float.md │ ├── pandas_horizontal_concat.md │ ├── pandas_iat_set_datetime.md │ ├── py_string_to_datetime.md │ ├── sns_pairplot.md │ ├── pandas_at_set_int.md │ ├── pandas_replace.md │ ├── py_datetime_to_string.md │ ├── mpl_pie_chart.md │ ├── pandas_at_set_float.md │ ├── pandas_at_set_string.md │ ├── pandas_at_set_datetime.md │ ├── pandas_create_from_dict_index_list.md │ ├── pandas_load_excel.md │ ├── pandas_iloc_rows_slice_dataframe.md │ ├── pandas_kurtosis.md │ ├── pandas_strftime.md │ ├── pandas_rename_advanced.md │ ├── pandas_replace_advanced.md │ ├── pandas_feature_split_to_pt.md │ ├── pandas_rename.md │ ├── pandas_iloc_row_series.md │ ├── pandas_fillna_scalar_float.md │ ├── pandas_to_datetime.md │ ├── pandas_create_from_multiple_dict.md │ ├── pandas_load_html.md │ ├── pandas_feature_split_to_numpy.md │ ├── pandas_excel_file_sheet_names.md │ ├── pandas_loc_row_multiindex_dataframe.md │ ├── pandas_set_index.md │ └── sns_line.md ├── .gitignore ├── requirements.txt ├── dev └── scripts │ └── run_tests.sh ├── pyproject.toml ├── .github └── workflows │ └── publish.yml └── web └── js ├── SaveCSV.js └── SaveJSON.js /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/cda/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/numpy_wrapper/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/pandas_wrapper/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/datasets/car_sales.csv: -------------------------------------------------------------------------------- 1 | Index,Name,Sales 2 | A,Foo,10000 3 | B,Bar,20000 4 | C,Baz,30000 5 | -------------------------------------------------------------------------------- /docs/images/isna.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/isna.png -------------------------------------------------------------------------------- /docs/images/load.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/load.jpg -------------------------------------------------------------------------------- /docs/images/melt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/melt.png -------------------------------------------------------------------------------- /docs/images/pivot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/pivot.png -------------------------------------------------------------------------------- /docs/images/plots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/plots.png -------------------------------------------------------------------------------- /docs/images/sort.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/sort.jpg -------------------------------------------------------------------------------- /docs/images/batting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/batting.png -------------------------------------------------------------------------------- /docs/images/boxplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/boxplot.png -------------------------------------------------------------------------------- /docs/images/concat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/concat.png -------------------------------------------------------------------------------- /docs/images/create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/create.png -------------------------------------------------------------------------------- /docs/images/sns_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/sns_line.png -------------------------------------------------------------------------------- /docs/images/subset.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/subset.jpg -------------------------------------------------------------------------------- /docs/images/summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/summary.png -------------------------------------------------------------------------------- /docs/images/group_by1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/group_by1.png -------------------------------------------------------------------------------- /docs/images/group_by2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/group_by2.png -------------------------------------------------------------------------------- /docs/images/group_by3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/group_by3.png -------------------------------------------------------------------------------- /docs/images/inner_join.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/inner_join.png -------------------------------------------------------------------------------- /docs/images/left_join.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/left_join.png -------------------------------------------------------------------------------- /docs/images/multiindex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/multiindex.png -------------------------------------------------------------------------------- /docs/images/outer_join.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/outer_join.png -------------------------------------------------------------------------------- /docs/images/pie_chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/pie_chart.png -------------------------------------------------------------------------------- /docs/images/right_join.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/right_join.png -------------------------------------------------------------------------------- /docs/images/set_index1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/set_index1.png -------------------------------------------------------------------------------- /docs/images/set_index2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/set_index2.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | **/__pycache__/ 3 | models/ 4 | *.pth 5 | /datasets/ 6 | !*/foo/ 7 | examples/datasets/.~lock* -------------------------------------------------------------------------------- /docs/images/batting_head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/batting_head.png -------------------------------------------------------------------------------- /docs/images/batting_sort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/batting_sort.png -------------------------------------------------------------------------------- /docs/images/blank_canvas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/blank_canvas.png -------------------------------------------------------------------------------- /docs/images/columns_index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/columns_index.png -------------------------------------------------------------------------------- /docs/images/loc_cell_str.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/loc_cell_str.png -------------------------------------------------------------------------------- /docs/images/search_nodes1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/search_nodes1.png -------------------------------------------------------------------------------- /docs/images/search_nodes2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/search_nodes2.png -------------------------------------------------------------------------------- /examples/datasets/0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Empty HTML 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/images/baseball_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/baseball_final.png -------------------------------------------------------------------------------- /docs/images/baseball_join1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/baseball_join1.png -------------------------------------------------------------------------------- /docs/images/baseball_join2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/baseball_join2.png -------------------------------------------------------------------------------- /docs/images/baseball_join3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/baseball_join3.png -------------------------------------------------------------------------------- /docs/images/baseball_join4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/baseball_join4.png -------------------------------------------------------------------------------- /docs/images/baseball_join5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/baseball_join5.png -------------------------------------------------------------------------------- /docs/images/frequency_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/frequency_table.png -------------------------------------------------------------------------------- /docs/images/iloc_row_series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/iloc_row_series.png -------------------------------------------------------------------------------- /docs/images/join_data_load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/join_data_load.png -------------------------------------------------------------------------------- /docs/images/loc_row_series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/loc_row_series.png -------------------------------------------------------------------------------- /docs/images/people_columns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/people_columns.png -------------------------------------------------------------------------------- /docs/images/baseball_question.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/baseball_question.jpg -------------------------------------------------------------------------------- /examples/datasets/test_file.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/examples/datasets/test_file.xlsx -------------------------------------------------------------------------------- /docs/images/iloc_rows_dataframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/iloc_rows_dataframe.png -------------------------------------------------------------------------------- /docs/images/pandas_feature_split.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/pandas_feature_split.png -------------------------------------------------------------------------------- /docs/images/batting_select_columns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/batting_select_columns.png -------------------------------------------------------------------------------- /docs/images/load_csv_show_dataframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/load_csv_show_dataframe.png -------------------------------------------------------------------------------- /docs/images/load_csv_with_encoding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/load_csv_with_encoding.png -------------------------------------------------------------------------------- /docs/images/load_csv_with_encoding2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/load_csv_with_encoding2.png -------------------------------------------------------------------------------- /docs/images/people_select_columns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/people_select_columns.png -------------------------------------------------------------------------------- /docs/images/red_pixel_distribution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/red_pixel_distribution.png -------------------------------------------------------------------------------- /docs/images/load_csv_show_dataframe2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/load_csv_show_dataframe2.png -------------------------------------------------------------------------------- /docs/images/load_csv_show_dataframe3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowToSD/ComfyUI-Data-Analysis/HEAD/docs/images/load_csv_show_dataframe3.jpg -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | matplotlib>=3.10.0 2 | pandas>=2.2.3 3 | seaborn>=0.13.2 4 | scipy>=1.14.1 5 | scikit-learn>=1.6.1 6 | openpyxl>=3.1.5 7 | lxml>=5.4.0 -------------------------------------------------------------------------------- /examples/datasets/1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
AB
110
220
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/reference/mpl_bar.md: -------------------------------------------------------------------------------- 1 | # MPL Bar Chart 2 | Generates a bar chart from a Pandas DataFrame. 3 | 4 | ## Output 5 | | Data type | 6 | |---| 7 | | Image | 8 | 9 |
10 | Category: Plot 11 | 12 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 13 | -------------------------------------------------------------------------------- /docs/reference/mpl_line.md: -------------------------------------------------------------------------------- 1 | # MPL Line Plot 2 | Generates a line plot from a pandas DataFrame. 3 | 4 | ## Output 5 | | Data type | 6 | |---| 7 | | Image | 8 | 9 |
10 | Category: Plot 11 | 12 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 13 | -------------------------------------------------------------------------------- /docs/reference/mpl_scatter.md: -------------------------------------------------------------------------------- 1 | # MPL Scatter Plot 2 | Generates a scatter plot from a pandas DataFrame. 3 | 4 | ## Output 5 | | Data type | 6 | |---| 7 | | Image | 8 | 9 |
10 | Category: Plot 11 | 12 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 13 | -------------------------------------------------------------------------------- /docs/reference/sns_bar_pt.md: -------------------------------------------------------------------------------- 1 | # SNS Bar Chart Pt 2 | Generates a bar chart from a PyTorch tensor using Seaborn. 3 | 4 | ## Output 5 | | Data type | 6 | |---| 7 | | Image | 8 | 9 |
10 | Category: Plot 11 | 12 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 13 | -------------------------------------------------------------------------------- /docs/reference/sns_histogram_pt.md: -------------------------------------------------------------------------------- 1 | # SNS Histogram Pt 2 | Generates a histogram from a PyTorch tensor using Seaborn. 3 | 4 | ## Output 5 | | Data type | 6 | |---| 7 | | Image | 8 | 9 |
10 | Category: Plot 11 | 12 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 13 | -------------------------------------------------------------------------------- /docs/reference/numpy_show.md: -------------------------------------------------------------------------------- 1 | # Numpy Show 2 | Displays a Numpy ndarray as text. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | ndarray | Ndarray | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Numpy 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_show_text.md: -------------------------------------------------------------------------------- 1 | # Pandas Show Text 2 | Displays a string. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | text | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Display data 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/cda_show_int.md: -------------------------------------------------------------------------------- 1 | # CDA Show Int 2 | Displays a Pandas Int as text. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | int_scalar | Int | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Display data 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/py_string_to_int.md: -------------------------------------------------------------------------------- 1 | # Py String To Int 2 | Converts a Python string to an int. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | value | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Int | 13 | 14 |
15 | Category: Python wrapper 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_load_csv.md: -------------------------------------------------------------------------------- 1 | # Pandas Load CSV 2 | Loads CSV files into a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | file_path | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: IO 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_load_json.md: -------------------------------------------------------------------------------- 1 | # Pandas Load JSON 2 | Loads JSON files into a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | file_path | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: IO 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_show_index.md: -------------------------------------------------------------------------------- 1 | # Pandas Show Index 2 | Displays a Pandas Index as text. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | index_list | Index | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Display data 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_transpose.md: -------------------------------------------------------------------------------- 1 | # Pandas Transpose 2 | Transposes a DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Transformation 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/cda_int_create.md: -------------------------------------------------------------------------------- 1 | # CDA Int Create 2 | Creates a Python int using a value entered in the text field. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Int | 13 | 14 |
15 | Category: IO 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/cda_show_float.md: -------------------------------------------------------------------------------- 1 | # CDA Show Float 2 | Displays a floating-point number as text. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | float_scalar | Float | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Display data 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_max.md: -------------------------------------------------------------------------------- 1 | # Pandas Max 2 | Computes the max of a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Series | 13 | 14 |
15 | Category: Summary statistics 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_mean.md: -------------------------------------------------------------------------------- 1 | # Pandas Mean 2 | Computes the mean of a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Series | 13 | 14 |
15 | Category: Summary statistics 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_min.md: -------------------------------------------------------------------------------- 1 | # Pandas Min 2 | Computes the min of a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Series | 13 | 14 |
15 | Category: Summary statistics 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_show_series.md: -------------------------------------------------------------------------------- 1 | # Pandas Show Series 2 | Displays a Pandas Series as text. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | series_list | Series | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Display data 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_sum.md: -------------------------------------------------------------------------------- 1 | # Pandas Sum 2 | Computes the sum of a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Series | 13 | 14 |
15 | Category: Summary statistics 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/py_string_to_float.md: -------------------------------------------------------------------------------- 1 | # Py String To Float 2 | Converts a Python string to a float. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | value | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Float | 13 | 14 |
15 | Category: Python wrapper 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_count.md: -------------------------------------------------------------------------------- 1 | # Pandas Count 2 | Computes the count of a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Series | 13 | 14 |
15 | Category: Summary statistics 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_cov.md: -------------------------------------------------------------------------------- 1 | # Pandas Cov 2 | Computes the covariance of the DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Summary statistics 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_isna.md: -------------------------------------------------------------------------------- 1 | # Pandas Is NA 2 | Checks a pandas DataFrame for missing values. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Data cleansing 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_median.md: -------------------------------------------------------------------------------- 1 | # Pandas Median 2 | Computes the median of a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Series | 13 | 14 |
15 | Category: Summary statistics 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_mode.md: -------------------------------------------------------------------------------- 1 | # Pandas Mode 2 | Computes the mode of a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Summary statistics 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_var.md: -------------------------------------------------------------------------------- 1 | # Pandas Var 2 | Computes the variance of a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Series | 13 | 14 |
15 | Category: Summary statistics 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/py_int_to_string.md: -------------------------------------------------------------------------------- 1 | # Py Int To String 2 | Converts a Python int value to a Python string 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | value | Int | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Python wrapper 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/cda_float_create.md: -------------------------------------------------------------------------------- 1 | # CDA Float Create 2 | Creates a Python float using a value entered in the text field. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Float | 13 | 14 |
15 | Category: IO 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_create.md: -------------------------------------------------------------------------------- 1 | # Pandas Create 2 | Creates a pandas DataFrame using values entered in the text field. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: IO 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_dropna.md: -------------------------------------------------------------------------------- 1 | # Pandas Drop NA 2 | Drops missing values from a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Data cleansing 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_show_dataframe.md: -------------------------------------------------------------------------------- 1 | # Pandas Show Data Frame 2 | Displays a Pandas DataFrame as text. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Display data 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/py_float_to_string.md: -------------------------------------------------------------------------------- 1 | # Py Float To String 2 | Converts a Python float value to a Python string 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | value | Float | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Python wrapper 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/py_list_to_string.md: -------------------------------------------------------------------------------- 1 | # Py List To String 2 | Converts a Python list value to a Python string 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | value | Pylist | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Python wrapper 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/sns_bar.md: -------------------------------------------------------------------------------- 1 | # SNS Bar Chart 2 | Generates a bar chart from a Pandas DataFrame using Seaborn. 3 | 4 | For style and palette parameters, refer to [SNS Line Plot documentation](sns_line.md). 5 | 6 | ## Output 7 | | Data type | 8 | |---| 9 | | Image | 10 | 11 |
12 | Category: Plot 13 | 14 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 15 | -------------------------------------------------------------------------------- /docs/reference/cda_json_create.md: -------------------------------------------------------------------------------- 1 | # CDA JSON Create 2 | Creates a serialized JSON object using values entered in the text field. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: IO 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_create_from_numpy.md: -------------------------------------------------------------------------------- 1 | # Pandas Create From Numpy 2 | Creates a pandas DataFrame from a NumPy ndarray. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | Ndarray | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: IO 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_create_from_tensor.md: -------------------------------------------------------------------------------- 1 | # Pandas Create From Tensor 2 | Creates a pandas DataFrame from a PyTorch tensor. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | tens | Tensor | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: IO 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_std.md: -------------------------------------------------------------------------------- 1 | # Pandas Std 2 | Computes the standard deviation of a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Series | 13 | 14 |
15 | Category: Summary statistics 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_summary.md: -------------------------------------------------------------------------------- 1 | # Pandas Summary 2 | Analyzes and summarizes a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Summary statistics 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_to_numpy.md: -------------------------------------------------------------------------------- 1 | # Pandas To Numpy 2 | Converts a pandas DataFrame to Numpy ndarray. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Ndarray | 13 | 14 |
15 | Category: Data type conversion 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/cda_text_create.md: -------------------------------------------------------------------------------- 1 | # CDA Text Create 2 | Creates a Python String using a value entered in a multi-line text field. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: IO 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_columns.md: -------------------------------------------------------------------------------- 1 | # Pandas Columns 2 | Retrieves the column labels of a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Index | 13 | 14 |
15 | Category: DataFrame information 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_create_series_from_list.md: -------------------------------------------------------------------------------- 1 | # Pandas Create Series From List 2 | Creates a Pandas Series from a Python list. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | Pylist | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Series | 13 | 14 |
15 | Category: IO 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_index.md: -------------------------------------------------------------------------------- 1 | # Pandas Index 2 | Retrieves the row labels (index) of a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Index | 13 | 14 |
15 | Category: DataFrame information 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_index_to_string.md: -------------------------------------------------------------------------------- 1 | # Pandas Index To String 2 | Converts a pandas Index to a string representation. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | index | Index | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Display data 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_save_csv.md: -------------------------------------------------------------------------------- 1 | # Pandas Save CSV 2 | Saves a PandasDataFrame to a CSV file. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | file_path | String | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | String | 14 | 15 |
16 | Category: IO 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_save_json.md: -------------------------------------------------------------------------------- 1 | # Pandas Save JSON 2 | Saves a PandasDataFrame to a JSON file. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | file_path | String | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | String | 14 | 15 |
16 | Category: IO 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_to_string.md: -------------------------------------------------------------------------------- 1 | # Pandas To String 2 | Converts a pandas DataFrame to a string representation. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Display data 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/sns_scatter.md: -------------------------------------------------------------------------------- 1 | # SNS Scatter Plot 2 | Generates a scatter plot from a pandas DataFrame using Seaborn. 3 | 4 | For style and palette parameters, refer to [SNS Line Plot documentation](sns_line.md). 5 | 6 | ## Output 7 | | Data type | 8 | |---| 9 | | Image | 10 | 11 |
12 | Category: Plot 13 | 14 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 15 | -------------------------------------------------------------------------------- /docs/reference/cda_string_create.md: -------------------------------------------------------------------------------- 1 | # CDA String Create 2 | Creates a Python String using a value entered in a single-line text field. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: IO 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_add.md: -------------------------------------------------------------------------------- 1 | # Pandas Add 2 | Adds two pandas DataFrames. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_dataframe | DataFrame | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_as_int.md: -------------------------------------------------------------------------------- 1 | # Pandas As Int 2 | Converts all cells in a pandas DataFrame to integer type. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Data type conversion 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_create_series_from_dict.md: -------------------------------------------------------------------------------- 1 | # Pandas Create Series From Dict 2 | Creates a Pandas Series from a Python dictionary. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | Pydict | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Series | 13 | 14 |
15 | Category: IO 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_drop_duplicates.md: -------------------------------------------------------------------------------- 1 | # Pandas Drop Duplicates 2 | Drops duplicate rows from a Pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Data cleansing 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_series_to_string.md: -------------------------------------------------------------------------------- 1 | # Pandas Series To String 2 | Converts a pandas Series to a string representation. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | series | Series | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | String | 13 | 14 |
15 | Category: Display data 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_skew.md: -------------------------------------------------------------------------------- 1 | # Pandas Skew 2 | Computes the unbiased skewness of the DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | axis | | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | Series | 14 | 15 |
16 | Category: Summary statistics 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_as_float.md: -------------------------------------------------------------------------------- 1 | # Pandas As Float 2 | Converts all cells in a pandas DataFrame to float type. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Data type conversion 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_as_string.md: -------------------------------------------------------------------------------- 1 | # Pandas As String 2 | Converts all cells in a pandas DataFrame to string type. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Data type conversion 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_mul.md: -------------------------------------------------------------------------------- 1 | # Pandas Mul 2 | Multiplies two pandas DataFrames. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_dataframe | DataFrame | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_pow.md: -------------------------------------------------------------------------------- 1 | # Pandas Pow 2 | Exponentiates two pandas DataFrames. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_dataframe | DataFrame | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_cos.md: -------------------------------------------------------------------------------- 1 | # Pandas Cos 2 | Apply the cosine function to a pandas DataFrame and converting non-numeric values to NaN. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Math 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_sin.md: -------------------------------------------------------------------------------- 1 | # Pandas Sin 2 | Applies the sine function to a pandas DataFrame and converting non-numeric values to NaN. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Math 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/py_string_to_list.md: -------------------------------------------------------------------------------- 1 | # Py String To List 2 | Creates a Python list using the string values entered in the text field. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Pylist | 13 | 14 |
15 | Category: Python wrapper 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/numpy_int_create.md: -------------------------------------------------------------------------------- 1 | # Numpy Int Create 2 | Creates a NumPy ndarray with 32-bit integer 3 | using values entered in the text field. 4 | 5 | ## Input 6 | | Name | Data type | 7 | |---|---| 8 | | data | String | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | Ndarray | 14 | 15 |
16 | Category: Numpy 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_exp.md: -------------------------------------------------------------------------------- 1 | # Pandas Exp 2 | Apply the exponential function to a pandas DataFrame and converting non-numeric values to NaN. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Math 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_head.md: -------------------------------------------------------------------------------- 1 | # Pandas Head 2 | Retrieves the first few rows of a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | rows | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Data subset selection 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_tan.md: -------------------------------------------------------------------------------- 1 | # Pandas Tan 2 | Applies the tangent function to a pandas DataFrame and converting non-numeric values to NaN. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Math 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/py_string_to_dict.md: -------------------------------------------------------------------------------- 1 | # Py String To Dict 2 | Creates a Python dictionary using the string values entered in the text field. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | String | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | Pydict | 13 | 14 |
15 | Category: Python wrapper 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_add_scalar_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Add Scalar Int 2 | Adds an integer to a Pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | int_scalar | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_cummax.md: -------------------------------------------------------------------------------- 1 | # Pandas Cummax 2 | Computes the cummax (cumulative max) of the DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | axis | | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Cumulative calculations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_cumsum.md: -------------------------------------------------------------------------------- 1 | # Pandas Cumsum 2 | Computes the cumsum (cumulative sum) of the DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | axis | | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Cumulative calculations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_div.md: -------------------------------------------------------------------------------- 1 | # Pandas Div 2 | Divides a Pandas DataFrame by another DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_dataframe | DataFrame | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/py_kv_int_create.md: -------------------------------------------------------------------------------- 1 | # Py Kv Int Create 2 | Creates a Python dictionary with an string key and an integer value. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | key | String | 8 | | value | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | Pydict | 14 | 15 |
16 | Category: Python wrapper 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /examples/datasets/2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |

First

6 | 7 | 8 | 9 | 10 |
AB
110
220
11 | 12 |

Second

13 | 14 | 15 | 16 | 17 |
XY
9.8798.76
8.7687.65
18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/reference/pandas_add_series.md: -------------------------------------------------------------------------------- 1 | # Pandas Add Series 2 | Adds a Pandas Series to a pandas DataFrames. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_series | Series | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_cummin.md: -------------------------------------------------------------------------------- 1 | # Pandas Cummin 2 | Computes the cummin (cumulative minimum) of the DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | axis | | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Cumulative calculations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_cumprod.md: -------------------------------------------------------------------------------- 1 | # Pandas Cumprod 2 | Computes the cumprod (cumulative product) of the DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | axis | | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Cumulative calculations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_div_scalar_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Div Scalar Int 2 | Divides a Pandas DataFrame by an integer. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | int_scalar | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_div_series.md: -------------------------------------------------------------------------------- 1 | # Pandas Div Series 2 | Divides a Pandas DataFrame by a Pandas Series. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_series | Series | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_load_csv_with_encoding.md: -------------------------------------------------------------------------------- 1 | # Pandas Load CSV With Encoding 2 | Loads CSV files into a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | file_path | String | 8 | | encoding | String | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: IO 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_log.md: -------------------------------------------------------------------------------- 1 | # Pandas Log 2 | Applying the natural logarithm function to a pandas DataFrame and converting non-numeric values to NaN. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | 9 | ## Output 10 | | Data type | 11 | |---| 12 | | DataFrame | 13 | 14 |
15 | Category: Math 16 | 17 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 18 | -------------------------------------------------------------------------------- /docs/reference/pandas_sub.md: -------------------------------------------------------------------------------- 1 | # Pandas Sub 2 | Subtracts a Pandas DataFrame from another DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_dataframe | DataFrame | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/py_kv_float_create.md: -------------------------------------------------------------------------------- 1 | # Py Kv Float Create 2 | Creates a Python dictionary with a string key and a float value. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | key | String | 8 | | value | Float | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | Pydict | 14 | 15 |
16 | Category: Python wrapper 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_mul_series.md: -------------------------------------------------------------------------------- 1 | # Pandas Mul Series 2 | Multiplies a Pandas DataFrame by a Pandas Series. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_series | Series | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_sub_scalar_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Sub Scalar Int 2 | Subtracts an integer from a Pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | int_scalar | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_sub_series.md: -------------------------------------------------------------------------------- 1 | # Pandas Sub Series 2 | Subtracts a Pandas Series from a Pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_series | Series | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/py_kv_string_create.md: -------------------------------------------------------------------------------- 1 | # Py Kv String Create 2 | Creates a Python dictionary with a string key and a string value. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | key | String | 8 | | value | String | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | Pydict | 14 | 15 |
16 | Category: Python wrapper 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/sns_heatmap.md: -------------------------------------------------------------------------------- 1 | # SNS Heatmap 2 | Generates a heatmap from a Pandas DataFrame using Seaborn. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | title | String | 9 | | palette | String | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | Image | 15 | 16 |
17 | Category: Plot 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/numpy_float_create.md: -------------------------------------------------------------------------------- 1 | # Numpy Float Create 2 | Creates a NumPy ndarray with 32-bit floating point precision 3 | using values entered in the text field. 4 | 5 | ## Input 6 | | Name | Data type | 7 | |---|---| 8 | | data | String | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | Ndarray | 14 | 15 |
16 | Category: Numpy 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_pow_scalar_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Pow Scalar Int 2 | Raises a Pandas DataFrame to the power of an integer. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | int_scalar | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_pow_series.md: -------------------------------------------------------------------------------- 1 | # Pandas Pow Series 2 | Raises a Pandas DataFrame to the power of a Pandas Series. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_series | Series | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_mul_scalar_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Mul Scalar Int 2 | Multiplies a Pandas DataFrame by a floating-point number. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | int_scalar | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_select_columns.md: -------------------------------------------------------------------------------- 1 | # Pandas Select Columns 2 | Selects specific columns from a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | column_names | String | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Data subset selection 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_sort.md: -------------------------------------------------------------------------------- 1 | # Pandas Sort 2 | Sorts a pandas DataFrame by a specified column. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | column_name | String | 9 | | ascending | Boolean | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | DataFrame | 15 | 16 |
17 | Category: Transformation 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_vertical_concat.md: -------------------------------------------------------------------------------- 1 | # Pandas Vertical Concat 2 | Vertically concatenates two pandas DataFrames. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_dataframe | DataFrame | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Transformation 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_add_scalar_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Add Scalar Float 2 | Adds a floating-point number to a Pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | float_scalar | Float | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_div_scalar_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Div Scalar Float 2 | Divides a Pandas DataFrame by a floating-point number. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | float_scalar | Float | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_fillna_scalar_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Fill NA Scalar Int 2 | Replaces missing values in a Pandas DataFrame with an integer. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | int_scalar | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Data cleansing 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_mul_scalar_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Mul Scalar Float 2 | Multiplies a Pandas DataFrame by a floating-point number. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | float_scalar | Float | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_sub_scalar_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Sub Scalar Float 2 | Subtracts a floating-point number from a Pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | float_scalar | Float | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_eq_scalar_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Eq Scalar Int 2 | Determines whether each element in the pandas DataFrame is equal to the int. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | number | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_group_by.md: -------------------------------------------------------------------------------- 1 | # Pandas Group By 2 | Computes aggregate values for groups in a DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | column_name | String | 9 | | aggragate_function | | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | DataFrame | 15 | 16 |
17 | Category: Aggregation 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_lt_scalar_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Lt Scalar Int 2 | Determines whether each element in the pandas DataFrame is less than the int. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | number | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_series_to_dataframe.md: -------------------------------------------------------------------------------- 1 | # Pandas Series To Data Frame 2 | Converts a Pandas Series to a DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | series | Series | 8 | | label | String | 9 | | transpose | Boolean | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | DataFrame | 15 | 16 |
17 | Category: Transformation 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_corr.md: -------------------------------------------------------------------------------- 1 | # Pandas Corr 2 | Computes the correlation of the DataFrame. You can select from the Pearson, Kendall or Spearman methods. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | method | | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Summary statistics 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_gt_scalar_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Gt Scalar Int 2 | Determines whether each element in the pandas DataFrame is greater than the int. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | number | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_load_csv_with_index.md: -------------------------------------------------------------------------------- 1 | # Pandas Load CSV With Index 2 | Loads CSV files into a pandas DataFrame. 3 | Input data is assume to have an index. 4 | 5 | ## Input 6 | | Name | Data type | 7 | |---|---| 8 | | file_path | String | 9 | | index_col | Int | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | DataFrame | 15 | 16 |
17 | Category: IO 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_ne_scalar_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Ne Scalar Int 2 | Determines whether each element in the pandas DataFrame is not equal to the int. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | number | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_pow_scalar_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Pow Scalar Float 2 | Raises a Pandas DataFrame to the power of a floating-point number. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | float_scalar | Float | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Arithmetic method 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/sns_histogram.md: -------------------------------------------------------------------------------- 1 | # SNS Histogram 2 | Generates a histogram from a Pandas DataFrame using Seaborn. 3 | 4 | Currently, plotting multiple series of data is not supported. 5 | For style and palette parameters, refer to [SNS Line Plot documentation](sns_line.md). 6 | 7 | ## Output 8 | | Data type | 9 | |---| 10 | | Image | 11 | 12 |
13 | Category: Plot 14 | 15 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 16 | -------------------------------------------------------------------------------- /docs/reference/pandas_create_from_dict.md: -------------------------------------------------------------------------------- 1 | # Pandas Create From Dict 2 | Creates a pandas DataFrame from a Python dictionary. 3 | 4 | Use `Py String To Dict` node to generate a dict from a string. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | data | Pydict | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | DataFrame | 15 | 16 |
17 | Category: IO 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_eq_scalar_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Eq Scalar Float 2 | Determines whether each element in the pandas DataFrame is equal to the float. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | number | Float | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_gt_scalar_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Gt Scalar Float 2 | Determines whether each element in the pandas DataFrame is greater than the float. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | number | Float | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_lt_scalar_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Lt Scalar Float 2 | Determines whether each element in the pandas DataFrame is less than the float. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | number | Float | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_ne_scalar_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Ne Scalar Float 2 | Determines whether each element in the pandas DataFrame is not equal to the float. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | number | Float | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_select_column_as_series.md: -------------------------------------------------------------------------------- 1 | # Pandas Select Column As Series 2 | Selects specific column as Series from a pandas DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | column_name | String | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | Series | 14 | 15 |
16 | Category: Data subset selection 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /dev/scripts/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Run this command on project root 3 | # ``` 4 | # dev/scripts/run_tests.sh 5 | # ```` 6 | # If you add a new test file, make sure that the directory contains an empty 7 | # __init__.py. Otherwise, unittest won't be able to find the directory and 8 | # the tests in the directory will be skipped. 9 | export PYTHONPATH=modules:$PYTHONPATH 10 | echo $PYTHONPATH 11 | RUN_SKIPPED_TESTS=0 python -m unittest discover -s tests -p "*_test.py" -t . 12 | 13 | -------------------------------------------------------------------------------- /docs/reference/pandas_create_with_index.md: -------------------------------------------------------------------------------- 1 | # Pandas Create With Index 2 | Creates a pandas DataFrame using values entered in the text field. Input data is assumed to have an index. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | String | 8 | | index_col | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: IO 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_ge_scalar_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Ge Scalar Int 2 | Determines whether each element in the pandas DataFrame is greater than or equal to the int. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | number | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_le_scalar_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Le Scalar Int 2 | Determines whether each element in the pandas DataFrame is less than or equal to the int. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | number | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "data-analysis" 3 | description = "Data analysis custom modules for ComfyUI – Integrates Pandas, Seaborn and Matplotlib into ComfyUI." 4 | version = "3.1.0" 5 | license = {file = "LICENSE"} 6 | 7 | [project.urls] 8 | Repository = "https://github.com/HowToSD/ComfyUI-Data-Analysis" 9 | # Used by Comfy Registry https://comfyregistry.org 10 | 11 | [tool.comfy] 12 | PublisherId = "how-to-sd" 13 | DisplayName = "ComfyUI-Data-Analysis" 14 | Icon = "" 15 | -------------------------------------------------------------------------------- /docs/reference/pandas_boolean_index.md: -------------------------------------------------------------------------------- 1 | # Pandas Boolean Index 2 | Selects rows from a pandas DataFrame based on the boolean index in the Series. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | boolean_index_series | Series | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Data subset selection 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_create_series_from_list_index_list.md: -------------------------------------------------------------------------------- 1 | # Pandas Create Series From List Index List 2 | Creates a Pandas Series from a Python list of cell values and a list for index. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | data | Pylist | 8 | | index | Pylist | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | Series | 14 | 15 |
16 | Category: IO 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_le_scalar_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Le Scalar Float 2 | Determines whether each element in the pandas DataFrame is less than or equal to the float. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | number | Float | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_loc_row_series.md: -------------------------------------------------------------------------------- 1 | # Pandas Loc Row Series 2 | Selects a row from a pandas DataFrame and output as a Series. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | row_index | String | 9 | | row_index_type | | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | Series | 15 | 16 |
17 | Category: Data subset selection 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_vertical_split.md: -------------------------------------------------------------------------------- 1 | # Pandas Vertical Split 2 | Vertically splits a Pandas DataFrame into two pandas DataFrames. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | row_integer_position | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | | DataFrame | 15 | 16 |
17 | Category: Transformation 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /examples/datasets/actor.csv: -------------------------------------------------------------------------------- 1 | Name,ActorID 2 | Barron Sawyer, 1 3 | Elara Whitmore, 2 4 | Jaxon Vance, 3 5 | Seraphina Lowell, 4 6 | Dorian Kessler, 5 7 | Valeria Knox, 6 8 | Orin Mercer, 7 9 | Celeste Draven, 8 10 | Lucian Hartwell, 9 11 | Marisol Quinn, 10 12 | Felix Holloway, 11 13 | Rowan Sinclair, 12 14 | Sienna Wren, 13 15 | Cassius Vale, 14 16 | Livia Monroe, 15 17 | Gideon Thorne, 16 18 | Zara Fontaine, 17 19 | Maverick Calloway, 18 20 | Isolde Mercer, 19 21 | Ronan Delacroix, 20 22 | -------------------------------------------------------------------------------- /docs/reference/pandas_ge_scalar_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Ge Scalar Float 2 | Determines whether each element in the pandas DataFrame is greater than or equal to the float. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | number | Float | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/numpy_squeeze.md: -------------------------------------------------------------------------------- 1 | # Numpy Squeeze 2 | Removes a dimension at the specified position in the input array if it is of size 1. 3 | 4 | Specifying a tuple of dimensions is not supported. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | array | Ndarray | 10 | | dim | Int | 11 | 12 | ## Output 13 | | Data type | 14 | |---| 15 | | Ndarray | 16 | 17 |
18 | Category: Numpy 19 | 20 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 21 | -------------------------------------------------------------------------------- /docs/reference/pandas_horizontal_split.md: -------------------------------------------------------------------------------- 1 | # Pandas Horizontal Split 2 | Horizontally splits a Pandas DataFrame into two pandas DataFrames. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | column_integer_position | Int | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | | DataFrame | 15 | 16 |
17 | Category: Transformation 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_iat_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Iat Int 2 | Selects a cell from a pandas DataFrame and output as a Python int. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | row_integer_position | Int | 9 | | column_integer_position | Int | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | Int | 15 | 16 |
17 | Category: Data subset selection 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_iat_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Iat Float 2 | Selects a cell from a pandas DataFrame and output as a Python float. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | row_integer_position | Int | 9 | | column_integer_position | Int | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | Float | 15 | 16 |
17 | Category: Data subset selection 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_iat_string.md: -------------------------------------------------------------------------------- 1 | # Pandas Iat String 2 | Selects a cell from a pandas DataFrame and output as a string. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | row_integer_position | Int | 9 | | column_integer_position | Int | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | String | 15 | 16 |
17 | Category: Data subset selection 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_join.md: -------------------------------------------------------------------------------- 1 | # Pandas Join 2 | Merges two pandas DataFrames based on a common column. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | left_dataframe | DataFrame | 8 | | right_dataframe | DataFrame | 9 | | on_column_name | String | 10 | | join_method | | 11 | 12 | ## Output 13 | | Data type | 14 | |---| 15 | | DataFrame | 16 | 17 |
18 | Category: Transformation 19 | 20 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 21 | -------------------------------------------------------------------------------- /docs/reference/pandas_eq.md: -------------------------------------------------------------------------------- 1 | # Pandas Eq 2 | Determines whether each element in the first pandas DataFrame is equal to the corresponding element in the second DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_dataframe | DataFrame | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_lt.md: -------------------------------------------------------------------------------- 1 | # Pandas Lt 2 | Determines whether each element in the first pandas DataFrame is less than the corresponding element in the second DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_dataframe | DataFrame | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/sns_line_pt.md: -------------------------------------------------------------------------------- 1 | # SNS Line Plot Pt 2 | Generates a line plot from a PyTorch tensor using Seaborn. 3 | 4 | For plotting multiple lines, enter a comma-separated column labels in y_axis_dims. 5 | If you want to display a legend for each line, enter a comma-separated legend label 6 | in legend label. 7 | 8 | ## Output 9 | | Data type | 10 | |---| 11 | | Image | 12 | 13 |
14 | Category: Plot 15 | 16 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 17 | -------------------------------------------------------------------------------- /docs/reference/pandas_gt.md: -------------------------------------------------------------------------------- 1 | # Pandas Gt 2 | Determines whether each element in the first pandas DataFrame is greater than the corresponding element in the second DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_dataframe | DataFrame | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_ne.md: -------------------------------------------------------------------------------- 1 | # Pandas Ne 2 | Determines whether each element in the first pandas DataFrame is not equal to the corresponding element in the second DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_dataframe | DataFrame | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_select_rows.md: -------------------------------------------------------------------------------- 1 | # Pandas Select Rows 2 | Selects specific rows from a pandas DataFrame based on a condition. This node internally calls DataFrame.query(). 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | condition | String | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Data subset selection 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_crosstab.md: -------------------------------------------------------------------------------- 1 | # Pandas Crosstab 2 | Creates a contingency table (crosstab, or cross-tabulation) from two or more columns in a DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | index | String | 9 | | column_names | String | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | DataFrame | 15 | 16 |
17 | Category: Categorical summary 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_le.md: -------------------------------------------------------------------------------- 1 | # Pandas Le 2 | Determines whether each element in the first pandas DataFrame is less than or equal to the corresponding element in the second DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_dataframe | DataFrame | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/pandas_ge.md: -------------------------------------------------------------------------------- 1 | # Pandas Ge 2 | Determines whether each element in the first pandas DataFrame is greater than or equal to the corresponding element in the second DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | a_dataframe | DataFrame | 8 | | b_dataframe | DataFrame | 9 | 10 | ## Output 11 | | Data type | 12 | |---| 13 | | DataFrame | 14 | 15 |
16 | Category: Logical operations 17 | 18 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 19 | -------------------------------------------------------------------------------- /docs/reference/sns_scatter_pt.md: -------------------------------------------------------------------------------- 1 | # SNS Scatter Plot Pt 2 | Generates a scatter plot from a PyTorch tensor using Seaborn. 3 | 4 | For plotting multiple scatters, enter a comma-separated column labels in y_axis_dims. 5 | If you want to display a legend for each scatter, enter a comma-separated legend label 6 | in legend label. 7 | 8 | ## Output 9 | | Data type | 10 | |---| 11 | | Image | 12 | 13 |
14 | Category: Plot 15 | 16 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 17 | -------------------------------------------------------------------------------- /docs/reference/pandas_value_counts.md: -------------------------------------------------------------------------------- 1 | # Pandas Value Counts 2 | Creates a frequency table from one or more columns in a DataFrame. 3 | 4 | ![Frequency table](../images/frequency_table.png) 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | column_names | String | 11 | 12 | ## Output 13 | | Data type | 14 | |---| 15 | | DataFrame | 16 | 17 |
18 | Category: Categorical summary 19 | 20 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 21 | -------------------------------------------------------------------------------- /docs/reference/pandas_at_int.md: -------------------------------------------------------------------------------- 1 | # Pandas At Int 2 | Selects a cell from a pandas DataFrame and output as a Python int. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | row_index | String | 9 | | row_index_type | | 10 | | column_label | String | 11 | | column_label_type | | 12 | 13 | ## Output 14 | | Data type | 15 | |---| 16 | | Int | 17 | 18 |
19 | Category: Data subset selection 20 | 21 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 22 | -------------------------------------------------------------------------------- /docs/reference/pandas_iat_datetime.md: -------------------------------------------------------------------------------- 1 | # Pandas Iat Datetime 2 | Selects a cell from a pandas DataFrame and output as a Python datetime.datetime data. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | row_integer_position | Int | 9 | | column_integer_position | Int | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | Pydatetime | 15 | 16 |
17 | Category: Data subset selection 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_at_string.md: -------------------------------------------------------------------------------- 1 | # Pandas At String 2 | Selects a cell from a pandas DataFrame and output as a string. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | row_index | String | 9 | | row_index_type | | 10 | | column_label | String | 11 | | column_label_type | | 12 | 13 | ## Output 14 | | Data type | 15 | |---| 16 | | String | 17 | 18 |
19 | Category: Data subset selection 20 | 21 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 22 | -------------------------------------------------------------------------------- /docs/reference/pandas_at_float.md: -------------------------------------------------------------------------------- 1 | # Pandas At Float 2 | Selects a cell from a pandas DataFrame and output as a Python float. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | row_index | String | 9 | | row_index_type | | 10 | | column_label | String | 11 | | column_label_type | | 12 | 13 | ## Output 14 | | Data type | 15 | |---| 16 | | Float | 17 | 18 |
19 | Category: Data subset selection 20 | 21 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 22 | -------------------------------------------------------------------------------- /docs/reference/pandas_iloc_rows_dataframe.md: -------------------------------------------------------------------------------- 1 | # Pandas Iloc Rows Data Frame 2 | Selects rows from a pandas DataFrame and returning it as a DataFrame. 3 | Rows are specified by the list of integer positions. 4 | 5 | ## Input 6 | | Name | Data type | 7 | |---|---| 8 | | dataframe | DataFrame | 9 | | row_int_pos_list_json | String | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | DataFrame | 15 | 16 |
17 | Category: Data subset selection 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_loc_cell_string.md: -------------------------------------------------------------------------------- 1 | # Pandas Loc Cell String 2 | Selects a cell from a pandas DataFrame and output as a string. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | row_index | String | 9 | | row_index_type | | 10 | | column_label | String | 11 | | column_label_type | | 12 | 13 | ## Output 14 | | Data type | 15 | |---| 16 | | String | 17 | 18 |
19 | Category: Data subset selection 20 | 21 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 22 | -------------------------------------------------------------------------------- /docs/reference/pandas_iat_set_int.md: -------------------------------------------------------------------------------- 1 | # Pandas Iat Set Int 2 | Sets a Python int data in a cell from a pandas DataFrame. 3 | 4 | This modifies the input DataFrame in place. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | row_integer_position | Int | 11 | | column_integer_position | Int | 12 | | data | Int | 13 | 14 | ## Output 15 | | Data type | 16 | |---| 17 | | DataFrame | 18 | 19 |
20 | Category: Transformation 21 | 22 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 23 | -------------------------------------------------------------------------------- /docs/reference/pandas_at_datetime.md: -------------------------------------------------------------------------------- 1 | # Pandas At Datetime 2 | Selects a cell from a pandas DataFrame and output as a Python datetime.datetime data. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | row_index | String | 9 | | row_index_type | | 10 | | column_label | String | 11 | | column_label_type | | 12 | 13 | ## Output 14 | | Data type | 15 | |---| 16 | | Pydatetime | 17 | 18 |
19 | Category: Data subset selection 20 | 21 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 22 | -------------------------------------------------------------------------------- /docs/reference/pandas_iat_set_string.md: -------------------------------------------------------------------------------- 1 | # Pandas Iat Set String 2 | Sets a Python string in a cell in a pandas DataFrame. 3 | 4 | This modifies the input DataFrame in place. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | row_integer_position | Int | 11 | | column_integer_position | Int | 12 | | data | String | 13 | 14 | ## Output 15 | | Data type | 16 | |---| 17 | | DataFrame | 18 | 19 |
20 | Category: Transformation 21 | 22 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 23 | -------------------------------------------------------------------------------- /docs/reference/pandas_iat_set_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Iat Set Float 2 | Sets a Python float data in a cell from a pandas DataFrame. 3 | 4 | This modifies the input DataFrame in place. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | row_integer_position | Int | 11 | | column_integer_position | Int | 12 | | data | Float | 13 | 14 | ## Output 15 | | Data type | 16 | |---| 17 | | DataFrame | 18 | 19 |
20 | Category: Transformation 21 | 22 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 23 | -------------------------------------------------------------------------------- /examples/datasets/movie.csv: -------------------------------------------------------------------------------- 1 | Title,MovieID,ActorID 2 | Shadow Circuit, 1, 5 3 | The Last Ember, 2, 4 4 | Echoes of Orion, 3, 3 5 | Neon Revenant, 4, 2 6 | Fractured Horizon, 5, 1 7 | Blood and Chrome, 6, 10 8 | The Silent Epoch, 7, 9 9 | Ashes of Tomorrow, 8, 8 10 | Hyperion’s Wake, 9, 7 11 | Obsidian Mirage, 10, 6 12 | The Hollow Accord, 11, 5 13 | Lunar Divide, 12, 3 14 | Redshift Paradox, 13, 1 15 | Phantom Genesis, 14, 4 16 | Vanishing Point Protocol, 15, 2 17 | Nocturne Zero, 16, 18 | Polaris Run, 17, 19 | The Gilded Warden, 18, 20 | Aetherfall, 19, 21 | Terminal Sanctum, 20, 22 | -------------------------------------------------------------------------------- /docs/reference/pandas_horizontal_concat.md: -------------------------------------------------------------------------------- 1 | # Pandas Horizontal Concat 2 | Horizontally concatenates two pandas DataFrames. 3 | 4 | If reset labels is set to True, column labels are reset to a sequential integer index. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | a_dataframe | DataFrame | 10 | | b_dataframe | DataFrame | 11 | | reset_labels | Boolean | 12 | 13 | ## Output 14 | | Data type | 15 | |---| 16 | | DataFrame | 17 | 18 |
19 | Category: Transformation 20 | 21 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 22 | -------------------------------------------------------------------------------- /docs/reference/pandas_iat_set_datetime.md: -------------------------------------------------------------------------------- 1 | # Pandas Iat Set Datetime 2 | Sets a Python datetime.datetime data in a cell in a pandas DataFrame. 3 | 4 | This modifies the input DataFrame in place. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | row_integer_position | Int | 11 | | column_integer_position | Int | 12 | | data | Pydatetime | 13 | 14 | ## Output 15 | | Data type | 16 | |---| 17 | | DataFrame | 18 | 19 |
20 | Category: Transformation 21 | 22 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 23 | -------------------------------------------------------------------------------- /docs/reference/py_string_to_datetime.md: -------------------------------------------------------------------------------- 1 | # Py String To Datetime 2 | Converts a Python string to a Python datetime.datetime. 3 | 4 | Refer to [the Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior) for date/time format strings. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | value | String | 10 | | date_format | String | 11 | 12 | ## Output 13 | | Data type | 14 | |---| 15 | | Pydatetime | 16 | 17 |
18 | Category: Python wrapper 19 | 20 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 21 | -------------------------------------------------------------------------------- /docs/reference/sns_pairplot.md: -------------------------------------------------------------------------------- 1 | # SNS Pairplot 2 | Generates a pairplot from a Pandas DataFrame using Seaborn. 3 | 4 | Specify a column name for the hue parameter to color the data points based on that column. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | hue_column_name | String | 11 | | title | String | 12 | | style | String | 13 | | palette | String | 14 | 15 | ## Output 16 | | Data type | 17 | |---| 18 | | Image | 19 | 20 |
21 | Category: Plot 22 | 23 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 24 | -------------------------------------------------------------------------------- /docs/reference/pandas_at_set_int.md: -------------------------------------------------------------------------------- 1 | # Pandas At Set Int 2 | Sets a Python int data in a cell in a pandas DataFrame. 3 | 4 | This modifies the input DataFrame in place. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | row_index | String | 11 | | row_index_type | | 12 | | column_label | String | 13 | | column_label_type | | 14 | | data | Int | 15 | 16 | ## Output 17 | | Data type | 18 | |---| 19 | | DataFrame | 20 | 21 |
22 | Category: Transformation 23 | 24 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 25 | -------------------------------------------------------------------------------- /docs/reference/pandas_replace.md: -------------------------------------------------------------------------------- 1 | # Pandas Replace 2 | Replaces part or all of a string in each DataFrame cell with a specified string using a wildcard for matching. If you want to remove some characters, then leave the replace_string field blank. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | regex | String | 9 | | replacement_string | String | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | DataFrame | 15 | 16 |
17 | Category: Data cleansing 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/py_datetime_to_string.md: -------------------------------------------------------------------------------- 1 | # Py Datetime To String 2 | Converts a Python datetime.datetime value to a Python string 3 | 4 | Refer to [the Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior) for date/time format strings. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | value | Pydatetime | 10 | | date_format | String | 11 | 12 | ## Output 13 | | Data type | 14 | |---| 15 | | String | 16 | 17 |
18 | Category: Python wrapper 19 | 20 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 21 | -------------------------------------------------------------------------------- /docs/reference/mpl_pie_chart.md: -------------------------------------------------------------------------------- 1 | # MPL Pie Chart 2 | Generates a pie chart from a pandas DataFrame. 3 | 4 | Below screenshot shows a workflow to generate a pie chart from categorical data. 5 | ![Pie chart](../images/pie_chart.png) 6 | 7 | ## Input 8 | | Name | Data type | 9 | |---|---| 10 | | dataframe | DataFrame | 11 | | label_column_name | String | 12 | | data_column_name | String | 13 | | title | String | 14 | 15 | ## Output 16 | | Data type | 17 | |---| 18 | | Image | 19 | 20 |
21 | Category: Plot 22 | 23 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 24 | -------------------------------------------------------------------------------- /docs/reference/pandas_at_set_float.md: -------------------------------------------------------------------------------- 1 | # Pandas At Set Float 2 | Sets a Python float data in a cell in a pandas DataFrame. 3 | 4 | This modifies the input DataFrame in place. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | row_index | String | 11 | | row_index_type | | 12 | | column_label | String | 13 | | column_label_type | | 14 | | data | Float | 15 | 16 | ## Output 17 | | Data type | 18 | |---| 19 | | DataFrame | 20 | 21 |
22 | Category: Transformation 23 | 24 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 25 | -------------------------------------------------------------------------------- /docs/reference/pandas_at_set_string.md: -------------------------------------------------------------------------------- 1 | # Pandas At Set String 2 | Sets a Python string data in a cell in a pandas DataFrame. 3 | 4 | This modifies the input DataFrame in place. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | row_index | String | 11 | | row_index_type | | 12 | | column_label | String | 13 | | column_label_type | | 14 | | data | String | 15 | 16 | ## Output 17 | | Data type | 18 | |---| 19 | | DataFrame | 20 | 21 |
22 | Category: Transformation 23 | 24 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 25 | -------------------------------------------------------------------------------- /docs/reference/pandas_at_set_datetime.md: -------------------------------------------------------------------------------- 1 | # Pandas At Set Datetime 2 | Sets a Python datetime.datetime data in a cell in a pandas DataFrame. 3 | 4 | This modifies the input DataFrame in place. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | row_index | String | 11 | | row_index_type | | 12 | | column_label | String | 13 | | column_label_type | | 14 | | data | Pydatetime | 15 | 16 | ## Output 17 | | Data type | 18 | |---| 19 | | DataFrame | 20 | 21 |
22 | Category: Transformation 23 | 24 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 25 | -------------------------------------------------------------------------------- /docs/reference/pandas_create_from_dict_index_list.md: -------------------------------------------------------------------------------- 1 | # Pandas Create From Dict Index List 2 | Creates a pandas DataFrame from a Python dictionary and a list for index. 3 | 4 | Use `Py String To Dict` node to generate a dict for cell values from a string. 5 | Use `Py String To List` node to generate a list for index from a string. 6 | 7 | ## Input 8 | | Name | Data type | 9 | |---|---| 10 | | data | Pydict | 11 | | index | Pylist | 12 | 13 | ## Output 14 | | Data type | 15 | |---| 16 | | DataFrame | 17 | 18 |
19 | Category: IO 20 | 21 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 22 | -------------------------------------------------------------------------------- /docs/reference/pandas_load_excel.md: -------------------------------------------------------------------------------- 1 | # Pandas Load Excel 2 | Loads Excel files into a pandas DataFrame. 3 | 4 | This node uses read_excel method. 5 | See [Pandas documentation](https://pandas.pydata.org/docs/reference/api/pandas.read_excel.html) for details. 6 | 7 | If sheet_name is not specified, first sheet will be read. 8 | 9 | ## Input 10 | | Name | Data type | 11 | |---|---| 12 | | file_path | String | 13 | | sheet_name | String | 14 | 15 | ## Output 16 | | Data type | 17 | |---| 18 | | DataFrame | 19 | 20 |
21 | Category: IO 22 | 23 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 24 | -------------------------------------------------------------------------------- /docs/reference/pandas_iloc_rows_slice_dataframe.md: -------------------------------------------------------------------------------- 1 | # Pandas Iloc Rows Slice Data Frame 2 | Selects rows from a pandas DataFrame using a slice defined by a start and end integer position. The start position is inclusive, while the end position is exclusive. Returns the selected rows as a DataFrame. 3 | 4 | ## Input 5 | | Name | Data type | 6 | |---|---| 7 | | dataframe | DataFrame | 8 | | start_row | Int | 9 | | end_row | Int | 10 | 11 | ## Output 12 | | Data type | 13 | |---| 14 | | DataFrame | 15 | 16 |
17 | Category: Data subset selection 18 | 19 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 20 | -------------------------------------------------------------------------------- /docs/reference/pandas_kurtosis.md: -------------------------------------------------------------------------------- 1 | # Pandas Kurtosis 2 | Computes the unbiased kurtosis of the DataFrame. 3 | 4 | This method returns the excess kurtosis rather than the raw kurtosis. 5 | Excess kurtosis is calculated by subtracting 3 from the raw kurtosis, 6 | which offsets it relative to the kurtosis of a normal distribution. 7 | 8 | ## Input 9 | | Name | Data type | 10 | |---|---| 11 | | dataframe | DataFrame | 12 | | axis | | 13 | 14 | ## Output 15 | | Data type | 16 | |---| 17 | | Series | 18 | 19 |
20 | Category: Summary statistics 21 | 22 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 23 | -------------------------------------------------------------------------------- /docs/reference/pandas_strftime.md: -------------------------------------------------------------------------------- 1 | # Pandas Strftime 2 | Converts one or more datetime columns in a DataFrame to string columns. 3 | 4 | Refer to [the Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior) for date/time format strings. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | column_names | String | 11 | | date_format | String | 12 | 13 | ## Output 14 | | Data type | 15 | |---| 16 | | DataFrame | 17 | 18 |
19 | Category: Date and time processing 20 | 21 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 22 | -------------------------------------------------------------------------------- /docs/reference/pandas_rename_advanced.md: -------------------------------------------------------------------------------- 1 | # Pandas Rename Advanced 2 | Renames one or more indices (row labels) or column labels to new labels. 3 | 4 | Specify the replacement in a Python dictionary format: 5 | ``` 6 | { 7 | "old_foo": "new_bar", 8 | 0: 5 9 | } 10 | ``` 11 | A string label has to be double-quoted. 12 | 13 | ## Input 14 | | Name | Data type | 15 | |---|---| 16 | | dataframe | DataFrame | 17 | | axis | | 18 | | replacement_pairs | String | 19 | 20 | ## Output 21 | | Data type | 22 | |---| 23 | | DataFrame | 24 | 25 |
26 | Category: Transformation 27 | 28 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 29 | -------------------------------------------------------------------------------- /docs/reference/pandas_replace_advanced.md: -------------------------------------------------------------------------------- 1 | # Pandas Replace Advanced 2 | Replaces strings in a DataFrame cell using a mapping specified in a dictionary. 3 | For example, if you want to replace "cat" with "dog" and replace "mountain" with "ocean", specify the mapping in Python dict format: 4 | ``` 5 | {"cat":"dog", "mountain":"ocean"} 6 | ``` 7 | 8 | ## Input 9 | | Name | Data type | 10 | |---|---| 11 | | dataframe | DataFrame | 12 | | replacement_dict | String | 13 | 14 | ## Output 15 | | Data type | 16 | |---| 17 | | DataFrame | 18 | 19 |
20 | Category: Data cleansing 21 | 22 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 23 | -------------------------------------------------------------------------------- /docs/reference/pandas_feature_split_to_pt.md: -------------------------------------------------------------------------------- 1 | # Pandas Feature Split To Pt 2 | Splits a Pandas DataFrame into feature PyTorch tensor and label PyTorch tensor. 3 | If output_1d_label is set, label will be output as a 1d array instead of a 2d array. 4 | 5 | ## Input 6 | | Name | Data type | 7 | |---|---| 8 | | dataframe | DataFrame | 9 | | label_integer_position | Int | 10 | | output_1d_label | Boolean | 11 | | feature_data_type | | 12 | | label_data_type | | 13 | 14 | ## Output 15 | | Data type | 16 | |---| 17 | | Tensor | 18 | | Tensor | 19 | 20 |
21 | Category: Transformation 22 | 23 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 24 | -------------------------------------------------------------------------------- /docs/reference/pandas_rename.md: -------------------------------------------------------------------------------- 1 | # Pandas Rename 2 | Renames an index (row label) or a column label. 3 | Currently, renaming only works for string labels. Renaming of integer labels is not supported. 4 | Note below node parameter description is incomplete due to a reference generator's bug: 5 | * axis takes columns or index. 6 | 7 | ## Input 8 | | Name | Data type | 9 | |---|---| 10 | | dataframe | DataFrame | 11 | | axis | | 12 | | current_label | String | 13 | | new_label | String | 14 | 15 | ## Output 16 | | Data type | 17 | |---| 18 | | DataFrame | 19 | 20 |
21 | Category: Transformation 22 | 23 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 24 | -------------------------------------------------------------------------------- /docs/reference/pandas_iloc_row_series.md: -------------------------------------------------------------------------------- 1 | # Pandas Iloc Row Series 2 | Selects a row from a pandas DataFrame and returning it as a Series. 3 | The row is specified by its integer position, similar to an index in other software. 4 | Note: In Pandas, "index" refers to a unique label assigned to each row. See https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.iloc.html 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | row_integer_position | Int | 11 | 12 | ## Output 13 | | Data type | 14 | |---| 15 | | Series | 16 | 17 |
18 | Category: Data subset selection 19 | 20 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 21 | -------------------------------------------------------------------------------- /docs/reference/pandas_fillna_scalar_float.md: -------------------------------------------------------------------------------- 1 | # Pandas Fill NA Scalar Float 2 | Replaces missing values in a Pandas DataFrame with a floating-point number. 3 | 4 | To set the value, use **the CDA Float Create node** to define the floating-point number and connect it to this node's float_scaler input. Alternatively, you can enter the value directly in this node, but it currently supports only one decimal digit. 5 | 6 | ## Input 7 | | Name | Data type | 8 | |---|---| 9 | | dataframe | DataFrame | 10 | | float_scalar | Float | 11 | 12 | ## Output 13 | | Data type | 14 | |---| 15 | | DataFrame | 16 | 17 |
18 | Category: Data cleansing 19 | 20 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 21 | -------------------------------------------------------------------------------- /docs/reference/pandas_to_datetime.md: -------------------------------------------------------------------------------- 1 | # Pandas To Datetime 2 | Converts one or more string columns in a DataFrame to datetime columns. 3 | 4 | Note: When only the time portion is provided, the date defaults to 1900-01-01. 5 | Refer to [the Python documentation](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior) for valid date/time format strings. 6 | 7 | ## Input 8 | | Name | Data type | 9 | |---|---| 10 | | dataframe | DataFrame | 11 | | column_names | String | 12 | | date_format | String | 13 | 14 | ## Output 15 | | Data type | 16 | |---| 17 | | DataFrame | 18 | 19 |
20 | Category: Date and time processing 21 | 22 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 23 | -------------------------------------------------------------------------------- /modules/matplotlib/common.py: -------------------------------------------------------------------------------- 1 | def common_input_types(): 2 | """ 3 | Defines the input types for a plot function. 4 | 5 | Returns: 6 | Dict[str, Any]: A dictionary specifying required input types. 7 | """ 8 | return { 9 | "required": { 10 | "dataframe": ("DATAFRAME", {}), 11 | "x_column_name": ("STRING", {"default": ""}), 12 | "y_column_name": ("STRING", {"default": ""}), 13 | "title": ("STRING", {"default": ""}), 14 | "x_axis_label": ("STRING", {"default": ""}), 15 | "y_axis_label": ("STRING", {"default": ""}), 16 | "x_tick_as_int": ("BOOLEAN", {"default": False}) # To show 2002 instead of 2002.5 on x-axis 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish to Comfy registry 2 | on: 3 | workflow_dispatch: 4 | push: 5 | branches: 6 | - main 7 | - master 8 | paths: 9 | - "pyproject.toml" 10 | 11 | permissions: 12 | issues: write 13 | 14 | jobs: 15 | publish-node: 16 | name: Publish Custom Node to registry 17 | runs-on: ubuntu-latest 18 | if: ${{ github.repository_owner == 'HowToSD' }} 19 | steps: 20 | - name: Check out code 21 | uses: actions/checkout@v4 22 | with: 23 | submodules: true 24 | - name: Publish Custom Node 25 | uses: Comfy-Org/publish-node-action@v1 26 | with: 27 | ## Add your own personal access token to your Github Repository secrets and reference it here. 28 | personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} 29 | -------------------------------------------------------------------------------- /docs/reference/pandas_create_from_multiple_dict.md: -------------------------------------------------------------------------------- 1 | # Pandas Create From Multiple Dict 2 | Creates a pandas DataFrame from multiple Python dictionaries. 3 | 4 | Use this node to create a DataFrame from below nodes: 5 | * Py Kv Float Create 6 | * Py Kv Int Create 7 | * Py Kv String Create 8 | Each of above can be used to set a column name and the value for the column. 9 | 10 | ## Input 11 | | Name | Data type | 12 | |---|---| 13 | | dict1 | Pydict | 14 | | dict2 | Pydict | 15 | | dict3 | Pydict | 16 | | dict4 | Pydict | 17 | | dict5 | Pydict | 18 | | dict6 | Pydict | 19 | | dict7 | Pydict | 20 | | dict8 | Pydict | 21 | | dict9 | Pydict | 22 | | dict10 | Pydict | 23 | 24 | ## Output 25 | | Data type | 26 | |---| 27 | | DataFrame | 28 | 29 |
30 | Category: IO 31 | 32 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 33 | -------------------------------------------------------------------------------- /docs/reference/pandas_load_html.md: -------------------------------------------------------------------------------- 1 | # Pandas Load HTML 2 | Scans an HTML file or webpage for tables and returns the number of DataFrames 3 | found, followed by a list of up to 10 DataFrames. Each table is represented 4 | as a separate DataFrame. If fewer than 10 tables are found, empty DataFrames 5 | fill the remaining slots. 6 | 7 | When loading from a URL, additional cleanup may be required. 8 | 9 | ## Input 10 | | Name | Data type | 11 | |---|---| 12 | | file_path | String | 13 | 14 | ## Output 15 | | Data type | 16 | |---| 17 | | Int | 18 | | DataFrame | 19 | | DataFrame | 20 | | DataFrame | 21 | | DataFrame | 22 | | DataFrame | 23 | | DataFrame | 24 | | DataFrame | 25 | | DataFrame | 26 | | DataFrame | 27 | | DataFrame | 28 | 29 |
30 | Category: IO 31 | 32 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 33 | -------------------------------------------------------------------------------- /docs/reference/pandas_feature_split_to_numpy.md: -------------------------------------------------------------------------------- 1 | # Pandas Feature Split To Numpy 2 | Splits a Pandas DataFrame into feature Numpy ndarray and label Numpy ndarray. 3 | If output_1d_label is set, label will be output as a 1d array instead of a 2d array. 4 | 5 | As shown in the below screenshot, this node can replace multiple nodes that are used to split Pandas DataFrame into two DataFrames, convert to NumPy, then squeeze the label data. 6 | ![Pandas Feature Split To Numpy](../images/pandas_feature_split.png) 7 | 8 | ## Input 9 | | Name | Data type | 10 | |---|---| 11 | | dataframe | DataFrame | 12 | | label_integer_position | Int | 13 | | output_1d_label | Boolean | 14 | 15 | ## Output 16 | | Data type | 17 | |---| 18 | | Ndarray | 19 | | Ndarray | 20 | 21 |
22 | Category: Transformation 23 | 24 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 25 | -------------------------------------------------------------------------------- /docs/reference/pandas_excel_file_sheet_names.md: -------------------------------------------------------------------------------- 1 | # Pandas Excel File Sheet Names 2 | Returns the string list of sheet names contained in the Excel file. 3 | 4 | This node uses ExcelFile method using the openpyxl package. 5 | The openpyxl package is specified as a dependency in requirements.txt, so you should not need to manually install it. 6 | See [Pandas documentation](https://pandas.pydata.org/docs/reference/api/pandas.ExcelFile.html) for details. 7 | 8 | To display the list, connect output to PyListToString node to convert the list to a string, then connect the output to Pandas Show Text node to display the string. 9 | 10 | ## Input 11 | | Name | Data type | 12 | |---|---| 13 | | file_path | String | 14 | 15 | ## Output 16 | | Data type | 17 | |---| 18 | | Pylist | 19 | 20 |
21 | Category: IO 22 | 23 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 24 | -------------------------------------------------------------------------------- /tests/cda/py_kev_int_create_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | 5 | 6 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 7 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 8 | sys.path.append(MODULE_ROOT) 9 | 10 | from cda.py_kv_int_create import PyKvIntCreate 11 | 12 | class TestPyKvIntCreat(unittest.TestCase): 13 | def setUp(self): 14 | """Set up test data.""" 15 | self.node = PyKvIntCreate() 16 | self.data = [ 17 | {"key": "a", "value": 12345678} 18 | ] 19 | 20 | def test_create_key_value_pair(self): 21 | """Test key-value pair creation.""" 22 | retval = self.node.f(key=self.data[0]["key"], value=self.data[0]["value"])[0] 23 | self.assertEqual({self.data[0]["key"]: self.data[0]["value"]}, retval) 24 | 25 | 26 | if __name__ == "__main__": 27 | unittest.main() 28 | 29 | -------------------------------------------------------------------------------- /tests/cda/py_kev_float_create_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | 5 | 6 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 7 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 8 | sys.path.append(MODULE_ROOT) 9 | from cda.py_kv_float_create import PyKvFloatCreate 10 | 11 | class TestPyKvFloatCreat(unittest.TestCase): 12 | def setUp(self): 13 | """Set up test data.""" 14 | self.node = PyKvFloatCreate() 15 | self.data = [ 16 | {"key": "a", "value": 1.2345678} 17 | ] 18 | 19 | def test_create_key_value_pair(self): 20 | """Test key-value pair creation.""" 21 | retval = self.node.f(key=self.data[0]["key"], value=self.data[0]["value"])[0] 22 | self.assertEqual({self.data[0]["key"]: self.data[0]["value"]}, retval) 23 | 24 | 25 | if __name__ == "__main__": 26 | unittest.main() 27 | 28 | -------------------------------------------------------------------------------- /tests/cda/py_kev_string_create_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | 5 | 6 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 7 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 8 | sys.path.append(MODULE_ROOT) 9 | from cda.py_kv_string_create import PyKvStringCreate 10 | 11 | class TestPyKvStringCreat(unittest.TestCase): 12 | def setUp(self): 13 | """Set up test data.""" 14 | self.node = PyKvStringCreate() 15 | self.data = [ 16 | {"key": "a", "value": "apple"} 17 | ] 18 | 19 | def test_create_key_value_pair(self): 20 | """Test key-value pair creation.""" 21 | retval = self.node.f(key=self.data[0]["key"], value=self.data[0]["value"])[0] 22 | self.assertEqual({self.data[0]["key"]: self.data[0]["value"]}, retval) 23 | 24 | 25 | if __name__ == "__main__": 26 | unittest.main() 27 | 28 | -------------------------------------------------------------------------------- /tests/cda/py_string_to_int_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | 5 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 6 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 7 | sys.path.append(MODULE_ROOT) 8 | from cda.py_string_to_int import PyStringToInt 9 | 10 | class TestPyStringToInt(unittest.TestCase): 11 | def setUp(self): 12 | """Set up test data.""" 13 | self.node = PyStringToInt() 14 | self.test_cases = [ 15 | ("3", 3), 16 | ("27", 27), 17 | ("100", 100), 18 | ("-42", -42) 19 | ] 20 | 21 | def test_string_to_int(self): 22 | """Test converting a string to int.""" 23 | for value, expected in self.test_cases: 24 | with self.subTest(value=value): 25 | retval = self.node.f(value=value)[0] 26 | self.assertEqual(retval, expected, f"Mismatch for value={value}") 27 | 28 | if __name__ == "__main__": 29 | unittest.main() 30 | -------------------------------------------------------------------------------- /tests/cda/py_int_to_string_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | 5 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 6 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 7 | sys.path.append(MODULE_ROOT) 8 | from cda.py_int_to_string import PyIntToString 9 | 10 | class TestPyIntToString(unittest.TestCase): 11 | def setUp(self): 12 | """Set up test data.""" 13 | self.node = PyIntToString() 14 | self.test_cases = [ 15 | (3, "3"), 16 | (27, "27"), 17 | (100, "100"), 18 | (-42, "-42") 19 | ] 20 | 21 | def test_int_to_string(self): 22 | """Test converting an integer to string.""" 23 | for value, expected in self.test_cases: 24 | with self.subTest(value=value): 25 | retval = self.node.f(value=value)[0] 26 | self.assertEqual(retval, expected, f"Mismatch for value={value}") 27 | 28 | if __name__ == "__main__": 29 | unittest.main() 30 | -------------------------------------------------------------------------------- /tests/cda/py_float_to_string_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | 5 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 6 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 7 | sys.path.append(MODULE_ROOT) 8 | from cda.py_float_to_string import PyFloatToString 9 | 10 | class TestPyFloatToString(unittest.TestCase): 11 | def setUp(self): 12 | """Set up test data.""" 13 | self.node = PyFloatToString() 14 | self.test_cases = [ 15 | (3.14, "3.14"), 16 | (2.71, "2.71"), 17 | (0.577, "0.577"), 18 | (1.618, "1.618") 19 | ] 20 | 21 | def test_float_to_string(self): 22 | """Test converting a float to string.""" 23 | for value, expected in self.test_cases: 24 | with self.subTest(value=value): 25 | retval = self.node.f(value=value)[0] 26 | self.assertEqual(retval, expected, f"Mismatch for value={value}") 27 | 28 | if __name__ == "__main__": 29 | unittest.main() -------------------------------------------------------------------------------- /tests/cda/py_list_to_string_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | 5 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 6 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 7 | sys.path.append(MODULE_ROOT) 8 | from cda.py_list_to_string import PyListToString 9 | 10 | class TestPyListToString(unittest.TestCase): 11 | def setUp(self): 12 | """Set up test data.""" 13 | self.node = PyListToString() 14 | self.test_cases = [ 15 | ([1,2,3], "[1, 2, 3]"), 16 | (["apple", "banana"], "['apple', 'banana']"), 17 | ([], "[]") 18 | ] 19 | 20 | def test_list_to_string(self): 21 | """Test converting a list to string.""" 22 | for value, expected in self.test_cases: 23 | with self.subTest(value=value): 24 | retval = self.node.f(value=value)[0] 25 | self.assertEqual(retval, expected, f"Mismatch for value={value}") 26 | 27 | 28 | if __name__ == "__main__": 29 | unittest.main() -------------------------------------------------------------------------------- /tests/cda/py_string_to_float_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | 5 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 6 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 7 | sys.path.append(MODULE_ROOT) 8 | from cda.py_string_to_float import PyStringToFloat 9 | 10 | class TestPyStringToFloat(unittest.TestCase): 11 | def setUp(self): 12 | """Set up test data.""" 13 | self.node = PyStringToFloat() 14 | self.test_cases = [ 15 | ("3.14", 3.14), 16 | ("2.71", 2.71), 17 | ("0.577", 0.577), 18 | ("1.618", 1.618) 19 | ] 20 | 21 | def test_string_to_float(self): 22 | """Test converting a string to float.""" 23 | for value, expected in self.test_cases: 24 | with self.subTest(value=value): 25 | retval = self.node.f(value=value)[0] 26 | self.assertEqual(retval, expected, f"Mismatch for value={value}") 27 | 28 | if __name__ == "__main__": 29 | unittest.main() 30 | -------------------------------------------------------------------------------- /modules/cda/py_list_to_string.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict, List 2 | 3 | class PyListToString: 4 | """ 5 | Converts a Python list value to a Python string 6 | 7 | category: Python wrapper 8 | """ 9 | 10 | @classmethod 11 | def INPUT_TYPES(cls) -> Dict[str, Any]: 12 | """ 13 | Defines the input types for the function. 14 | 15 | Returns: 16 | Dict[str, Any]: A dictionary specifying required input types. 17 | """ 18 | return { 19 | "required": { 20 | "value": ("PYLIST", {}) 21 | } 22 | } 23 | 24 | RETURN_TYPES: tuple = ("STRING",) 25 | FUNCTION: str = "f" 26 | CATEGORY: str = "Data Analysis" 27 | 28 | def f(self, value: List) -> tuple: 29 | """ 30 | Converts a Python list value to a Python string 31 | 32 | Args: 33 | value (list): List value to convert. 34 | 35 | Returns: 36 | tuple: A tuple containing the converted value. 37 | """ 38 | return (str(value),) 39 | -------------------------------------------------------------------------------- /docs/reference/pandas_loc_row_multiindex_dataframe.md: -------------------------------------------------------------------------------- 1 | # Pandas Loc Row MultiIndex DataFrame 2 | Selects a row or rows from a pandas DataFrame with MultiIndex and output as a DataFrame. 3 | 4 | Specify comma-separated MultiIndex labels (row index) and the data type for the MultiIndex to select a row. 5 | 6 | Below screenshots illustrate these options: 7 | ![PandasLocRowMultiIndexDataFrame](../images/multiindex.png) 8 | 9 | The top DataFrame has an integer-type MultiIndex, while the bottom DataFrame has a string-type MultiIndex. In both cases, two index values are specified to select a single row while the correct MultiIndex data type is also selected. Note that mixed data types for MultiIndex are not currently supported. 10 | 11 | ## Input 12 | | Name | Data type | 13 | |---|---| 14 | | dataframe | DataFrame | 15 | | row_index | String | 16 | | row_index_type | | 17 | 18 | ## Output 19 | | Data type | 20 | |---| 21 | | DataFrame | 22 | 23 |
24 | Category: Data subset selection 25 | 26 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 27 | -------------------------------------------------------------------------------- /modules/cda/py_string_to_int.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | 3 | 4 | class PyStringToInt: 5 | """ 6 | Converts a Python string to an int. 7 | 8 | category: Python wrapper 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the `create` function. 15 | 16 | Returns: 17 | Dict[str, Any]: A dictionary specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "value": ("STRING", {"default":"", "multiline": False}) 22 | } 23 | } 24 | 25 | RETURN_TYPES: tuple = ("INT",) 26 | FUNCTION: str = "f" 27 | CATEGORY: str = "Data Analysis" 28 | 29 | def f(self, value: str) -> tuple: 30 | """ 31 | Converts a Python string to an int. 32 | 33 | Args: 34 | value (str): String value to convert. 35 | 36 | Returns: 37 | tuple: A tuple containing the dictionary. 38 | """ 39 | return (int(value),) 40 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_transpose.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | class PandasTranspose: 5 | """ 6 | Transposes a DataFrame. 7 | 8 | category: Transformation 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the function. 15 | 16 | Returns: 17 | Dict[str, Any]: A dictionary specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "dataframe": ("DATAFRAME", {}) 22 | } 23 | } 24 | 25 | RETURN_TYPES: tuple = ("DATAFRAME",) 26 | FUNCTION: str = "f" 27 | CATEGORY: str = "Data Analysis" 28 | 29 | def f(self, dataframe: pd.DataFrame) -> tuple: 30 | """ 31 | Transposes a DataFrame. 32 | 33 | Args: 34 | dataframe (DataFrame): The DataFrame. 35 | 36 | Returns: 37 | tuple: A tuple containing the transposed DataFrame. 38 | """ 39 | return (dataframe.transpose(),) 40 | -------------------------------------------------------------------------------- /modules/cda/py_string_to_float.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | 3 | 4 | class PyStringToFloat: 5 | """ 6 | Converts a Python string to a float. 7 | 8 | category: Python wrapper 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the `create` function. 15 | 16 | Returns: 17 | Dict[str, Any]: A dictionary specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "value": ("STRING", {"default":"", "multiline": False}) 22 | } 23 | } 24 | 25 | RETURN_TYPES: tuple = ("FLOAT",) 26 | FUNCTION: str = "f" 27 | CATEGORY: str = "Data Analysis" 28 | 29 | def f(self, value: str) -> tuple: 30 | """ 31 | Converts a Python string to a float. 32 | 33 | Args: 34 | value (str): String value to convert. 35 | 36 | Returns: 37 | tuple: A tuple containing the dictionary. 38 | """ 39 | return (float(value),) 40 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_cov.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | 5 | class PandasCov: 6 | """ 7 | Computes the covariance of the DataFrame. 8 | 9 | category: Summary statistics 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}) 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("DATAFRAME",) 27 | FUNCTION: str = "f" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def f(self, dataframe: pd.DataFrame) -> tuple: 31 | """ 32 | Computes the covariance of the DataFrame. 33 | 34 | Args: 35 | dataframe (DataFrame): The DataFrame. 36 | 37 | Returns: 38 | tuple: A tuple containing the result. 39 | """ 40 | return (dataframe.cov(),) 41 | -------------------------------------------------------------------------------- /docs/reference/pandas_set_index.md: -------------------------------------------------------------------------------- 1 | # Pandas Set Index 2 | Create index (row label) from existing column or columns. 3 | 4 | You can specify a single column or a comma-separated list of column labels in `column_names`. 5 | If `drop=True`, the specified columns are removed from column labels and become the index. 6 | If `drop=False`, the columns remain in the DataFrame column labels while also being used as the index. 7 | If `append=True`, the new index is added alongside the existing index. 8 | 9 | Below screenshots illustrate these options: 10 | 11 | ![Pandas Set Index](../images/set_index1.png) 12 | 13 | ![Pandas Set Index](../images/set_index2.png) 14 | 15 | This class internally calls `pandas.DataFrame.set_index()`. 16 | 17 | ## Input 18 | | Name | Data type | 19 | |---|---| 20 | | dataframe | DataFrame | 21 | | column_names | String | 22 | | drop | Boolean | 23 | | append | Boolean | 24 | 25 | ## Output 26 | | Data type | 27 | |---| 28 | | DataFrame | 29 | 30 |
31 | Category: Transformation 32 | 33 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 34 | -------------------------------------------------------------------------------- /modules/cda/py_int_to_string.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | 3 | 4 | class PyIntToString: 5 | """ 6 | Converts a Python int value to a Python string 7 | 8 | category: Python wrapper 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the `create` function. 15 | 16 | Returns: 17 | Dict[str, Any]: A dictionary specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "value": ("INT", {"default": 0, "min": -2**31, "max": 2**31}) 22 | } 23 | } 24 | 25 | RETURN_TYPES: tuple = ("STRING",) 26 | FUNCTION: str = "f" 27 | CATEGORY: str = "Data Analysis" 28 | 29 | def f(self, value: int) -> tuple: 30 | """ 31 | Converts a Python int value to a Python string 32 | 33 | Args: 34 | value (int): Int value to convert. 35 | 36 | Returns: 37 | tuple: A tuple containing the converted value. 38 | """ 39 | return (str(value),) 40 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_drop_duplicates.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | class PandasDropDuplicates: 5 | """ 6 | Drops duplicate rows from a Pandas DataFrame. 7 | 8 | category: Data cleansing 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the function. 15 | 16 | Returns: 17 | Dict[str, Any]: A dictionary specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "dataframe": ("DATAFRAME", {}) 22 | } 23 | } 24 | 25 | RETURN_TYPES: tuple = ("DATAFRAME",) 26 | FUNCTION: str = "f" 27 | CATEGORY: str = "Data Analysis" 28 | 29 | def f(self, dataframe: pd.DataFrame) -> tuple: 30 | """ 31 | Drops duplicate rows from a Pandas DataFrame. 32 | 33 | Args: 34 | dataframe (DataFrame): The DataFrame. 35 | 36 | Returns: 37 | tuple: A tuple containing the DataFrame. 38 | """ 39 | return (dataframe.drop_duplicates(),) 40 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_mode.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | 5 | class PandasMode: 6 | """ 7 | Computes the mode of a pandas DataFrame. 8 | 9 | category: Summary statistics 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}) 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("DATAFRAME",) 27 | FUNCTION: str = "f" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def f(self, dataframe: pd.DataFrame) -> tuple: 31 | """ 32 | Returns a DataFrame with mode for each column. 33 | 34 | Args: 35 | dataframe (DataFrame): The DataFrame. 36 | 37 | Returns: 38 | tuple: A tuple containing the DataFrame. 39 | """ 40 | return (dataframe.mode(),) 41 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_index_to_string.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | 5 | class PandasIndexToString: 6 | """ 7 | Converts a pandas Index to a string representation. 8 | 9 | category: Display data 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the `to_string` function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "index": ("PDINDEX", {}), 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("STRING",) 27 | FUNCTION: str = "f" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def f(self, ind: pd.Index) -> tuple: 31 | """ 32 | Converts a Pandas Index to a string representation. 33 | 34 | Args: 35 | ind (pd.Index): The index. 36 | 37 | Returns: 38 | tuple: A tuple containing the string representation of the Index. 39 | """ 40 | return (str(ind),) 41 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_dropna.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | class PandasDropNA: 5 | """ 6 | Pandas Drop NA: 7 | Drops missing values from a pandas DataFrame. 8 | 9 | category: Data cleansing 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}) 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("DATAFRAME",) 27 | FUNCTION: str = "dropna" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def dropna(self, dataframe: pd.DataFrame) -> tuple: 31 | """ 32 | Returns a DataFrame with missing values removed. 33 | 34 | Args: 35 | dataframe (DataFrame): The DataFrame. 36 | 37 | Returns: 38 | tuple: A tuple containing the DataFrame. 39 | """ 40 | return (dataframe.dropna(),) 41 | -------------------------------------------------------------------------------- /modules/cda/py_float_to_string.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import datetime 3 | 4 | class PyFloatToString: 5 | """ 6 | Converts a Python float value to a Python string 7 | 8 | category: Python wrapper 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the `create` function. 15 | 16 | Returns: 17 | Dict[str, Any]: A dictionary specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "value": ("FLOAT", {"default": 0, "min": -2**63, "max": 2**63, "step": 0.00000001}) 22 | } 23 | } 24 | 25 | RETURN_TYPES: tuple = ("STRING",) 26 | FUNCTION: str = "f" 27 | CATEGORY: str = "Data Analysis" 28 | 29 | def f(self, value: float) -> tuple: 30 | """ 31 | Converts a Python float value to a Python string 32 | 33 | Args: 34 | value (float): Float value to convert. 35 | 36 | Returns: 37 | tuple: A tuple containing the converted value. 38 | """ 39 | return (str(value),) 40 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_max.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | from .utils import series_to_jsons 5 | 6 | class PandasMax: 7 | """ 8 | Computes the max of a pandas DataFrame. 9 | 10 | category: Summary statistics 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("PDSERIES",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Returns a Series with max for each column. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the Series. 40 | """ 41 | return (dataframe.max(),) 42 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_mean.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | from .utils import series_to_jsons 5 | 6 | class PandasMean: 7 | """ 8 | Computes the mean of a pandas DataFrame. 9 | 10 | category: Summary statistics 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("PDSERIES",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Returns a Series with mean for each column. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the Series. 40 | """ 41 | return (dataframe.mean(),) -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_min.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | from .utils import series_to_jsons 5 | 6 | class PandasMin: 7 | """ 8 | Computes the min of a pandas DataFrame. 9 | 10 | category: Summary statistics 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("PDSERIES",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Returns a Series with min for each column. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the Series. 40 | """ 41 | return (dataframe.min(),) 42 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_sum.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | from .utils import series_to_jsons 5 | 6 | class PandasSum: 7 | """ 8 | Computes the sum of a pandas DataFrame. 9 | 10 | category: Summary statistics 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("PDSERIES",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Returns a Series with sum for each column. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the Series. 40 | """ 41 | return (dataframe.sum(),) 42 | -------------------------------------------------------------------------------- /modules/cda/cda_int_create.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | 3 | 4 | class CDAIntCreate: 5 | """ 6 | CDA Int Create: 7 | Creates a Python int using a value entered in the text field. 8 | 9 | category: IO 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the `create` function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "data": ("STRING", {"multiline": False}), 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("INT",) 27 | FUNCTION: str = "create" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def create(self, data: str) -> tuple: 31 | """ 32 | creating a Python int for the text entered in the text field. 33 | 34 | Args: 35 | data (str): String value in the text field. 36 | 37 | Returns: 38 | tuple: A tuple containing the int converted from the text. 39 | """ 40 | return (int(data),) 41 | 42 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_isna.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | 5 | class PandasIsNA: 6 | """ 7 | Pandas Is NA: 8 | Checks a pandas DataFrame for missing values. 9 | 10 | category: Data cleansing 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "isna" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def isna(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Returns a DataFrame with boolean values with True indicating a missing value. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the DataFrame. 40 | """ 41 | return (dataframe.isna(),) 42 | -------------------------------------------------------------------------------- /modules/cda/cda_float_create.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | 3 | 4 | class CDAFloatCreate: 5 | """ 6 | CDA Float Create: 7 | Creates a Python float using a value entered in the text field. 8 | 9 | category: IO 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the `create` function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "data": ("STRING", {"multiline": False}), 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("FLOAT",) 27 | FUNCTION: str = "create" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def create(self, data: str) -> tuple: 31 | """ 32 | creating a Python float for the text entered in the text field. 33 | 34 | Args: 35 | data (str): String value in the text field. 36 | 37 | Returns: 38 | tuple: A tuple containing the float converted from the text. 39 | """ 40 | return (float(data),) 41 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_median.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | from .utils import series_to_jsons 5 | 6 | class PandasMedian: 7 | """ 8 | Computes the median of a pandas DataFrame. 9 | 10 | category: Summary statistics 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("PDSERIES",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Returns a Series with median for each column. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the Series. 40 | """ 41 | return (dataframe.median(),) 42 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_var.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | from .utils import series_to_jsons 5 | 6 | class PandasVar: 7 | """ 8 | Computes the variance of a pandas DataFrame. 9 | 10 | category: Summary statistics 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("PDSERIES",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Returns a Series with variance for each column. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the Series. 40 | """ 41 | return (dataframe.var(),) 42 | -------------------------------------------------------------------------------- /modules/cda/cda_text_create.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | 3 | 4 | class CDATextCreate: 5 | """ 6 | CDA Text Create: 7 | Creates a Python String using a value entered in a multi-line text field. 8 | 9 | category: IO 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the `create` function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "data": ("STRING", {"multiline": True}), 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("STRING",) 27 | FUNCTION: str = "create" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def create(self, data: str) -> tuple: 31 | """ 32 | creating a Python String for the text entered in the text field. 33 | 34 | Args: 35 | data (str): String value in the text field. 36 | 37 | Returns: 38 | tuple: A tuple containing the string converted from the text. 39 | """ 40 | return (data,) 41 | 42 | -------------------------------------------------------------------------------- /modules/cda/cda_string_create.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | 3 | 4 | class CDAStringCreate: 5 | """ 6 | CDA String Create: 7 | Creates a Python String using a value entered in a single-line text field. 8 | 9 | category: IO 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the `create` function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "data": ("STRING", {"multiline": False}), 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("STRING",) 27 | FUNCTION: str = "create" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def create(self, data: str) -> tuple: 31 | """ 32 | creating a Python String for the text entered in the text field. 33 | 34 | Args: 35 | data (str): String value in the text field. 36 | 37 | Returns: 38 | tuple: A tuple containing the string converted from the text. 39 | """ 40 | return (data,) 41 | 42 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_std.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | from .utils import series_to_jsons 5 | 6 | class PandasStd: 7 | """ 8 | Computes the standard deviation of a pandas DataFrame. 9 | 10 | category: Summary statistics 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("PDSERIES",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Returns a Series with standard deviation for each column. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the Series. 40 | """ 41 | return (dataframe.std(),) 42 | -------------------------------------------------------------------------------- /tests/pandas_wrapper/pandas_iloc_rows_slice_dataframe_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | import pandas as pd 5 | 6 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 7 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 8 | sys.path.append(MODULE_ROOT) 9 | 10 | from pandas_wrapper.pandas_iloc_rows_slice_dataframe import PandasIlocRowsSliceDataFrame 11 | 12 | class Test(unittest.TestCase): 13 | def setUp(self): 14 | """Set up test data""" 15 | self.node = PandasIlocRowsSliceDataFrame() 16 | 17 | self.df = pd.DataFrame({ 18 | "purchase_price": [2, 3, 4, 6, 8, 5, 6], 19 | "sales_price": [3, 6, 5, 7, 10, 4, 3], 20 | "in_stock": ["Yes", "No", "Yes", "No", "Yes", "Yes", "Yes"] 21 | }, index=["apple", "banana", "coconut", "donut", "egg", "fig", "guava"]) 22 | 23 | def test_iloc_rows_slice(self): 24 | """Test row slicing functionality""" 25 | result_df, = self.node.f(self.df, 1, 4) 26 | expected_df = self.df.iloc[1:4] 27 | pd.testing.assert_frame_equal(result_df, expected_df) 28 | 29 | if __name__ == "__main__": 30 | unittest.main() -------------------------------------------------------------------------------- /modules/cda/py_string_to_list.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import ast 3 | 4 | class PyStringToList: 5 | """ 6 | Creates a Python list using the string values entered in the text field. 7 | 8 | category: Python wrapper 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the `create` function. 15 | 16 | Returns: 17 | Dict[str, Any]: A list specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "data": ("STRING", {"multiline": True}), 22 | } 23 | } 24 | 25 | RETURN_TYPES: tuple = ("PYLIST",) 26 | FUNCTION: str = "f" 27 | CATEGORY: str = "Data Analysis" 28 | 29 | def f(self, data: str) -> tuple: 30 | """ 31 | Creates a Python list using the string values entered in the text field. 32 | 33 | Args: 34 | data (str): String value in the text field. 35 | 36 | Returns: 37 | tuple: A list converted from the input string. 38 | """ 39 | d = ast.literal_eval(data) 40 | return (d,) 41 | 42 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_columns.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | 5 | class PandasColumns: 6 | """ 7 | Retrieves the column labels of a pandas DataFrame. 8 | 9 | category: DataFrame information 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the `columns` function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}) 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("PDINDEX",) 27 | FUNCTION: str = "columns" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def columns(self, dataframe: pd.DataFrame) -> tuple: 31 | """ 32 | Returns the column labels of a pandas DataFrame. 33 | 34 | Args: 35 | dataframe (DataFrame): The DataFrame. 36 | 37 | Returns: 38 | tuple: A tuple containing a pandas.Index for columns. 39 | """ 40 | columns = dataframe.columns 41 | return (columns,) 42 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_count.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | from .utils import series_to_jsons 5 | 6 | class PandasCount: 7 | """ 8 | Computes the count of a pandas DataFrame. 9 | 10 | category: Summary statistics 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("PDSERIES",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Returns a Series with count for each column. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the Series. 40 | """ 41 | df = dataframe 42 | return (df.count(),) 43 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_index.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | class PandasIndex: 5 | """ 6 | Retrieves the row labels (index) of a pandas DataFrame. 7 | 8 | category: DataFrame information 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the `row_index` function. 15 | 16 | Returns: 17 | Dict[str, Any]: A dictionary specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "dataframe": ("DATAFRAME", {}) 22 | } 23 | } 24 | 25 | RETURN_TYPES: tuple = ("PDINDEX",) 26 | FUNCTION: str = "row_index" 27 | CATEGORY: str = "Data Analysis" 28 | 29 | def row_index(self, dataframe: pd.DataFrame) -> tuple: 30 | """ 31 | Returns the row labels (index) of a pandas DataFrame. 32 | 33 | Args: 34 | dataframe (DataFrame): The DataFrame. 35 | 36 | Returns: 37 | tuple: A tuple containing a pandas.Index for row labels. 38 | """ 39 | row_index = dataframe.index 40 | return (row_index,) 41 | -------------------------------------------------------------------------------- /modules/cda/py_string_to_dict.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import ast 3 | 4 | class PyStringToDict: 5 | """ 6 | Creates a Python dictionary using the string values entered in the text field. 7 | 8 | category: Python wrapper 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the `create` function. 15 | 16 | Returns: 17 | Dict[str, Any]: A dictionary specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "data": ("STRING", {"multiline": True}), 22 | } 23 | } 24 | 25 | RETURN_TYPES: tuple = ("PYDICT",) 26 | FUNCTION: str = "f" 27 | CATEGORY: str = "Data Analysis" 28 | 29 | def f(self, data: str) -> tuple: 30 | """ 31 | Creates a Python dictionary using the string values entered in the text field. 32 | 33 | Args: 34 | data (str): String value in the text field. 35 | 36 | Returns: 37 | tuple: A dict converted from the input string. 38 | """ 39 | d = ast.literal_eval(data) 40 | return (d,) 41 | 42 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_to_string.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | 5 | class PandasToString: 6 | """ 7 | Converts a pandas DataFrame to a string representation. 8 | 9 | category: Display data 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the `to_string` function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}), 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("STRING",) 27 | FUNCTION: str = "to_string" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def to_string(self, dataframe: pd.DataFrame) -> tuple: 31 | """ 32 | Converts a pandas DataFrame to a string representation. 33 | 34 | Args: 35 | dataframe (DataFrame): The DataFrame. 36 | 37 | Returns: 38 | tuple: A tuple containing the string representation of the DataFrame. 39 | """ 40 | return (str(dataframe),) 41 | -------------------------------------------------------------------------------- /docs/reference/sns_line.md: -------------------------------------------------------------------------------- 1 | # SNS Line Plot 2 | Generates a line plot from a pandas DataFrame using Seaborn. 3 | 4 | For plotting multiple lines, enter a comma-separated column labels in y_column_name. 5 | If you want to display a legend for each line, enter a comma-separated legend label 6 | in legend label. 7 | 8 | ![SNS Line Plot](../images/sns_line.png) 9 | 10 | The `style` parameter can be chosen from: 11 | * darkgrid (default) – Grid with a dark background. 12 | * whitegrid – Grid with a white background. 13 | * dark – Dark background, no grid. 14 | * white – White background, no grid. 15 | * ticks – White background with tick marks. 16 | 17 | The `palette` parameter can be chosen from: 18 | * deep (default) – High contrast, good for multiple categories. 19 | * muted – Softer colors, easier on the eyes. 20 | * pastel – Light colors, suitable for minimalistic styles. 21 | * bright – Vibrant and highly saturated colors. 22 | * dark – Darker, high-contrast colors. 23 | * colorblind – Optimized for color vision deficiencies. 24 | 25 | ## Output 26 | | Data type | 27 | |---| 28 | | Image | 29 | 30 |
31 | Category: Plot 32 | 33 | ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved. 34 | -------------------------------------------------------------------------------- /tests/pandas_wrapper/pandas_excel_file_sheet_names_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | import pandas as pd 5 | 6 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 7 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 8 | sys.path.append(MODULE_ROOT) 9 | from pandas_wrapper.pandas_excel_file_sheet_names import PandasExcelFileSheetNames 10 | 11 | 12 | class TestPandasExcelFileSheetNames(unittest.TestCase): 13 | def setUp(self): 14 | """Set up test data.""" 15 | self.node = PandasExcelFileSheetNames() 16 | self.test_file_path = os.path.join( 17 | os.path.dirname(__file__), "..", "..", 18 | "examples", "datasets", "test_file.xlsx") 19 | 20 | self.test_data_list = [ 21 | "Sheet1", 22 | "FruitPrice" 23 | ] 24 | 25 | def test_excel_file_sheet_names(self): 26 | """Reads sheet names from an excel file. 27 | """ 28 | expected = self.test_data_list 29 | actual = self.node.f(self.test_file_path)[0] 30 | self.assertEqual(actual, expected) 31 | 32 | 33 | if __name__ == "__main__": 34 | unittest.main() 35 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_summary.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | 5 | class PandasSummary: 6 | """ 7 | Analyzes and summarizes a pandas DataFrame. 8 | 9 | category: Summary statistics 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the `analyze_dataframe` function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}), 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("DATAFRAME",) 27 | FUNCTION: str = "analyze_dataframe" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def analyze_dataframe(self, dataframe: pd.DataFrame) -> tuple: 31 | """ 32 | Analyzes a pandas DataFrame and returns a summary. 33 | 34 | Args: 35 | dataframe (DataFrame): The DataFrame. 36 | 37 | Returns: 38 | tuple: A tuple containing the DataFrame summary. 39 | """ 40 | summary = dataframe.describe() 41 | return (summary,) 42 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_series_to_string.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | from .utils import jsons_to_series 5 | 6 | class PandasSeriesToString: 7 | """ 8 | Converts a pandas Series to a string representation. 9 | 10 | category: Display data 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the `to_string` function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "series": ("PDSERIES", {}), 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("STRING",) 28 | FUNCTION: str = "series_to_string" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def series_to_string(self, series: pd.Series) -> tuple: 32 | """ 33 | Converts a Pandas Series to a string representation. 34 | 35 | Args: 36 | series (Series): The Series. 37 | 38 | Returns: 39 | tuple: A tuple containing the string representation of the Series. 40 | """ 41 | return (str(series),) 42 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_corr.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | 5 | class PandasCorr: 6 | """ 7 | Computes the correlation of the DataFrame. You can select from the Pearson, Kendall or Spearman methods. 8 | 9 | category: Summary statistics 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}), 23 | "method": (("pearson", "kendall", "spearman"),) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame, method: str) -> tuple: 32 | """ 33 | Computes the correlation of the DataFrame. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the result. 40 | """ 41 | return (dataframe.corr(method),) 42 | -------------------------------------------------------------------------------- /modules/cda/py_kv_string_create.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | 3 | 4 | class PyKvStringCreate: 5 | """ 6 | Creates a Python dictionary with a string key and a string value. 7 | 8 | category: Python wrapper 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the `create` function. 15 | 16 | Returns: 17 | Dict[str, Any]: A dictionary specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "key": ("STRING", {"multiline": False}), 22 | "value": ("STRING", {"multiline": True}) 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("PYDICT",) 27 | FUNCTION: str = "f" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def f(self, key: str, value: float) -> tuple: 31 | """ 32 | Creates a Python dictionary with a string key and a string value. 33 | 34 | Args: 35 | key (str): String key for the dictionary. 36 | value (str): String value for the dictionary. 37 | 38 | Returns: 39 | tuple: A tuple containing the dictionary. 40 | """ 41 | return ({key:value},) 42 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_as_string.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | 5 | class PandasAsString: 6 | """ 7 | Converts all cells in a pandas DataFrame to string type. 8 | 9 | category: Data type conversion 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}) 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("DATAFRAME",) 27 | FUNCTION: str = "convert_to_string" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def convert_to_string(self, dataframe: pd.DataFrame) -> tuple: 31 | """ 32 | Converts all cells in the DataFrame to string type. 33 | 34 | Args: 35 | dataframe (DataFrame): The DataFrame. 36 | 37 | Returns: 38 | tuple: A tuple containing the DataFrame with all values as strings. 39 | """ 40 | # Convert all values to string 41 | df = dataframe.astype(str) 42 | return (df,) 43 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_to_numpy.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | class PandasToNumpy: 5 | """ 6 | Converts a pandas DataFrame to Numpy ndarray. 7 | 8 | category: Data type conversion 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the function. 15 | 16 | Returns: 17 | Dict[str, Any]: A dictionary specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "dataframe": ("DATAFRAME", {}), 22 | } 23 | } 24 | 25 | RETURN_TYPES: tuple = ("NDARRAY",) 26 | FUNCTION: str = "f" 27 | CATEGORY: str = "Data Analysis" 28 | 29 | def f(self, dataframe: pd.DataFrame) -> tuple: 30 | """ 31 | Converts a pandas DataFrame to a NumPy ndarray. 32 | 33 | Args: 34 | dataframe (DataFrame): The DataFrame. 35 | 36 | Returns: 37 | tuple: A tuple containing the NumPy representation of the DataFrame. 38 | """ 39 | if not isinstance(dataframe, pd.DataFrame): 40 | raise TypeError("PandasToNumpy expects pd.DataFrame.") 41 | return (dataframe.to_numpy(),) 42 | -------------------------------------------------------------------------------- /tests/cda/utils_str_to_number_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | 5 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 6 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 7 | sys.path.append(MODULE_ROOT) 8 | 9 | from cda.utils import str_to_number 10 | 11 | class TestUtils(unittest.TestCase): 12 | def test_str_to_number(self): 13 | # Test integer conversion 14 | self.assertEqual(str_to_number("42"), 42) 15 | 16 | # Test float conversion 17 | self.assertEqual(str_to_number("3.14"), 3.14) 18 | 19 | # Test negative integer 20 | self.assertEqual(str_to_number("-10"), -10) 21 | 22 | # Test negative float 23 | self.assertEqual(str_to_number("-2.71"), -2.71) 24 | 25 | # Test zero 26 | self.assertEqual(str_to_number("0"), 0) 27 | self.assertEqual(str_to_number("0.0"), 0.0) 28 | 29 | # Test invalid input (empty string) 30 | with self.assertRaises(ValueError): 31 | str_to_number("") 32 | 33 | # Test invalid input (non-numeric string) 34 | with self.assertRaises(ValueError): 35 | str_to_number("abc") 36 | 37 | if __name__ == "__main__": 38 | unittest.main() 39 | 40 | -------------------------------------------------------------------------------- /modules/cda/py_kv_int_create.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | 3 | 4 | class PyKvIntCreate: 5 | """ 6 | Creates a Python dictionary with an string key and an integer value. 7 | 8 | category: Python wrapper 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the `create` function. 15 | 16 | Returns: 17 | Dict[str, Any]: A dictionary specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "key": ("STRING", {"multiline": False}), 22 | "value": ("INT", {"default": 0, "min": -2**31, "max": 2**31}) 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("PYDICT",) 27 | FUNCTION: str = "f" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def f(self, key: str, value: int) -> tuple: 31 | """ 32 | Creates a Python dictionary with an string key and an integer value. 33 | 34 | Args: 35 | key (str): String key for the dictionary. 36 | value (int): Integer value for the dictionary. 37 | 38 | Returns: 39 | tuple: A tuple containing the dictionary. 40 | """ 41 | return ({key:value},) 42 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_create.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | 5 | 6 | class PandasCreate: 7 | """ 8 | Creates a pandas DataFrame using values entered in the text field. 9 | 10 | category: IO 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the `create` function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "data": ("STRING", {"multiline": True}), 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "create" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def create(self, data: str) -> tuple: 32 | """ 33 | Create a pandas DataFrame using values entered in the text field and converts it to a DataFrame. 34 | 35 | Args: 36 | data (str): String value in the text field. 37 | 38 | Returns: 39 | tuple: A tuple containing a the DataFrame. 40 | """ 41 | # Read CSV file into DataFrame 42 | df = pd.read_csv(StringIO(data)) 43 | return (df,) 44 | -------------------------------------------------------------------------------- /modules/cda/py_kv_float_create.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | 3 | 4 | class PyKvFloatCreate: 5 | """ 6 | Creates a Python dictionary with a string key and a float value. 7 | 8 | category: Python wrapper 9 | """ 10 | 11 | @classmethod 12 | def INPUT_TYPES(cls) -> Dict[str, Any]: 13 | """ 14 | Defines the input types for the `create` function. 15 | 16 | Returns: 17 | Dict[str, Any]: A dictionary specifying required input types. 18 | """ 19 | return { 20 | "required": { 21 | "key": ("STRING", {"multiline": False}), 22 | "value": ("FLOAT", {"default": 0, "min": -2**63, "max": 2**63, "step": 0.00000001}) 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("PYDICT",) 27 | FUNCTION: str = "f" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def f(self, key: str, value: float) -> tuple: 31 | """ 32 | Creates a Python dictionary with a string key and a float value. 33 | 34 | Args: 35 | key (str): String key for the dictionary. 36 | value (float): Float value for the dictionary. 37 | 38 | Returns: 39 | tuple: A tuple containing the dictionary. 40 | """ 41 | return ({key:value},) 42 | -------------------------------------------------------------------------------- /web/js/SaveCSV.js: -------------------------------------------------------------------------------- 1 | /* 2 | This code is based on 3 | https://github.com/pythongosssss/ComfyUI-Custom-Scripts/blob/main/web/js/showText.js 4 | 5 | See credit/credit.md for the full license. 6 | */ 7 | 8 | import { app } from "../../../scripts/app.js"; 9 | import { ComfyWidgets } from "../../../scripts/widgets.js"; 10 | 11 | // Displays input text on a node 12 | app.registerExtension({ 13 | name: "HowToSD.SaveCSV", 14 | async beforeRegisterNodeDef(nodeType, nodeData, app) { 15 | if (nodeData.name === "PandasSaveCSV") { // This needs to match NODE_CLASS_MAPPINGS in Python 16 | function populate(text) { 17 | // No op as we are not updating the node's UI for now. 18 | } 19 | 20 | // When the node is executed we will be sent the input text, display this in the widget 21 | const onExecuted = nodeType.prototype.onExecuted; 22 | nodeType.prototype.onExecuted = function (message) { 23 | onExecuted?.apply(this, arguments); 24 | populate.call(this, message.text); 25 | }; 26 | 27 | const onConfigure = nodeType.prototype.onConfigure; 28 | nodeType.prototype.onConfigure = function () { 29 | onConfigure?.apply(this, arguments); 30 | if (this.widgets_values?.length) { 31 | populate.call(this, this.widgets_values.slice(+this.widgets_values.length > 1)); 32 | } 33 | }; 34 | } 35 | }, 36 | }); -------------------------------------------------------------------------------- /web/js/SaveJSON.js: -------------------------------------------------------------------------------- 1 | /* 2 | This code is based on 3 | https://github.com/pythongosssss/ComfyUI-Custom-Scripts/blob/main/web/js/showText.js 4 | 5 | See credit/credit.md for the full license. 6 | */ 7 | 8 | import { app } from "../../../scripts/app.js"; 9 | import { ComfyWidgets } from "../../../scripts/widgets.js"; 10 | 11 | // Displays input text on a node 12 | app.registerExtension({ 13 | name: "HowToSD.SaveJSON", 14 | async beforeRegisterNodeDef(nodeType, nodeData, app) { 15 | if (nodeData.name === "PandasSaveJSON") { // This needs to match NODE_CLASS_MAPPINGS in Python 16 | function populate(text) { 17 | // No op as we are not updating the node's UI for now. 18 | } 19 | 20 | // When the node is executed we will be sent the input text, display this in the widget 21 | const onExecuted = nodeType.prototype.onExecuted; 22 | nodeType.prototype.onExecuted = function (message) { 23 | onExecuted?.apply(this, arguments); 24 | populate.call(this, message.text); 25 | }; 26 | 27 | const onConfigure = nodeType.prototype.onConfigure; 28 | nodeType.prototype.onConfigure = function () { 29 | onConfigure?.apply(this, arguments); 30 | if (this.widgets_values?.length) { 31 | populate.call(this, this.widgets_values.slice(+this.widgets_values.length > 1)); 32 | } 33 | }; 34 | } 35 | }, 36 | }); -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_as_float.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | 5 | 6 | class PandasAsFloat: 7 | """ 8 | Converts all cells in a pandas DataFrame to float type. 9 | 10 | category: Data type conversion 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Converts all cells in the DataFrame to float type. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the DataFrame with all values as floats. 40 | """ 41 | # Convert all values to float, non-numeric values become NaN 42 | df = dataframe.apply(pd.to_numeric, errors='coerce').astype(float) 43 | return (df,) 44 | -------------------------------------------------------------------------------- /tests/cda/utils_str_to_number_with_default_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | 5 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 6 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 7 | sys.path.append(MODULE_ROOT) 8 | 9 | from cda.utils import str_to_number_with_default 10 | 11 | class TestUtils(unittest.TestCase): 12 | def test_str_to_number_with_default(self): 13 | # Test integer conversion 14 | self.assertEqual(str_to_number_with_default("42", 0), 42) 15 | 16 | # Test float conversion 17 | self.assertEqual(str_to_number_with_default("3.14", 0.0), 3.14) 18 | 19 | # Test negative integer 20 | self.assertEqual(str_to_number_with_default("-10", 0), -10) 21 | 22 | # Test negative float 23 | self.assertEqual(str_to_number_with_default("-2.71", 0.0), -2.71) 24 | 25 | # Test zero 26 | self.assertEqual(str_to_number_with_default("0", 1), 0) 27 | self.assertEqual(str_to_number_with_default("0.0", 1.0), 0.0) 28 | 29 | # Test empty string returning default value 30 | self.assertEqual(str_to_number_with_default("", 42), 42) 31 | self.assertEqual(str_to_number_with_default("", -3.5), -3.5) 32 | 33 | if __name__ == "__main__": 34 | unittest.main() 35 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_as_int.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | 5 | 6 | class PandasAsInt: 7 | """ 8 | Converts all cells in a pandas DataFrame to integer type. 9 | 10 | category: Data type conversion 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Converts all cells in the DataFrame to integer type. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the DataFrame with all values as integers. 40 | """ 41 | # Convert all values to integer, non-numeric values become NaN 42 | df = dataframe.apply(pd.to_numeric, errors='coerce').astype('Int64') 43 | return (df,) 44 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_exp.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | import numpy as np 4 | 5 | 6 | class PandasExp: 7 | """ 8 | Apply the exponential function to a pandas DataFrame and converting non-numeric values to NaN. 9 | 10 | category: Math 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Converts non-numeric values to NaN and applies the exponential function to the DataFrame. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the processed DataFrame. 40 | """ 41 | dataframe = dataframe.apply(pd.to_numeric, errors='coerce') 42 | dataframe = np.exp(dataframe) 43 | return (dataframe,) 44 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_add_scalar_int.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | 5 | class PandasAddScalarInt: 6 | """ 7 | Adds an integer to a Pandas DataFrame. 8 | 9 | category: Arithmetic method 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}), 23 | "int_scalar": ("INT", {"default": 0, "min": -2**31, "max": 2**31}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame, int_scalar: int) -> tuple: 32 | """ 33 | Adds an integer to a Pandas DataFrame. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | int_scalar (DataFrame): The scalar value to add. 38 | 39 | Returns: 40 | tuple: A tuple containing the DataFrame containing the result. 41 | """ 42 | df_out = dataframe + int_scalar 43 | return (df_out,) 44 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_mul.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | 5 | 6 | class PandasMul: 7 | """ 8 | Multiplies two pandas DataFrames. 9 | 10 | category: Arithmetic method 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "a_dataframe": ("DATAFRAME", {}), 24 | "b_dataframe": ("DATAFRAME", {}) 25 | } 26 | } 27 | 28 | RETURN_TYPES: tuple = ("DATAFRAME",) 29 | FUNCTION: str = "f" 30 | CATEGORY: str = "Data Analysis" 31 | 32 | def f(self, a_dataframe: pd.DataFrame, b_dataframe: pd.DataFrame) -> tuple: 33 | """ 34 | Multiply two pandas DataFrames. 35 | 36 | Args: 37 | a_dataframe (DataFrame): The left DataFrame. 38 | b_dataframe (DataFrame): The right DataFrame. 39 | 40 | Returns: 41 | tuple: A tuple containing the DataFrame containing the result of multiplication. 42 | """ 43 | df_out = a_dataframe.mul(b_dataframe) 44 | return (df_out,) 45 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_load_csv.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | 5 | 6 | class PandasLoadCSV: 7 | """ 8 | Pandas Load CSV: 9 | Loads CSV files into a pandas DataFrame. 10 | 11 | category: IO 12 | """ 13 | 14 | @classmethod 15 | def INPUT_TYPES(cls) -> Dict[str, Any]: 16 | """ 17 | Defines the input types for the `load_csv` function. 18 | 19 | Returns: 20 | Dict[str, Any]: A dictionary specifying required input types. 21 | """ 22 | return { 23 | "required": { 24 | "file_path": ("STRING", {"multiline": False}), 25 | } 26 | } 27 | 28 | RETURN_TYPES: tuple = ("DATAFRAME",) 29 | FUNCTION: str = "load_csv" 30 | CATEGORY: str = "Data Analysis" 31 | 32 | @classmethod 33 | def IS_CHANGED(cls, **kw): 34 | return float("NaN") 35 | 36 | def load_csv(self, file_path: str) -> tuple: 37 | """ 38 | Loads a CSV file into a pandas DataFrame. 39 | 40 | Args: 41 | file_path (str): The path to the CSV file. 42 | 43 | Returns: 44 | tuple: A tuple containing a DataFrame. 45 | """ 46 | # Read CSV file into DataFrame 47 | df = pd.read_csv(file_path) 48 | return (df,) 49 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_log.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | import numpy as np 4 | 5 | 6 | class PandasLog: 7 | """ 8 | Applying the natural logarithm function to a pandas DataFrame and converting non-numeric values to NaN. 9 | 10 | category: Math 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Converts non-numeric values to NaN and applies the natural logarithm function to the DataFrame. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | 38 | Returns: 39 | tuple: A tuple containing the processed DataFrame. 40 | """ 41 | dataframe = dataframe.apply(pd.to_numeric, errors='coerce') 42 | dataframe = np.log(dataframe) 43 | return (dataframe,) 44 | -------------------------------------------------------------------------------- /modules/cda/cda_json_create.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import json 3 | 4 | class CDAJSONCreate: 5 | """ 6 | CDA JSON Create: 7 | Creates a serialized JSON object using values entered in the text field. 8 | 9 | category: IO 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the `create` function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "data": ("STRING", {"multiline": True}), 23 | } 24 | } 25 | 26 | RETURN_TYPES: tuple = ("STRING",) 27 | FUNCTION: str = "create" 28 | CATEGORY: str = "Data Analysis" 29 | 30 | def create(self, data: str) -> tuple: 31 | """ 32 | creating a serialized JSON object using values entered in the text field. 33 | 34 | Args: 35 | data (str): String value in the text field. 36 | 37 | Returns: 38 | tuple: A tuple containing a JSON string. 39 | """ 40 | # Convert to JSON 41 | json_obj = json.loads(data) 42 | 43 | # Serialize to a string 44 | result_jsons = json.dumps(json_obj) 45 | 46 | return (result_jsons,) 47 | 48 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_div.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | 5 | 6 | class PandasDiv: 7 | """ 8 | Divides a Pandas DataFrame by another DataFrame. 9 | 10 | category: Arithmetic method 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "a_dataframe": ("DATAFRAME", {}), 24 | "b_dataframe": ("DATAFRAME", {}) 25 | } 26 | } 27 | 28 | RETURN_TYPES: tuple = ("DATAFRAME",) 29 | FUNCTION: str = "f" 30 | CATEGORY: str = "Data Analysis" 31 | 32 | def f(self, a_dataframe: pd.DataFrame, b_dataframe: pd.DataFrame) -> tuple: 33 | """ 34 | Divide two pandas DataFrames. 35 | 36 | Args: 37 | a_dataframe (DataFrame): The left DataFrame. 38 | b_dataframe (DataFrame): The right DataFrame. 39 | 40 | Returns: 41 | tuple: A tuple containing the DataFrame containing the result of division. 42 | """ 43 | df_out = a_dataframe.div(b_dataframe) 44 | return (df_out,) 45 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_head.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | 5 | 6 | class PandasHead: 7 | """ 8 | Retrieves the first few rows of a pandas DataFrame. 9 | 10 | category: Data subset selection 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the `head` function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "dataframe": ("DATAFRAME", {}), 24 | "rows": ("INT", {"default": 10, "min": 0, "max": 50}) 25 | } 26 | } 27 | 28 | RETURN_TYPES: tuple = ("DATAFRAME",) 29 | FUNCTION: str = "head" 30 | CATEGORY: str = "Data Analysis" 31 | 32 | def head(self, dataframe: pd.DataFrame, rows: int) -> tuple: 33 | """ 34 | Returns the first `rows` rows of a pandas DataFrame. 35 | 36 | Args: 37 | dataframe (DataFrame): The DataFrame. 38 | rows (int): The number of rows to retrieve. 39 | 40 | Returns: 41 | tuple: A tuple containing the resulting DataFrame. 42 | """ 43 | df2 = dataframe.head(rows) 44 | return (df2,) 45 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_sub_scalar_int.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | 5 | class PandasSubScalarInt: 6 | """ 7 | Subtracts an integer from a Pandas DataFrame. 8 | 9 | category: Arithmetic method 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}), 23 | "int_scalar": ("INT", {"default": 0, "min": -2**31, "max": 2**31}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame, int_scalar: int) -> tuple: 32 | """ 33 | Subtracts an integer from a Pandas DataFrame. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | int_scalar (DataFrame): The scalar value to subtract. 38 | 39 | Returns: 40 | tuple: A tuple containing the DataFrame containing the result. 41 | """ 42 | df_out = dataframe - int_scalar 43 | return (df_out,) 44 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_vertical_concat.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | 5 | class PandasVerticalConcat: 6 | """ 7 | Vertically concatenates two pandas DataFrames. 8 | 9 | category: Transformation 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "a_dataframe": ("DATAFRAME", {}), 23 | "b_dataframe": ("DATAFRAME", {}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, a_dataframe: pd.DataFrame, b_dataframe: pd.DataFrame) -> tuple: 32 | """ 33 | Vertically concatenate two pandas DataFrames. 34 | 35 | Args: 36 | a_dataframe (DataFrame): The first DataFrame. 37 | b_dataframe (DataFrame): The second DataFrame. 38 | 39 | Returns: 40 | tuple: A tuple containing the concatenated DataFrame. 41 | """ 42 | df_out = pd.concat([a_dataframe, b_dataframe], axis=0, ignore_index=True) 43 | return (df_out,) 44 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_div_scalar_int.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | 5 | class PandasDivScalarInt: 6 | """ 7 | Divides a Pandas DataFrame by an integer. 8 | 9 | category: Arithmetic method 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}), 23 | "int_scalar": ("INT", {"default": 1, "min": -2**31, "max": 2**31}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame, int_scalar: int) -> tuple: 32 | """ 33 | Divides a Pandas DataFrame by an integer. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame to be divided. 37 | int_scalar (DataFrame): The scalar value to divide by. 38 | 39 | Returns: 40 | tuple: A tuple containing the DataFrame containing the result of division. 41 | """ 42 | df_out = dataframe / int_scalar 43 | return (df_out,) 44 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_add_scalar_float.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | 5 | class PandasAddScalarFloat: 6 | """ 7 | Adds a floating-point number to a Pandas DataFrame. 8 | 9 | category: Arithmetic method 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}), 23 | "float_scalar": ("FLOAT", {"default": 0.0, "min": -2**31, "max": 2**31}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame, float_scalar: float) -> tuple: 32 | """ 33 | Adds a floating-point number to a Pandas DataFrame. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | float_scalar (DataFrame): The scalar value to add. 38 | 39 | Returns: 40 | tuple: A tuple containing the DataFrame containing the result. 41 | """ 42 | df_out = dataframe + float_scalar 43 | return (df_out,) 44 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_create_from_numpy.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | import numpy as np 4 | 5 | 6 | class PandasCreateFromNumpy: 7 | """ 8 | Creates a pandas DataFrame from a NumPy ndarray. 9 | 10 | category: IO 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the `create` function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "data": ("NDARRAY", {}), 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, data: np.ndarray) -> tuple: 32 | """ 33 | Creates a pandas DataFrame from a NumPy ndarray. 34 | 35 | Args: 36 | data (np.ndarray): A NumPy array. 37 | 38 | Returns: 39 | tuple: A tuple containing the DataFrame. 40 | 41 | Raises: 42 | ValueError: If the array is not rank 1 or rank 2. 43 | """ 44 | if len(data.shape) not in [1, 2]: 45 | raise ValueError("Only rank 1 and rank 2 arrays are supported.") 46 | 47 | return (pd.DataFrame(data),) 48 | 49 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_sub.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | from io import StringIO 3 | import pandas as pd 4 | 5 | 6 | class PandasSub: 7 | """ 8 | Subtracts a Pandas DataFrame from another DataFrame. 9 | 10 | category: Arithmetic method 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "a_dataframe": ("DATAFRAME", {}), 24 | "b_dataframe": ("DATAFRAME", {}) 25 | } 26 | } 27 | 28 | RETURN_TYPES: tuple = ("DATAFRAME",) 29 | FUNCTION: str = "f" 30 | CATEGORY: str = "Data Analysis" 31 | 32 | def f(self, a_dataframe: pd.DataFrame, b_dataframe: pd.DataFrame) -> tuple: 33 | """ 34 | Subtracts a Pandas DataFrame from another DataFrame. 35 | 36 | Args: 37 | a_dataframe (DataFrame): The left DataFrame. 38 | b_dataframe (DataFrame): The right DataFrame. 39 | 40 | Returns: 41 | tuple: A tuple containing the DataFrame containing the result of subtraction. 42 | """ 43 | df_out = a_dataframe.sub(b_dataframe) 44 | return (df_out,) 45 | -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_pow_scalar_int.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | 4 | 5 | class PandasPowScalarInt: 6 | """ 7 | Raises a Pandas DataFrame to the power of an integer. 8 | 9 | category: Arithmetic method 10 | """ 11 | 12 | @classmethod 13 | def INPUT_TYPES(cls) -> Dict[str, Any]: 14 | """ 15 | Defines the input types for the function. 16 | 17 | Returns: 18 | Dict[str, Any]: A dictionary specifying required input types. 19 | """ 20 | return { 21 | "required": { 22 | "dataframe": ("DATAFRAME", {}), 23 | "int_scalar": ("INT", {"default": 1, "min": -2**31, "max": 2**31}) 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, dataframe: pd.DataFrame, int_scalar: int) -> tuple: 32 | """ 33 | Raises a Pandas DataFrame to the power of a integer. 34 | 35 | Args: 36 | dataframe (DataFrame): The DataFrame. 37 | int_scalar (DataFrame): The scalar value containing the power. 38 | 39 | Returns: 40 | tuple: A tuple containing the DataFrame containing the result. 41 | """ 42 | df_out = dataframe.pow(int_scalar) 43 | return (df_out,) 44 | -------------------------------------------------------------------------------- /tests/cda/py_string_to_datetime_test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import unittest 4 | from datetime import datetime 5 | 6 | PROJECT_ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..")) 7 | MODULE_ROOT = os.path.join(PROJECT_ROOT, "modules") 8 | sys.path.append(MODULE_ROOT) 9 | from cda.py_string_to_datetime import PyStringToDatetime 10 | 11 | class TestPyStringToDatetime(unittest.TestCase): 12 | def setUp(self): 13 | """Set up test data.""" 14 | self.node = PyStringToDatetime() 15 | self.test_cases = [ 16 | ("2023-03-15 12:00:00", "%Y-%m-%d %H:%M:%S", datetime(2023, 3, 15, 12, 0, 0)), 17 | ("2024-06-01 09:30:00", "%Y-%m-%d %H:%M:%S", datetime(2024, 6, 1, 9, 30, 0)), 18 | ("15/03/2023 12:00", "%d/%m/%Y %H:%M", datetime(2023, 3, 15, 12, 0)), 19 | ("01-06-2024", "%d-%m-%Y", datetime(2024, 6, 1)) 20 | ] 21 | 22 | def test_string_to_datetime(self): 23 | """Test converting a string to datetime.""" 24 | for value, date_format, expected in self.test_cases: 25 | with self.subTest(value=value, date_format=date_format): 26 | retval = self.node.f(value=value, date_format=date_format)[0] 27 | self.assertEqual(retval, expected, f"Mismatch for value={value} with format={date_format}") 28 | 29 | if __name__ == "__main__": 30 | unittest.main() -------------------------------------------------------------------------------- /modules/pandas_wrapper/pandas_create_from_tensor.py: -------------------------------------------------------------------------------- 1 | from typing import Any, Dict 2 | import pandas as pd 3 | import torch 4 | 5 | 6 | class PandasCreateFromTensor: 7 | """ 8 | Creates a pandas DataFrame from a PyTorch tensor. 9 | 10 | category: IO 11 | """ 12 | 13 | @classmethod 14 | def INPUT_TYPES(cls) -> Dict[str, Any]: 15 | """ 16 | Defines the input types for the `create` function. 17 | 18 | Returns: 19 | Dict[str, Any]: A dictionary specifying required input types. 20 | """ 21 | return { 22 | "required": { 23 | "tens": ("TENSOR", {}), 24 | } 25 | } 26 | 27 | RETURN_TYPES: tuple = ("DATAFRAME",) 28 | FUNCTION: str = "f" 29 | CATEGORY: str = "Data Analysis" 30 | 31 | def f(self, tens: torch.Tensor) -> tuple: 32 | """ 33 | Creates a pandas DataFrame from a PyTorch tensor. 34 | 35 | Args: 36 | tens (torch.Tensor): A PyTorch tensor. 37 | 38 | Returns: 39 | tuple: A tuple containing the DataFrame. 40 | 41 | Raises: 42 | ValueError: If the tensor is not rank 1 or rank 2. 43 | """ 44 | if tens.dim() not in [1, 2]: 45 | raise ValueError("Only rank 1 and rank 2 tensors are supported.") 46 | 47 | return (pd.DataFrame(tens.numpy()),) 48 | 49 | --------------------------------------------------------------------------------