Often while cleaning data, one might want to create a new variable or column based on the values of another column using conditions. In this post we will see two different ways to create a column based on values of another column using conditional statements. First we will use NumPy’s little unknown function where to […]
NumPy
How to Implement Pandas Groupby operation with NumPy?
Pandas’ GroupBy function is the bread and butter for many data munging activities. Groupby enables one of the most widely used paradigm “Split-Apply-Combine”, for doing data analysis. Sometimes you will be working NumPy arrays and may still want to perform groupby operations on the array. Just recently wrote a blogpost inspired by Jake’s post on […]
10 Basic Arithmetic Operations with NumPy array
NumPy is one of most fundamental Python packages for doing any scientific computing in Python. NumPy’s N-dimenisonal array structure offers fantastic tools to numerical computing with Python. Let us see 10 most basic arithmetic operations with NumPy that will help greatly with Data Science skills in Python. Let us first load the NumPy library Let […]
How To Concatenate Arrays in NumPy?
Often you may have two or more NumPY arrays and want to concatenate/join/merge them into a single array. Python offers multiple options to join/concatenate NumPy arrays. Common operations include given two 2d-arrays, how can we concatenate them row wise or column wise. NumPy’s concatenate function allows you to concatenate two arrays either by rows or […]
12 Basic Commands with NumPy Array
NumPy (pronounced as Num-pee or Num-pai) is one of the important python packages (other being SciPy) for scientific computing. NumPy offers fast and flexible data structures for multi-dimensional arrays and matrices with numerous mathematical functions/operations associated with it. Core data structure in NumPy is “ndarray”, short for n-dimesional array for storing numeric values. Let us […]