How To Create a Column Using Condition on Another Column in Pandas?

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… Continue reading How To Create a Column Using Condition on Another Column in Pandas?

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… Continue reading How to Implement Pandas Groupby operation with NumPy?

10 Basic Arithmetic Operations with NumPy array

Basic Aritmetic Operations with NumPy

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… Continue reading 10 Basic Arithmetic Operations with NumPy array

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… Continue reading How To Concatenate Arrays in NumPy?

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… Continue reading 12 Basic Commands with NumPy Array