Linear algebra is one of the most important mathematical topics that is highly useful to do a good data science. Learning the basics of linear algebra adds a valuable tool set to your data science skill. Python’s NumPy has fast efficient functions for all standard linear albegra/matrix operations. Here we will see 9 important and […]
Python
3 Basic Commands to Manipulate NumPy 2d-arrays
NumPy or Numerical Python is one of the packages in Python for all things computing with numerical values. Learning NumPy makes one’s life much easier to compute with multi-dimensional arrays and matrices. A huge collection of very useful mathematical functions available to operate on these arrays these arrays makes it one of the powerful environment […]
How To Reshape Pandas Dataframe with melt and wide_to_long()?
Reshaping data frames into tidy format is probably one of the most frequent things you would do in data wrangling. In this post, we will learn how to use Pandas melt() function and wide_long_long() function to reshape Pandas dataframe in wide form to long tidy form. A data frame is tidy when it satisfies the […]
Singular Value Decomposition (SVD) in Python
Matrix decomposition by Singular Value Decomposition (SVD) is one of the widely used methods for dimensionality reduction. For example, Principal Component Analysis often uses SVD under the hood to compute principal components. In this post, we will work through an example of doing SVD in Python. We will use gapminder data in wide form to […]
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 […]