We are committed to provide service 24 X 7

Deals, Shopping, Training, Tools

Tag: conditions:

C++11 Multithreading – Part 4: Data Sharing and Race Conditions

Order of Executions Of Commands

In multithreading environment data sharing between threads is very easy. But this easy sharing of data can cause problems in application. One such problem is Race Condition. What is a Race Condition? Race condition is a kind of a bug that occurs in multithreaded applications. Advertisements When two or more threads perform a set of …

C++11 Multithreading – Part 4: Data Sharing and Race ConditionsRead More

C++11 Multithreading – Part 5: Using mutex to fix Race Conditions

In this article we will discuss how to use mutex locks to protect shared data in multithreaded environment and avoid race conditions. To fix race conditions in multi-threaded environment we need mutex i.e. each thread needs to lock a mutex before modifying or reading the shared data and after modifying the data each thread should …

C++11 Multithreading – Part 5: Using mutex to fix Race ConditionsRead More

Pandas – Select Rows by conditions on multiple columns

In this article we will discuss different ways to select rows in DataFrame based on condition on single or multiple columns. Following Items will be discussed, Advertisements Select Rows based on value in column Select Rows based on any of the multiple values in column Select Rows based on any of the multiple conditions on …

Pandas – Select Rows by conditions on multiple columnsRead More

Python Pandas : How to Drop rows in DataFrame by conditions on column values

In this article we will discuss how to delete rows based in DataFrame by checking multiple conditions on column values. DataFrame provides a member function drop() i.e. Advertisements DataFrame.drop(labels=None, axis=0, index=None, columns=None, level=None, inplace=False, errors=’raise’) It accepts a single or list of label names and deletes the corresponding rows or columns (based on value of axis …

Python Pandas : How to Drop rows in DataFrame by conditions on column valuesRead More

Python : Filter a dictionary by conditions on keys or values

In this article we will discuss different ways to filter contents from a dictionary by conditions on keys or value or on both. Suppose we have a dictionary in which int type element is key and string type elements are value i.e. Advertisements dictOfNames = { 7 : ‘sam’, 8: ‘john’, 9: ‘mathew’, 10: ‘riti’, …

Python : Filter a dictionary by conditions on keys or valuesRead More

Delete elements from a Numpy Array by value or conditions in Python

In this article we will discuss different ways to delete elements from a Numpy Array by matching value or based on multiple conditions. Remove all occurrences of an element with given value from numpy array Suppose we have a numpy array of numbers i.e. Advertisements # Create a numpy array from a list arr = …

Delete elements from a Numpy Array by value or conditions in PythonRead More

Multiline conditions with ‘if’ statements in Python

In this Python tutorial, we will learn how to style multi-line conditions in ‘if’ statements in Python. Agenda Multi-line conditions in ‘if’ statements with brackets Multi-line conditions in ‘if’ statements without brackets Summary Let’s dive into the tutorial. Advertisements Multi-line conditions in ‘if’ statements with brackets If you are using brackets around if statements, then …

Multiline conditions with ‘if’ statements in PythonRead 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

Cart

Your Cart is Empty

Back To Shop