Array

SQL

Spark SQL - Array Functions

• Spark SQL provides 50+ array functions that enable complex data transformations without UDFs, significantly improving performance through Catalyst optimizer integration and whole-stage code…

Read more →
Scala

Scala - ArrayBuffer (Mutable Array)

ArrayBuffer is Scala’s resizable array implementation, part of the scala.collection.mutable package. It maintains an internal array that grows automatically when capacity is exceeded, typically…

Read more →
Python

NumPy - Reshape Array (np.reshape)

Array reshaping changes the dimensionality of an array without altering its data. NumPy stores arrays as contiguous blocks of memory with metadata describing shape and strides. When you reshape,…

Read more →
Python

NumPy - Pad Array (np.pad)

The np.pad() function extends NumPy arrays by adding elements along specified axes. The basic signature takes three parameters: the input array, pad width, and mode.

Read more →
Python

NumPy - Convert List to Array

The fundamental method for converting a Python list to a NumPy array uses np.array(). This function accepts any sequence-like object and returns an ndarray with an automatically inferred data type.

Read more →
Python

NumPy - Copy vs View of Array

NumPy’s distinction between copies and views directly impacts memory usage and performance. A view is a new array object that references the same data as the original array. A copy is a new array…

Read more →
Python

NumPy - Array Data Types (dtype)

• NumPy’s dtype system provides 21+ data types optimized for numerical computing, enabling precise memory control and performance tuning—a float32 array uses half the memory of float64 while…

Read more →
Python

NumPy - Array Slicing with Examples

NumPy array slicing follows Python’s standard slicing convention but extends it to multiple dimensions. The basic syntax [start:stop:step] creates a view into the original array rather than copying…

Read more →
Python

NumPy: Array Operations Explained

NumPy is the foundation of Python’s scientific computing ecosystem. Every major data science library—pandas, scikit-learn, TensorFlow, PyTorch—builds on NumPy’s array operations. If you’re doing…

Read more →
Python

How to Transpose an Array in NumPy

Array transposition—swapping rows and columns—is one of the most common operations in numerical computing. Whether you’re preparing matrices for multiplication, reshaping data for machine learning…

Read more →
Python

How to Reshape an Array in NumPy

Array reshaping is one of the most frequently used operations in NumPy. At its core, reshaping changes how data is organized into rows, columns, and higher dimensions without altering the underlying…

Read more →
Python

How to Flatten an Array in NumPy

Flattening arrays is one of those operations you’ll perform hundreds of times in any data science or machine learning project. Whether you’re preparing features for a model, serializing data for…

Read more →
Python

How to Create a Zeros Array in NumPy

Every numerical computing workflow eventually needs initialized arrays. Whether you’re building a neural network, processing images, or running simulations, you’ll reach for np.zeros() constantly….

Read more →
Python

How to Create a Ones Array in NumPy

NumPy’s ones array is one of those deceptively simple tools that shows up everywhere in numerical computing. You’ll reach for it when initializing neural network biases, creating boolean masks for…

Read more →