---
title: "Slice"
description: "Local-first visual environment for building and running AI workflows. Build agents visually, deploy anywhere, privacy by design."
canonical: https://docs.nodetool.ai/nodes/nodetool/data/slice
markdown: https://docs.nodetool.ai/nodes/nodetool/data/slice.md
product: NodeTool
source: https://github.com/nodetool-ai/nodetool/blob/main/docs/nodes/nodetool/data/slice.md
---

# Slice

**Type:** `nodetool.data.Slice`

**Namespace:** `nodetool.data`

## Description

Slice a dataframe by rows using start and end indices.
    slice, subset, rows

    Use cases:
    - Extract a specific range of rows from a large dataset
    - Create training and testing subsets for machine learning
    - Analyze data in smaller chunks

## Properties

| Property | Type | Description | Default |
|----------|------|-------------|---------|
| dataframe | `dataframe` | The input dataframe to be sliced. | `{"type":"dataframe","uri":"","asset_id":null,"d...` |
| start_index | `int` | The starting index of the slice (inclusive). | `0` |
| end_index | `int` | The ending index of the slice (exclusive). Use -1 to slice through the end; other negative values count back from the end (e.g. -2 drops the last two rows). | `-1` |

## Outputs

| Output | Type | Description |
|--------|------|-------------|
| output | `dataframe` |  |

## Related Nodes

Browse other nodes in the [nodetool.data](./) namespace.
