Free plan
Reshape
Turn a table around: columns to rows, rows to columns, or a pivot
About this tool
This tool changes the shape of a table. It can unpivot a wide table, where each month is a column, into a long one with a row per month. It can do the reverse, pivoting a long table into a wide one and adding up or averaging the numbers. Or it can swap rows and columns.
For example, you turn one column per month into one row per month.
How to use it
- Choose this tool.
- Add your table with Upload or drag and drop.
- Choose what to do: unpivot, pivot or swap rows and columns.
- Pick the columns to keep and the columns to turn, then press Generate.
- Download the reshaped table.
What you get back
You get a new table with the new shape. Download it.
GOOD TO KNOW
A pivot may make at most 5000 columns, an unpivot at most 20 million cells. sum, mean, min, max and median need numbers. Counts as one conversion.
TEST IT LIVE
Try Reshape in the Studio
One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Family
Data
Plan
Free
Method
POST
Endpoint
/v1/data/reshape
Tool ID
data.reshape
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Data
For developers
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/data/reshape" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'file=@document.pdf' \
-F 'operation=unpivot' \
-F 'id_columns=["id","region"]' \
-F 'value_columns=["jan","feb"]'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.data.reshape({
"file": 'document.pdf',
"operation": "unpivot",
"id_columns": "[\"id\",\"region\"]",
"value_columns": "[\"jan\",\"feb\"]"
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->data()->reshape([
'file' => 'document.pdf',
'operation' => 'unpivot',
'id_columns' => '["id","region"]',
'value_columns' => '["jan","feb"]',
]);
echo $result->requestId;Documentation
Guides that use this tool
More in Data
