Conda env live task
Live task to run Python snippets in a conda shell environment.
Conda-based Python live tasks allow to execute Python snippets on the fly in isolated conda environments.
Live tasks are fast and efficient tools to develop, test, use and share code snippets.
Warning: It is recommended to use code snippets comming from trusted sources.
Here is the general documentation for live task (including how to use the parameters): https://constellab.community/bricks/gws_core/latest/doc/developer-guide/live-task/getting-started/69820653-52e0-41ba-a5f3-4d9d54561779
Here is the documentation of the live task: https://constellab.community/bricks/gws_core/latest/doc/developer-guide/live-task/env-live-task/c6acb3c3-2a7c-44cd-8fb2-ea1beccdbdcc
Input
Output
Configuration
params
Please give one parameter definition per line (https://constellab.community/bricks/gws_core/latest/doc/developer-guide/live-task/getting-started/69820653-52e0-41ba-a5f3-4d9d54561779#parameters)
list
env
YAML configuration of the conda environment
yaml_code_param
name: .venv
channels:
- conda-forge
dependencies:
- python=3.10
- pandas==2.2.2
- numpy==1.26.4
code
The Python code snippet to execute using shell command
python_code_param
# This is a snippet template for a Python live task.
import pandas
# Do the job here ...
data = pandas.read_csv(source_paths[0], header=0, index_col=0, sep=',')
# transform the data
result = data.transpose()
# Write the output file in the target folder
result_path = "result.csv"
result.to_csv(result_path, index=True)
target_paths = [result_path]