NumPy stands for **Num**erical **Py**thon.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.

- Different Ways to Create NumPy Arrays
- Python List vs NumPy Arrays
- Attributes of NumPy Array
- Indexing and Slicing NumPy Array
- NumPy Axis in Detail
- Operations on NumPy Arrays.

**How to create a vector from python lists?**

A vector is a one-dimensional array.

**How to create matrices from a list of lists?**

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

sepas the delimiter string. Ifmaxsplitis given, at mostmaxsplitsplits are done (thus, the list will have at most`maxsplit+1`

elements). Ifmaxsplitis 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 Series
- Pandas DataFrame
- How to create Pandas DataFrame?
- Understanding Pandas DataFrames
- Sorting Pandas DataFrames
- Indexing and Slicing Pandas Dataframes
- Subset DataFrames based on certain conditions
- How to fill/drop the null values?
- Lambda functions to modify dataframe
- Merge, Concatenate dataframes
- Grouping and aggregating

Pandas supports two datastructures

- Pandas Series
- Pandas DataFrame

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.

- How point is represented as a vector?
- Distance between point and origin
- Distance between two points
- Row Vector, Column Vector, Matrix
- Mathematical Operations on Vector
- Dot Product between two vectors
- Geometric Interpretation of the Dot Product

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.

- Classification Accuracy
- What we need Confusion Matrix?
- What is the Confusion Matrix?
- Terminologies used in Confusion Matrix
- Metrics Calculated from Confusion Matrix

1.Precision

2. Recall - Which metric to choose precision or recall?
- F1 Score
- F1 Score vs Accuracy
- Calculating metrics from the confusion matrix
- Confusion matrix using scikit…

- str.replace()
- re.sub()
- re.subn()

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.

- What is the correlation?
- Types of correlation.
- Pearson’s Correlation Coefficient
- What is covariance?
- Why correlation is preferred over covariance?
- What is the range of the correlation coefficient?
- Interpreting Pearson's correlation coefficient.
- How to visualize the correlation?
- Calculating Covariance and Coefficient Correlation.
- Correlation vs Covariance

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.

**Visualizing the distribution of the dataset**

- Histogram
- Kdeplot
- distplot
- jointplot
- pairplot

**2. Visualizing associations among two or more quantitative variables**

- scatterplot
- lineplot…

About