Operations in Python
Operations in Python
Pandas: How to Use a mutate() Function Equivalent to R
In the R programming language, we can use the mutate() function from the dplyr package to quickly add new columns to a data frame...
Operations in Python
How to Perform Least Squares Fitting in NumPy (With Example)
The method of least squares is a method we can use to find the regression line that best fits a given dataset.
We can use the linalg.lstsq()...
Operations in Python
NumPy: The Difference Between np.linspace and np.arange
When it comes to creating a sequence of values, linspace and arange are two commonly used NumPy functions.
Here is the subtle difference between the...
Operations in Python
How to Create Pandas DataFrame from a String
You can use the following basic syntax to create a pandas DataFrame from a string:
import pandas as pd
import io
df = pd.read_csv(io.StringIO(string_data),...
Operations in Python
Pandas: How to Use Equivalent of np.where()
You can use the NumPy where() function to quickly update the values in a NumPy array using if-else logic.
For example, the following code shows...
Operations in Python
NumPy mean() vs. average(): What’s the Difference?
You can use the np.mean() or np.average() functions to calculate the average value of an array in Python.
Here is the subtle difference between the...
Operations in Python
How to Calculate a Sigmoid Function in Python (With Examples)
A sigmoid function is a mathematical function that has an “S” shaped curve when plotted.
The most common example of a sigmoid function is the...
Subscribe
- Never miss a story with notifications
- Gain full access to our premium content
- Browse free from up to 5 devices at once
Must read