Added Pandas logical operations nodes.

This commit is contained in:
HowToSD
2025-03-07 12:03:58 -08:00
parent 4f0fc89004
commit f918096cb6
31 changed files with 1017 additions and 2 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ class CDAJSONCreate:
data (str): String value in the text field.
Returns:
tuple: A tuple containing a JSON string representation of the DataFrame.
tuple: A tuple containing a JSON string.
"""
# Convert to JSON
json_obj = json.loads(data)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, Dict
import ast
class PyStringToDict:
"""
Creates a Python dictionary using the string values entered in the text field.
category: Python wrapper
"""
@classmethod
def INPUT_TYPES(cls) -> Dict[str, Any]:
"""
Defines the input types for the `create` function.
Returns:
Dict[str, Any]: A dictionary specifying required input types.
"""
return {
"required": {
"data": ("STRING", {"multiline": True}),
}
}
RETURN_TYPES: tuple = ("PYDICT",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, data: str) -> tuple:
"""
Creates a Python dictionary using the string values entered in the text field.
Args:
data (str): String value in the text field.
Returns:
tuple: A dict converted from the input string.
"""
d = ast.literal_eval(data)
return (d,)
+41
View File
@@ -0,0 +1,41 @@
from typing import Any, List
import ast
class PyStringToList:
"""
Creates a Python list using the string values entered in the text field.
category: Python wrapper
"""
@classmethod
def INPUT_TYPES(cls) -> List[str]:
"""
Defines the input types for the `create` function.
Returns:
List[str, Any]: A list specifying required input types.
"""
return {
"required": {
"data": ("STRING", {"multiline": True}),
}
}
RETURN_TYPES: tuple = ("PYLIST",)
FUNCTION: str = "f"
CATEGORY: str = "Data Analysis"
def f(self, data: str) -> tuple:
"""
Creates a Python list using the string values entered in the text field.
Args:
data (str): String value in the text field.
Returns:
tuple: A list converted from the input string.
"""
d = ast.literal_eval(data)
return (d,)