Back to Glossary Index

Reshape

Change the structure of data to better fit specific analysis or modeling requirements.

Data reshaping definition:

Data reshaping is the process of changing the layout or structure of data from one form to another, in order to better suit the needs of an analysis or downstream processing. This can involve rearranging rows and columns, changing the data type, or converting between wide and long formats.

Data transformation example using Python:

Please note that you need to have the necessary Python libraries installed in your Python environment to run this code.

In Python, the reshape() function in the NumPy library can be used for data reshaping. Let’s look at a simple example:

import numpy as np

# create a 3x4 array of data
data = np.array([[1, 2, 3, 4],
                 [5, 6, 7, 8],
                 [9, 10, 11, 12]])

# reshape the data into a 2x6 array
reshaped_data = data.reshape(2, 6)

print(reshaped_data)

This will print out the new array as follows:

[[ 1  2  3  4  5  6]
 [ 7  8  9 10 11 12]]

This example reshapes a 3x4 array into a 2x6 array. The reshape function takes the new dimensions of the array as arguments. Note that the total number of elements in the original array must equal the total number of elements in the reshaped array, or an error will occur.


Other data engineering terms related to
Data Transformation:

Align

Aligning data can mean one of three things: aligning datasets, meeting business rules or arranging data elements in memory.

Big Data Processing

Process large volumes of data in parallel and distributed computing environments to improve performance.

Clean or Cleanse

Remove invalid or inconsistent data values, such as empty fields or outliers.

Cluster

Group data points based on similarities or patterns to facilitate analysis and modeling.

Denoising

Remove noise or artifacts from data to improve its accuracy and quality.

Denormalize

Optimize data for faster read access by reducing the number of joins needed to retrieve related data.

Discretize

Transform continuous data into discrete categories or bins to simplify analysis.

ETL

Extract, transform, and load data between different systems.

Filter

Extract a subset of data based on specific criteria or conditions.

Fragment

Convert data into a linear format for efficient storage and processing.

Impute

Fill in missing data values with estimated or imputed values to facilitate analysis.

Munge

See 'wrangle'.

Normalize

Standardize data values to facilitate comparison and analysis. organize data into a consistent format.

Reduce

Convert a large set of data into a smaller, more manageable form without significant loss of information.

Serialize

Convert data into a linear format for efficient storage and processing.

Shred

Break down large datasets into smaller, more manageable pieces for easier processing and analysis.

Skew

An imbalance in the distribution or representation of data.

Standardize

Transform data to a common unit or format to facilitate comparison and analysis.

Tokenize

Convert data into tokens or smaller units to simplify analysis or processing.

Transform

Convert data from one format or structure to another.

Wrangle

Convert unstructured data into a structured format.