Bollinger Bands Algorithm – Python Binance API for Crypto Trading

A Bollinger Band consists of three lines: a simple moving average, an upper band, and a lower band. The assumption is that if the real price crosses over one of the bands, this can be seen as a signal to trade in or our of a given asset. For cryptocurrencies, breakout trades are more frequently … Read more

NumPy all() – A Simple Guide with Video

Syntax numpy.all(a, axis=None, out=None, keepdims=<no value>, *, where=<no value>) Argument Type Description a array_like Input array axis None, int, or tuple of int Optional. One axis or multiple axes along which logical AND should be performed. Per default, it computes logical AND on the flat array. If this is a tuple of integers, calculates logical … Read more

How to Find Outliers in NumPy Easily?

Can you spot the outliers in the following sequence: 000000001000000001? Detecting outliers fast can be mission critical for many applications in military, air transport, and energy production. This article shows you the most basic outlier detection algorithm: if an observed value deviates from the mean by more than the standard deviation, it is considered an … Read more

How to Use Slice Assignment in NumPy?

NumPy slice assignment allows you to use slicing on the left-hand side of an assignment operation to overwrite a specific subsequence of a NumPy array at once. The right side of the slice assignment operation provides the exact number of elements to replace the selected slice. For example, a[::2] = […] would overwrite every other … Read more

How to Rename Column Names in Pandas?

Problem Formulation Given a Pandas DataFrame with column labels, and a list of new column names as strings. How to change the column names to replace the original ones? Here’s an example using the following DataFrame: You want to rename the column names [‘Col_A’, ‘Col_B’, ‘Col_C’] to [‘a’, ‘b’, ‘c’] so that the resulting DataFrame … Read more

NumPy Boolean Indexing

You can index specific values from a NumPy array using another NumPy array of Boolean values on one axis to specify the indices you want to access. For example, to access the second and third values of array a = np.array([4, 6, 8]), you can use the expression a[np.array([False, True, True])] using the Boolean array … Read more

What’s the Best NumPy Book?

Fear of missing out in data science? Data science and machine learning are taking over. Data-driven decision making penetrates every single company nowadays. Data science is indeed the “sexiest job in the 21st century“! There is one Python library which is the basis of any data science related computation you can undertake as a Python … Read more

How to Change the Figure Size for a Seaborn Plot?

Seaborn is a comprehensive data visualization library used for the plotting of statistical graphs in Python. It provides fine-looking default styles and color schemes for making more attractive statistical plots. Seaborn is built on the top portion of the matplotlib library and is also integrated closely with data structures from pandas.                                                             How to change … Read more

How to Select Multiple Columns in Pandas

The easiest way to select multiple columns in Pandas is to pass a list into the standard square-bracket indexing scheme. For example, the expression df[[‘Col_1’, ‘Col_4, ‘Col_7’]] would access columns ‘Col_1’, ‘Col_4’, and ‘Col_7’. This is the most flexible and concise way for only a couple of columns. To learn about the best 3 ways … Read more