Top "Conditional" questions

In computer science, conditional statements, conditional expressions and conditional constructs are features of a programming language which perform different computations or actions depending on whether a programmer-specified boolean condition evaluates to true or false.

Check if something is (not) in a list in Python

I have a list of tuples in Python, and I have a conditional where I want to take the branch …

python list conditional membership
How to combine multiple conditions to subset a data-frame using "OR"?

I have a data.frame in R. I want to try two different conditions on two different columns, but I …

r conditional dataframe
Laravel Checking If a Record Exists

I am new to Laravel. Please excuse the newbie question but how do I find if a record exists? $user = …

php laravel laravel-5 eloquent conditional
VBA - how to conditionally skip a for loop iteration

I have a for loop over an array. What I want to do is test for a certain condition in …

vba conditional loops
IF... OR IF... in a windows batch file

Is there a way to write an IF OR IF conditional statement in a windows batch-file? For example: IF [%var%] == [1] …

windows batch-file if-statement cmd conditional
How do I combine 2 select statements into one?

I am a noob when it comes to SQL syntax. I have a table with lots of rows and columns …

sql select conditional
(Excel) Conditional Formatting based on Adjacent Cell Value

I'm trying to apply conditional formatting in Excel on a range of cells, based on the adjacent cell's value, to …

excel formatting conditional
Pandas/Python: Set value of one column based on value in another column

I need to set the value of one column based on the value of another in a Pandas dataframe. This …

python pandas conditional
Creating a new column based on if-elif-else condition

I have a DataFrame df: A B a 2 2 b 3 1 c 1 3 I want to create a new column based on the …

python pandas conditional
Replacing Numpy elements if condition is met

I have a large numpy array that I need to manipulate so that each element is changed to either a 1 …

python arrays numpy conditional