Added Pandas logical operations nodes.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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,)
|
||||
|
||||
@@ -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,)
|
||||
|
||||
Reference in New Issue
Block a user