Added Pandas Add Scalar Float/Int, Div Scalar Float/Int, Mul Scalar Float/Int, Sub Scalar Float/Int, Pow Scalar Float/Int nodes.
This commit is contained in:
+30
@@ -10,6 +10,8 @@ from .modules.matplotlib.mpl_bar import MPLBar
|
||||
from .modules.matplotlib.mpl_line import MPLLine
|
||||
from .modules.matplotlib.mpl_scatter import MPLScatter
|
||||
from .modules.pandas_wrapper.pandas_add import PandasAdd
|
||||
from .modules.pandas_wrapper.pandas_add_scalar_float import PandasAddScalarFloat
|
||||
from .modules.pandas_wrapper.pandas_add_scalar_int import PandasAddScalarInt
|
||||
from .modules.pandas_wrapper.pandas_add_series import PandasAddSeries
|
||||
from .modules.pandas_wrapper.pandas_as_float import PandasAsFloat
|
||||
from .modules.pandas_wrapper.pandas_as_int import PandasAsInt
|
||||
@@ -23,6 +25,8 @@ from .modules.pandas_wrapper.pandas_cummin import PandasCummin
|
||||
from .modules.pandas_wrapper.pandas_cumprod import PandasCumprod
|
||||
from .modules.pandas_wrapper.pandas_cumsum import PandasCumsum
|
||||
from .modules.pandas_wrapper.pandas_div import PandasDiv
|
||||
from .modules.pandas_wrapper.pandas_div_scalar_float import PandasDivScalarFloat
|
||||
from .modules.pandas_wrapper.pandas_div_scalar_int import PandasDivScalarInt
|
||||
from .modules.pandas_wrapper.pandas_div_series import PandasDivSeries
|
||||
from .modules.pandas_wrapper.pandas_dropna import PandasDropNA
|
||||
from .modules.pandas_wrapper.pandas_exp import PandasExp
|
||||
@@ -53,8 +57,12 @@ from .modules.pandas_wrapper.pandas_median import PandasMedian
|
||||
from .modules.pandas_wrapper.pandas_min import PandasMin
|
||||
from .modules.pandas_wrapper.pandas_mode import PandasMode
|
||||
from .modules.pandas_wrapper.pandas_mul import PandasMul
|
||||
from .modules.pandas_wrapper.pandas_mul_scalar_float import PandasMulScalarFloat
|
||||
from .modules.pandas_wrapper.pandas_mul_scalar_int import PandasMulScalarInt
|
||||
from .modules.pandas_wrapper.pandas_mul_series import PandasMulSeries
|
||||
from .modules.pandas_wrapper.pandas_pow import PandasPow
|
||||
from .modules.pandas_wrapper.pandas_pow_scalar_float import PandasPowScalarFloat
|
||||
from .modules.pandas_wrapper.pandas_pow_scalar_int import PandasPowScalarInt
|
||||
from .modules.pandas_wrapper.pandas_pow_series import PandasPowSeries
|
||||
from .modules.pandas_wrapper.pandas_rename import PandasRename
|
||||
from .modules.pandas_wrapper.pandas_replace import PandasReplace
|
||||
@@ -71,6 +79,8 @@ from .modules.pandas_wrapper.pandas_show_text import PandasShowText
|
||||
from .modules.pandas_wrapper.pandas_sort import PandasSort
|
||||
from .modules.pandas_wrapper.pandas_std import PandasStd
|
||||
from .modules.pandas_wrapper.pandas_sub import PandasSub
|
||||
from .modules.pandas_wrapper.pandas_sub_scalar_float import PandasSubScalarFloat
|
||||
from .modules.pandas_wrapper.pandas_sub_scalar_int import PandasSubScalarInt
|
||||
from .modules.pandas_wrapper.pandas_sub_series import PandasSubSeries
|
||||
from .modules.pandas_wrapper.pandas_sum import PandasSum
|
||||
from .modules.pandas_wrapper.pandas_summary import PandasSummary
|
||||
@@ -94,6 +104,8 @@ NODE_CLASS_MAPPINGS: Dict[str, Type[T]] = {
|
||||
"MPLLine": MPLLine,
|
||||
"MPLScatter": MPLScatter,
|
||||
"PandasAdd": PandasAdd,
|
||||
"PandasAddScalarFloat": PandasAddScalarFloat,
|
||||
"PandasAddScalarInt": PandasAddScalarInt,
|
||||
"PandasAddSeries": PandasAddSeries,
|
||||
"PandasAsFloat": PandasAsFloat,
|
||||
"PandasAsInt": PandasAsInt,
|
||||
@@ -107,6 +119,8 @@ NODE_CLASS_MAPPINGS: Dict[str, Type[T]] = {
|
||||
"PandasCumprod": PandasCumprod,
|
||||
"PandasCumsum": PandasCumsum,
|
||||
"PandasDiv": PandasDiv,
|
||||
"PandasDivScalarFloat": PandasDivScalarFloat,
|
||||
"PandasDivScalarInt": PandasDivScalarInt,
|
||||
"PandasDivSeries": PandasDivSeries,
|
||||
"PandasDropNA": PandasDropNA,
|
||||
"PandasExp": PandasExp,
|
||||
@@ -137,10 +151,14 @@ NODE_CLASS_MAPPINGS: Dict[str, Type[T]] = {
|
||||
"PandasMin": PandasMin,
|
||||
"PandasMode": PandasMode,
|
||||
"PandasMul": PandasMul,
|
||||
"PandasMulScalarFloat": PandasMulScalarFloat,
|
||||
"PandasMulScalarInt": PandasMulScalarInt,
|
||||
"PandasMulSeries": PandasMulSeries,
|
||||
"PandasRename": PandasRename,
|
||||
"PandasReplace": PandasReplace,
|
||||
"PandasPow": PandasPow,
|
||||
"PandasPowScalarFloat": PandasPowScalarFloat,
|
||||
"PandasPowScalarInt": PandasPowScalarInt,
|
||||
"PandasPowSeries": PandasPowSeries,
|
||||
"PandasSaveCSV": PandasSaveCSV,
|
||||
"PandasSaveJSON": PandasSaveJSON,
|
||||
@@ -155,6 +173,8 @@ NODE_CLASS_MAPPINGS: Dict[str, Type[T]] = {
|
||||
"PandasSort": PandasSort,
|
||||
"PandasStd": PandasStd,
|
||||
"PandasSub": PandasSub,
|
||||
"PandasSubScalarFloat": PandasSubScalarFloat,
|
||||
"PandasSubScalarInt": PandasSubScalarInt,
|
||||
"PandasSubSeries": PandasSubSeries,
|
||||
"PandasSum": PandasSum,
|
||||
"PandasSummary": PandasSummary,
|
||||
@@ -181,6 +201,8 @@ NODE_DISPLAY_NAME_MAPPINGS: Dict[str, str] = {
|
||||
"MPLLine": "MPL Line Plot",
|
||||
"MPLScatter": "MPL Scatter Plot",
|
||||
"PandasAdd": "Pandas Add",
|
||||
"PandasAddScalarFloat": "Pandas Add Scalar Float",
|
||||
"PandasAddScalarInt":" Pandas Add Scalar Int",
|
||||
"PandasAddSeries": "Pandas Add Series",
|
||||
"PandasAsFloat": "Pandas As Float",
|
||||
"PandasAsInt": "Pandas As Int",
|
||||
@@ -194,6 +216,8 @@ NODE_DISPLAY_NAME_MAPPINGS: Dict[str, str] = {
|
||||
"PandasCumprod": "Pandas Cumprod",
|
||||
"PandasCumsum": "Pandas Cumsum",
|
||||
"PandasDiv": "Pandas Div",
|
||||
"PandasDivScalarFloat": "Pandas Div Scalar Float",
|
||||
"PandasDivScalarInt": "Pandas Div Scalar Int",
|
||||
"PandasDivSeries": "Pandas Div Series",
|
||||
"PandasDropNA": "Pandas Drop NA",
|
||||
"PandasExp": "Pandas Exp",
|
||||
@@ -224,8 +248,12 @@ NODE_DISPLAY_NAME_MAPPINGS: Dict[str, str] = {
|
||||
"PandasMin": "Pandas Min",
|
||||
"PandasMode": "Pandas Mode",
|
||||
"PandasMul": "Pandas Mul",
|
||||
"PandasMulScalarFloat": "Pandas Mul Scalar Float",
|
||||
"PandasMulScalarInt": "Pandas Mul Scalar Int",
|
||||
"PandasMulSeries": "Pandas Mul Series",
|
||||
"PandasPow": "Pandas Pow",
|
||||
"PandasPowScalarFloat": "Pandas Pow Scalar Float",
|
||||
"PandasPowScalarInt": "Pandas Pow Scalar Int",
|
||||
"PandasPowSeries": "Pandas Pow Series",
|
||||
"PandasRename": "Pandas Rename",
|
||||
"PandasReplace": "Pandas Replace",
|
||||
@@ -242,6 +270,8 @@ NODE_DISPLAY_NAME_MAPPINGS: Dict[str, str] = {
|
||||
"PandasSort": "Pandas Sort",
|
||||
"PandasStd": "Pandas Std",
|
||||
"PandasSub": "Pandas Sub",
|
||||
"PandasSubScalarFloat": "Pandas Sub Scalar Float",
|
||||
"PandasSubScalarInt": "Pandas Sub Scalar Int",
|
||||
"PandasSubSeries": "Pandas Sub Series",
|
||||
"PandasSum": "Pandas Sum",
|
||||
"PandasSummary": "Pandas Summary",
|
||||
|
||||
@@ -7,14 +7,24 @@
|
||||
| Node | Description |
|
||||
| --- | --- |
|
||||
| [Pandas Add](pandas_add.md) | Adds two pandas DataFrames. |
|
||||
| [Pandas Add Scalar Float](pandas_add_scalar_float.md) | Adds a floating-point number to a Pandas DataFrame. |
|
||||
| [Pandas Add Scalar Int](pandas_add_scalar_int.md) | Adds an integer to a Pandas DataFrame. |
|
||||
| [Pandas Add Series](pandas_add_series.md) | Adds a Pandas Series to a pandas DataFrames. |
|
||||
| [Pandas Div](pandas_div.md) | Divides two pandas DataFrames. |
|
||||
| [Pandas Div](pandas_div.md) | Divides a Pandas DataFrame by another DataFrame. |
|
||||
| [Pandas Div Scalar Float](pandas_div_scalar_float.md) | Divides a Pandas DataFrame by a floating-point number. |
|
||||
| [Pandas Div Scalar Int](pandas_div_scalar_int.md) | Divides a Pandas DataFrame by an integer. |
|
||||
| [Pandas Div Series](pandas_div_series.md) | Divides a Pandas DataFrame by a Pandas Series. |
|
||||
| [Pandas Mul](pandas_mul.md) | Multiplies two pandas DataFrames. |
|
||||
| [Pandas Mul Scalar Float](pandas_mul_scalar_float.md) | Multiplies a Pandas DataFrame by a floating-point number. |
|
||||
| [Pandas Mul Scalar Int](pandas_mul_scalar_int.md) | Multiplies a Pandas DataFrame by a floating-point number. |
|
||||
| [Pandas Mul Series](pandas_mul_series.md) | Multiplies a Pandas DataFrame by a Pandas Series. |
|
||||
| [Pandas Pow](pandas_pow.md) | Exponentiates two pandas DataFrames. |
|
||||
| [Pandas Pow Scalar Float](pandas_pow_scalar_float.md) | Raises a Pandas DataFrame to the power of a floating-point number. |
|
||||
| [Pandas Pow Scalar Int](pandas_pow_scalar_int.md) | Raises a Pandas DataFrame to the power of an integer. |
|
||||
| [Pandas Pow Series](pandas_pow_series.md) | Raises a Pandas DataFrame to the power of a Pandas Series. |
|
||||
| [Pandas Sub](pandas_sub.md) | Subtracts a Pandas DataFrame from another DataFrame. |
|
||||
| [Pandas Sub Scalar Float](pandas_sub_scalar_float.md) | Subtracts a floating-point number from a Pandas DataFrame. |
|
||||
| [Pandas Sub Scalar Int](pandas_sub_scalar_int.md) | Subtracts an integer from a Pandas DataFrame. |
|
||||
| [Pandas Sub Series](pandas_sub_series.md) | Subtracts a Pandas Series from a Pandas DataFrame. |
|
||||
## Cumulative calculations
|
||||
| Node | Description |
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Pandas Add Scalar Float
|
||||
Adds a floating-point number to a Pandas DataFrame.
|
||||
|
||||
## Input
|
||||
| Name | Data type |
|
||||
|---|---|
|
||||
| dataframe | DataFrame |
|
||||
| float_scalar | Float |
|
||||
|
||||
## Output
|
||||
| Data type |
|
||||
|---|
|
||||
| DataFrame |
|
||||
|
||||
<HR>
|
||||
Category: Arithmetic method
|
||||
|
||||
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Pandas Add Scalar Int
|
||||
Adds an integer to a Pandas DataFrame.
|
||||
|
||||
## Input
|
||||
| Name | Data type |
|
||||
|---|---|
|
||||
| dataframe | DataFrame |
|
||||
| int_scalar | Int |
|
||||
|
||||
## Output
|
||||
| Data type |
|
||||
|---|
|
||||
| DataFrame |
|
||||
|
||||
<HR>
|
||||
Category: Arithmetic method
|
||||
|
||||
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
|
||||
@@ -1,5 +1,5 @@
|
||||
# Pandas Div
|
||||
Divides two pandas DataFrames.
|
||||
Divides a Pandas DataFrame by another DataFrame.
|
||||
|
||||
## Input
|
||||
| Name | Data type |
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Pandas Div Scalar Float
|
||||
Divides a Pandas DataFrame by a floating-point number.
|
||||
|
||||
## Input
|
||||
| Name | Data type |
|
||||
|---|---|
|
||||
| dataframe | DataFrame |
|
||||
| float_scalar | Float |
|
||||
|
||||
## Output
|
||||
| Data type |
|
||||
|---|
|
||||
| DataFrame |
|
||||
|
||||
<HR>
|
||||
Category: Arithmetic method
|
||||
|
||||
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Pandas Div Scalar Int
|
||||
Divides a Pandas DataFrame by an integer.
|
||||
|
||||
## Input
|
||||
| Name | Data type |
|
||||
|---|---|
|
||||
| dataframe | DataFrame |
|
||||
| int_scalar | Int |
|
||||
|
||||
## Output
|
||||
| Data type |
|
||||
|---|
|
||||
| DataFrame |
|
||||
|
||||
<HR>
|
||||
Category: Arithmetic method
|
||||
|
||||
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Pandas Mul Scalar Float
|
||||
Multiplies a Pandas DataFrame by a floating-point number.
|
||||
|
||||
## Input
|
||||
| Name | Data type |
|
||||
|---|---|
|
||||
| dataframe | DataFrame |
|
||||
| float_scalar | Float |
|
||||
|
||||
## Output
|
||||
| Data type |
|
||||
|---|
|
||||
| DataFrame |
|
||||
|
||||
<HR>
|
||||
Category: Arithmetic method
|
||||
|
||||
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Pandas Mul Scalar Int
|
||||
Multiplies a Pandas DataFrame by a floating-point number.
|
||||
|
||||
## Input
|
||||
| Name | Data type |
|
||||
|---|---|
|
||||
| dataframe | DataFrame |
|
||||
| int_scalar | Int |
|
||||
|
||||
## Output
|
||||
| Data type |
|
||||
|---|
|
||||
| DataFrame |
|
||||
|
||||
<HR>
|
||||
Category: Arithmetic method
|
||||
|
||||
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Pandas Pow Scalar Float
|
||||
Raises a Pandas DataFrame to the power of a floating-point number.
|
||||
|
||||
## Input
|
||||
| Name | Data type |
|
||||
|---|---|
|
||||
| dataframe | DataFrame |
|
||||
| float_scalar | Float |
|
||||
|
||||
## Output
|
||||
| Data type |
|
||||
|---|
|
||||
| DataFrame |
|
||||
|
||||
<HR>
|
||||
Category: Arithmetic method
|
||||
|
||||
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Pandas Pow Scalar Int
|
||||
Raises a Pandas DataFrame to the power of an integer.
|
||||
|
||||
## Input
|
||||
| Name | Data type |
|
||||
|---|---|
|
||||
| dataframe | DataFrame |
|
||||
| int_scalar | Int |
|
||||
|
||||
## Output
|
||||
| Data type |
|
||||
|---|
|
||||
| DataFrame |
|
||||
|
||||
<HR>
|
||||
Category: Arithmetic method
|
||||
|
||||
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Pandas Sub Scalar Float
|
||||
Subtracts a floating-point number from a Pandas DataFrame.
|
||||
|
||||
## Input
|
||||
| Name | Data type |
|
||||
|---|---|
|
||||
| dataframe | DataFrame |
|
||||
| float_scalar | Float |
|
||||
|
||||
## Output
|
||||
| Data type |
|
||||
|---|
|
||||
| DataFrame |
|
||||
|
||||
<HR>
|
||||
Category: Arithmetic method
|
||||
|
||||
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Pandas Sub Scalar Int
|
||||
Subtracts an integer from a Pandas DataFrame.
|
||||
|
||||
## Input
|
||||
| Name | Data type |
|
||||
|---|---|
|
||||
| dataframe | DataFrame |
|
||||
| int_scalar | Int |
|
||||
|
||||
## Output
|
||||
| Data type |
|
||||
|---|
|
||||
| DataFrame |
|
||||
|
||||
<HR>
|
||||
Category: Arithmetic method
|
||||
|
||||
ComfyUI Data Analysis Node Reference. © 2025 Hide Inada (HowToSD.com). All rights reserved.
|
||||
@@ -0,0 +1,43 @@
|
||||
from typing import Any, Dict
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class PandasAddScalarFloat:
|
||||
"""
|
||||
Adds a floating-point number to a Pandas DataFrame.
|
||||
|
||||
category: Arithmetic method
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls) -> Dict[str, Any]:
|
||||
"""
|
||||
Defines the input types for the function.
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: A dictionary specifying required input types.
|
||||
"""
|
||||
return {
|
||||
"required": {
|
||||
"dataframe": ("DATAFRAME", {}),
|
||||
"float_scalar": ("FLOAT", {"default": 0.0, "min": -2**31, "max": 2**31})
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES: tuple = ("DATAFRAME",)
|
||||
FUNCTION: str = "f"
|
||||
CATEGORY: str = "Data Analysis"
|
||||
|
||||
def f(self, dataframe: pd.DataFrame, float_scalar: float) -> tuple:
|
||||
"""
|
||||
Adds a floating-point number to a Pandas DataFrame.
|
||||
|
||||
Args:
|
||||
dataframe (DataFrame): The DataFrame.
|
||||
float_scalar (DataFrame): The scalar value to add.
|
||||
|
||||
Returns:
|
||||
tuple: A tuple containing the DataFrame containing the result.
|
||||
"""
|
||||
df_out = dataframe + float_scalar
|
||||
return (df_out,)
|
||||
@@ -0,0 +1,43 @@
|
||||
from typing import Any, Dict
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class PandasAddScalarInt:
|
||||
"""
|
||||
Adds an integer to a Pandas DataFrame.
|
||||
|
||||
category: Arithmetic method
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls) -> Dict[str, Any]:
|
||||
"""
|
||||
Defines the input types for the function.
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: A dictionary specifying required input types.
|
||||
"""
|
||||
return {
|
||||
"required": {
|
||||
"dataframe": ("DATAFRAME", {}),
|
||||
"int_scalar": ("INT", {"default": 0, "min": -2**31, "max": 2**31})
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES: tuple = ("DATAFRAME",)
|
||||
FUNCTION: str = "f"
|
||||
CATEGORY: str = "Data Analysis"
|
||||
|
||||
def f(self, dataframe: pd.DataFrame, int_scalar: int) -> tuple:
|
||||
"""
|
||||
Adds an integer to a Pandas DataFrame.
|
||||
|
||||
Args:
|
||||
dataframe (DataFrame): The DataFrame.
|
||||
int_scalar (DataFrame): The scalar value to add.
|
||||
|
||||
Returns:
|
||||
tuple: A tuple containing the DataFrame containing the result.
|
||||
"""
|
||||
df_out = dataframe + int_scalar
|
||||
return (df_out,)
|
||||
@@ -5,7 +5,7 @@ import pandas as pd
|
||||
|
||||
class PandasDiv:
|
||||
"""
|
||||
Divides two pandas DataFrames.
|
||||
Divides a Pandas DataFrame by another DataFrame.
|
||||
|
||||
category: Arithmetic method
|
||||
"""
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
from typing import Any, Dict
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class PandasDivScalarFloat:
|
||||
"""
|
||||
Divides a Pandas DataFrame by a floating-point number.
|
||||
|
||||
category: Arithmetic method
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls) -> Dict[str, Any]:
|
||||
"""
|
||||
Defines the input types for the function.
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: A dictionary specifying required input types.
|
||||
"""
|
||||
return {
|
||||
"required": {
|
||||
"dataframe": ("DATAFRAME", {}),
|
||||
"float_scalar": ("FLOAT", {"default": 1.0, "min": -2**31, "max": 2**31})
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES: tuple = ("DATAFRAME",)
|
||||
FUNCTION: str = "f"
|
||||
CATEGORY: str = "Data Analysis"
|
||||
|
||||
def f(self, dataframe: pd.DataFrame, float_scalar: float) -> tuple:
|
||||
"""
|
||||
Divides a Pandas DataFrame by a floating-point number.
|
||||
|
||||
Args:
|
||||
dataframe (DataFrame): The DataFrame to be divided.
|
||||
float_scalar (DataFrame): The scalar value to divide by.
|
||||
|
||||
Returns:
|
||||
tuple: A tuple containing the DataFrame containing the result of division.
|
||||
"""
|
||||
df_out = dataframe / float_scalar
|
||||
return (df_out,)
|
||||
@@ -0,0 +1,43 @@
|
||||
from typing import Any, Dict
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class PandasDivScalarInt:
|
||||
"""
|
||||
Divides a Pandas DataFrame by an integer.
|
||||
|
||||
category: Arithmetic method
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls) -> Dict[str, Any]:
|
||||
"""
|
||||
Defines the input types for the function.
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: A dictionary specifying required input types.
|
||||
"""
|
||||
return {
|
||||
"required": {
|
||||
"dataframe": ("DATAFRAME", {}),
|
||||
"int_scalar": ("INT", {"default": 1, "min": -2**31, "max": 2**31})
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES: tuple = ("DATAFRAME",)
|
||||
FUNCTION: str = "f"
|
||||
CATEGORY: str = "Data Analysis"
|
||||
|
||||
def f(self, dataframe: pd.DataFrame, int_scalar: int) -> tuple:
|
||||
"""
|
||||
Divides a Pandas DataFrame by an integer.
|
||||
|
||||
Args:
|
||||
dataframe (DataFrame): The DataFrame to be divided.
|
||||
int_scalar (DataFrame): The scalar value to divide by.
|
||||
|
||||
Returns:
|
||||
tuple: A tuple containing the DataFrame containing the result of division.
|
||||
"""
|
||||
df_out = dataframe / int_scalar
|
||||
return (df_out,)
|
||||
@@ -0,0 +1,43 @@
|
||||
from typing import Any, Dict
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class PandasMulScalarFloat:
|
||||
"""
|
||||
Multiplies a Pandas DataFrame by a floating-point number.
|
||||
|
||||
category: Arithmetic method
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls) -> Dict[str, Any]:
|
||||
"""
|
||||
Defines the input types for the function.
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: A dictionary specifying required input types.
|
||||
"""
|
||||
return {
|
||||
"required": {
|
||||
"dataframe": ("DATAFRAME", {}),
|
||||
"float_scalar": ("FLOAT", {"default": 1.0, "min": -2**31, "max": 2**31})
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES: tuple = ("DATAFRAME",)
|
||||
FUNCTION: str = "f"
|
||||
CATEGORY: str = "Data Analysis"
|
||||
|
||||
def f(self, dataframe: pd.DataFrame, float_scalar: float) -> tuple:
|
||||
"""
|
||||
Multiplies a Pandas DataFrame by a floating-point number.
|
||||
|
||||
Args:
|
||||
dataframe (DataFrame): The DataFrame to be multiplied.
|
||||
float_scalar (DataFrame): The scalar value to multiply by.
|
||||
|
||||
Returns:
|
||||
tuple: A tuple containing the DataFrame containing the result.
|
||||
"""
|
||||
df_out = dataframe * float_scalar
|
||||
return (df_out,)
|
||||
@@ -0,0 +1,43 @@
|
||||
from typing import Any, Dict
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class PandasMulScalarInt:
|
||||
"""
|
||||
Multiplies a Pandas DataFrame by a floating-point number.
|
||||
|
||||
category: Arithmetic method
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls) -> Dict[str, Any]:
|
||||
"""
|
||||
Defines the input types for the function.
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: A dictionary specifying required input types.
|
||||
"""
|
||||
return {
|
||||
"required": {
|
||||
"dataframe": ("DATAFRAME", {}),
|
||||
"int_scalar": ("INT", {"default": 1, "min": -2**31, "max": 2**31})
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES: tuple = ("DATAFRAME",)
|
||||
FUNCTION: str = "f"
|
||||
CATEGORY: str = "Data Analysis"
|
||||
|
||||
def f(self, dataframe: pd.DataFrame, int_scalar: int) -> tuple:
|
||||
"""
|
||||
Multiplies a Pandas DataFrame by a floating-point number.
|
||||
|
||||
Args:
|
||||
dataframe (DataFrame): The DataFrame to be multiplied.
|
||||
float_scalar (DataFrame): The scalar value to multiply by.
|
||||
|
||||
Returns:
|
||||
tuple: A tuple containing the DataFrame containing the result.
|
||||
"""
|
||||
df_out = dataframe * int_scalar
|
||||
return (df_out,)
|
||||
@@ -0,0 +1,43 @@
|
||||
from typing import Any, Dict
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class PandasPowScalarFloat:
|
||||
"""
|
||||
Raises a Pandas DataFrame to the power of a floating-point number.
|
||||
|
||||
category: Arithmetic method
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls) -> Dict[str, Any]:
|
||||
"""
|
||||
Defines the input types for the function.
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: A dictionary specifying required input types.
|
||||
"""
|
||||
return {
|
||||
"required": {
|
||||
"dataframe": ("DATAFRAME", {}),
|
||||
"float_scalar": ("FLOAT", {"default": 1.0, "min": -2**31, "max": 2**31})
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES: tuple = ("DATAFRAME",)
|
||||
FUNCTION: str = "f"
|
||||
CATEGORY: str = "Data Analysis"
|
||||
|
||||
def f(self, dataframe: pd.DataFrame, float_scalar: float) -> tuple:
|
||||
"""
|
||||
Raises a Pandas DataFrame to the power of a floating-point number.
|
||||
|
||||
Args:
|
||||
dataframe (DataFrame): The DataFrame.
|
||||
float_scalar (DataFrame): The scalar value containing the power.
|
||||
|
||||
Returns:
|
||||
tuple: A tuple containing the DataFrame containing the result.
|
||||
"""
|
||||
df_out = dataframe.pow(float_scalar)
|
||||
return (df_out,)
|
||||
@@ -0,0 +1,43 @@
|
||||
from typing import Any, Dict
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class PandasPowScalarInt:
|
||||
"""
|
||||
Raises a Pandas DataFrame to the power of an integer.
|
||||
|
||||
category: Arithmetic method
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls) -> Dict[str, Any]:
|
||||
"""
|
||||
Defines the input types for the function.
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: A dictionary specifying required input types.
|
||||
"""
|
||||
return {
|
||||
"required": {
|
||||
"dataframe": ("DATAFRAME", {}),
|
||||
"int_scalar": ("INT", {"default": 1, "min": -2**31, "max": 2**31})
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES: tuple = ("DATAFRAME",)
|
||||
FUNCTION: str = "f"
|
||||
CATEGORY: str = "Data Analysis"
|
||||
|
||||
def f(self, dataframe: pd.DataFrame, int_scalar: int) -> tuple:
|
||||
"""
|
||||
Raises a Pandas DataFrame to the power of a integer.
|
||||
|
||||
Args:
|
||||
dataframe (DataFrame): The DataFrame.
|
||||
int_scalar (DataFrame): The scalar value containing the power.
|
||||
|
||||
Returns:
|
||||
tuple: A tuple containing the DataFrame containing the result.
|
||||
"""
|
||||
df_out = dataframe.pow(int_scalar)
|
||||
return (df_out,)
|
||||
@@ -0,0 +1,43 @@
|
||||
from typing import Any, Dict
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class PandasSubScalarFloat:
|
||||
"""
|
||||
Subtracts a floating-point number from a Pandas DataFrame.
|
||||
|
||||
category: Arithmetic method
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls) -> Dict[str, Any]:
|
||||
"""
|
||||
Defines the input types for the function.
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: A dictionary specifying required input types.
|
||||
"""
|
||||
return {
|
||||
"required": {
|
||||
"dataframe": ("DATAFRAME", {}),
|
||||
"float_scalar": ("FLOAT", {"default": 0.0, "min": -2**31, "max": 2**31})
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES: tuple = ("DATAFRAME",)
|
||||
FUNCTION: str = "f"
|
||||
CATEGORY: str = "Data Analysis"
|
||||
|
||||
def f(self, dataframe: pd.DataFrame, float_scalar: float) -> tuple:
|
||||
"""
|
||||
Subtracts a floating-point number from a Pandas DataFrame.
|
||||
|
||||
Args:
|
||||
dataframe (DataFrame): The DataFrame.
|
||||
float_scalar (DataFrame): The scalar value to subtract.
|
||||
|
||||
Returns:
|
||||
tuple: A tuple containing the DataFrame containing the result.
|
||||
"""
|
||||
df_out = dataframe - float_scalar
|
||||
return (df_out,)
|
||||
@@ -0,0 +1,43 @@
|
||||
from typing import Any, Dict
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class PandasSubScalarInt:
|
||||
"""
|
||||
Subtracts an integer from a Pandas DataFrame.
|
||||
|
||||
category: Arithmetic method
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls) -> Dict[str, Any]:
|
||||
"""
|
||||
Defines the input types for the function.
|
||||
|
||||
Returns:
|
||||
Dict[str, Any]: A dictionary specifying required input types.
|
||||
"""
|
||||
return {
|
||||
"required": {
|
||||
"dataframe": ("DATAFRAME", {}),
|
||||
"int_scalar": ("INT", {"default": 0, "min": -2**31, "max": 2**31})
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES: tuple = ("DATAFRAME",)
|
||||
FUNCTION: str = "f"
|
||||
CATEGORY: str = "Data Analysis"
|
||||
|
||||
def f(self, dataframe: pd.DataFrame, int_scalar: int) -> tuple:
|
||||
"""
|
||||
Subtracts an integer from a Pandas DataFrame.
|
||||
|
||||
Args:
|
||||
dataframe (DataFrame): The DataFrame.
|
||||
int_scalar (DataFrame): The scalar value to subtract.
|
||||
|
||||
Returns:
|
||||
tuple: A tuple containing the DataFrame containing the result.
|
||||
"""
|
||||
df_out = dataframe - int_scalar
|
||||
return (df_out,)
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "data-analysis"
|
||||
description = "Data analysis custom modules for ComfyUI - Use Pandas & Matplotlib within ComfyUI"
|
||||
version = "1.1.11"
|
||||
version = "1.1.12"
|
||||
license = {file = "LICENSE"}
|
||||
|
||||
[project.urls]
|
||||
|
||||
Reference in New Issue
Block a user