pivot_table
Transform Excel data into pivot tables by specifying index, columns, values, and aggregation functions. Ideal for summarizing and analyzing spreadsheet information efficiently.
Instructions
Create a pivot table from Excel data.
Args:
file_path: Path to the Excel file
index: Column to use as the pivot table index
columns: Optional column to use as the pivot table columns
values: Column to use as the pivot table values
aggfunc: Aggregation function ('mean', 'sum', 'count', etc.)
sheet_name: Name of the sheet to pivot (for Excel files)
Returns:
Pivot table as string
Input Schema
Name | Required | Description | Default |
---|---|---|---|
aggfunc | No | mean | |
columns | No | ||
file_path | Yes | ||
index | Yes | ||
sheet_name | No | ||
values | No |
Input Schema (JSON Schema)
{
"properties": {
"aggfunc": {
"default": "mean",
"title": "Aggfunc",
"type": "string"
},
"columns": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Columns"
},
"file_path": {
"title": "File Path",
"type": "string"
},
"index": {
"title": "Index",
"type": "string"
},
"sheet_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Sheet Name"
},
"values": {
"default": null,
"title": "Values",
"type": "string"
}
},
"required": [
"file_path",
"index"
],
"title": "pivot_tableArguments",
"type": "object"
}