Added Pandas Set Index node
This commit is contained in:
@@ -52,6 +52,10 @@
|
||||
| [Pandas Loc Row Series](pandas_loc_row_series.md) | Selects a row from a pandas DataFrame and output as a Series. |
|
||||
| [Pandas Select Columns](pandas_select_columns.md) | Selects specific columns from a pandas DataFrame. |
|
||||
| [Pandas Select Rows](pandas_select_rows.md) | Selects specific rows from a pandas DataFrame based on a condition. |
|
||||
## Data transformation
|
||||
| Node | Description |
|
||||
| --- | --- |
|
||||
| [Pandas Set Index](pandas_set_index.md) | Create index (row label) from existing column or columns. |
|
||||
## Data type conversion
|
||||
| Node | Description |
|
||||
| --- | --- |
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# Pandas Set Index
|
||||
Create index (row label) from existing column or columns.
|
||||
|
||||
You can specify a single column or a comma-separated list of column labels in `column_names`.
|
||||
If `drop=True`, the specified columns are removed from column labels and become the index.
|
||||
If `drop=False`, the columns remain in the DataFrame column labels while also being used as the index.
|
||||
If `append=True`, the new index is added alongside the existing index.
|
||||
|
||||
Below screenshots illustrate these options:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
This class internally calls `pandas.DataFrame.set_index()`.
|
||||
|
||||
## Input
|
||||
| Name | Data type |
|
||||
|---|---|
|
||||
| dataframe | DataFrame |
|
||||
| column_names | String |
|
||||
| drop | Boolean |
|
||||
| append | Boolean |
|
||||
|
||||
## Output
|
||||
| Data type |
|
||||
|---|
|
||||
| DataFrame |
|
||||
|
||||
<HR>
|
||||
Category: Data transformation
|
||||
|
||||
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
|
||||
Reference in New Issue
Block a user