NumPy stands for Numerical Python.NumPy is one of the powerful python libraries that support large multi-dimensional arrays and matrices, along with a collection of high-level mathematical functions to operate on these arrays.
In this article, let’s learn about the basics of NumPy needed for DataScience.
To create an n-dimensional array from the python list, the list should be
n-level deep. …
Higher-order functions are functions that take a function as a parameter and/or return a function as an output.
A few useful higher-order functions are map()
, filter()
, and reduce()
. map()
and filter()
are built-in functions, whereas reduce()
is contained in functools()
module.
Let’s learn about map()
, filter()
, and reduce()
in this article.
map()
is used to apply a function to each item in the iterable at the same time.map()
will return a map object that is an iterator:
map(function,iterable…)
Calculating the square of all numbers in the iterable:
square=map(lambda x:x*2, num)
: We can pass the lambda
function or user_defined
function. …
In Python, we can split the string by using the following methods. Let’s look at these methods in detail.
1. split()
2. rsplit()
3. splitlines()
4. partition()
5. rpartition()
6. re.split()
7. Differences between split() and partition()
8. Conclusion
9. Resources
“Return a list of the words in the string, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done (thus, the list will have at most
maxsplit+1
elements). If maxsplit is not specified or-1
, then there is no limit on the number of splits (all possible splits are made).”
str.split(sep=None,maxsplit=-1)
…
Linear Regression is a machine learning algorithm based on supervised learning. Linear Regression is a predictive model that is used for finding the linear relationship between a dependent variable and one or more independent variables. Here,dependent variable/target variable(Y) should be continuous variable.
Let’s learn the math behind simple linear regression and the Python way of implementation using ski-kit learn
Let’s looks at our dataset first. I have taken a simple dataset for an easy explanation. Years of Experience vs Salary
.
We want to predict the salary of the person based on their years of experience?
Dataset
Pandas is an open-source python package that provides numerous tools for high-performance data analysis and data manipulation.
Let’s learn about the most widely used Pandas Library in this article.
Pandas supports two datastructures
Pandas Series is a one-dimensional labeled array capable of holding any data type. …
A good understanding of linear algebra is much needed for understanding many machine learning algorithms.
In this article, we will learn about vectors, the dot product of vectors, and the geometric representation of the dot product in detail.
Let us consider a point P in 2-D space.
In machine learning, the confusion matrix helps to summarize the performance of classification models. From the confusion matrix, we can calculate many metrics like recall, precision,f1 score which is used to evaluate the performance of classification models.
In this blog, we will learn about the confusion matrix and the metrics calculated from the confusion matrix.
By using the above-mentioned methods, let’s see how to replace substrings in strings.
Syntax: str.replace(old,new,count)
Example 1: Replace substring “two” by “one”
In machine learning, before we generate any model, we need to understand the relationship between independent variables and the target variable.
The correlation coefficient is used as a measure of association. Let’s learn in detail about correlation and covariance in this article.
Correlation is a measure of association. Correlation is used for bivariate analysis. …
Seaborn is used for data visualization, and it is based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics.
Data visualization is used for finding extremely meaningful insights from the data. It is used to visualize the distribution of data, the relationship between two variables. When data are visualized properly, the human visual system can see trends and patterns that indicate a relationship.
Let’s learn about different types of seaborn plots in this article.
2. Visualizing associations among two or more quantitative variables
About