Tag: based
Create a column based on condition in Pandas DataFrame
In this article, we will discuss how to create a column based on certain conditions in a pandas DataFrame. Table of Contents Preparing DataSet Method 1: Using numpy.where function Method 2: Using numpy.select() function Method 3: Using custom function Method 4: Using List Comprehension Summary Preparing DataSet To quickly get started, let’s create two sample …
Create a column based on condition in Pandas DataFrameRead More
Replace column values based on conditions in Pandas
In this article, we will discuss various methods to replace the column values based on conditions in a pandas DataFrame. Let’s look at the table of contents describing the list of methods. Table of Contents Preparing DataSet Method 1: Using .loc property of DataFrame Method 2: Using numpy.where() method Method 3: Using DataFrame.where() method Method …
Replace column values based on conditions in PandasRead More
Get Sublist from List based on condition in Python
This tutorial will discuss about unique ways to get a sublist from a list based on certain conditions in Python. Table Of Contents Method 1: Using filter() method Example 1: Get a sublist containing only odd numbers from list. Example 2: Get a sublist containing numbers between 70 to 80 from the list. Method 2: …
Get sublist from List based on indices in Python
This tutorial will discuss about unique ways to get sublist from list based on indices in Python. Table Of Contents Method 1: Using List Comprehension Method 2: Using operator.itemgetter() Summary Method 1: Using List Comprehension Iterate over list of index positions using a List comprehension, and for each index position, select the element at that …
Remove Elements From a NumPy Array Based on a Mask
This tutorial will discuss about unique ways to remove elements from a numpy array based on a mask. Suppose we have a numpy array of numbers, # create sample numpy array arr = np.array([20, 25, 15, 30, 22, 18]) Now we want to remove elements from this array based on a boolean array or a …
Install Deep Learning based Mozilla/TTS on Ubuntu – Google Cloud
Install Deep Learning based Mozilla/TTS on Ubuntu – Google Cloud. In this guide you are going to learn how to setup a Text to Speech solution based on deep learning with Python Flask application and configure Nginx and secure it with SSL. Mozilla TTS is a deep learning solution which favors simplicity over complex and …
Install Deep Learning based Mozilla/TTS on Ubuntu – Google CloudRead More
GPT4Free-Python based Discord Chatbot
GPT-4 is OpenAI’s most recent and powerful natural language processing model, which has yet to be published for public usage. The GPT4Free-Chatbot, on the other hand, provides a look into GPT-4’s potential by utilizing a variation of the GPT4Free model to produce answers based on prior discussion history. This Python-based Discord bot not only provides …