conditional-statements Questions
7
Solved
Is there anyway to use inline conditions in Lua?
Such as:
print("blah: " .. (a == true ? "blah" : "nahblah"))
Si asked 2/4, 2011 at 20:56
8
Solved
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 following criteria:
if row A == B: 0
if rowA > B: 1
if row A < B: -1
so given the above...
Roy asked 11/2, 2014 at 12:49
5
Solved
int a = 10;
int b = 10;
int c = 10;
I am trying to find out if there is alternate way to compare if three ints or anything are equal.
The way i am currently doing is
if( (a == b) && (...
Forwhy asked 12/12, 2013 at 1:23
1
Solved
I'm new to javascript in general and learning Astro. I couldn't figure out what's wrong with this conditional? The site builds but it's not finding matches and always ends in "unknown kind&quo...
Treva asked 8/10, 2023 at 7:22
5
Solved
I have a dataframe
test = spark.createDataFrame([('bn', 12452, 221), ('mb', 14521, 330), ('bn', 2, 220), ('mb', 14520, 331)], ['x', 'y', 'z'])
test.show()
# +---+-----+---+
# | x| y| z|
# +---+----...
Sachasachem asked 28/2, 2018 at 4:25
7
Solved
I'm just beginning to work through SICP (on my own; this isn't for a class), and I've been struggling with Exercise 1.6 for a couple of days and I just can't seem to figure it out. This is the one ...
Diastasis asked 23/7, 2009 at 11:53
2
In the MDN documentation for "Statements and declarations" it is mentioned:
The terms "statement" and "declaration" have a precise meaning in the formal syntax of Jav...
Remonstrant asked 19/9, 2023 at 6:18
10
I have multiple tasks depend from the value of variable1. I want to check if the value is in {{ variable1 }} but I get an error:
- name: do something when the value in variable1
command: <comma...
Leotie asked 8/4, 2016 at 10:8
10
Solved
I need to set the value of one column based on the value of another in a Pandas dataframe. This is the logic:
if df['c1'] == 'Value':
df['c2'] = 10
else:
df['c2'] = df['c3']
I am unable to get t...
Ulla asked 7/3, 2018 at 21:1
8
Solved
I need to check if a file contains a specific line. This file is written continuously by someone, so I put the check inside a while loop.
FILE="/Users/test/my.out"
STRING="MYNAME&quo...
Twophase asked 4/4, 2014 at 11:28
33
Solved
I am new to Laravel. How do I find if a record exists?
$user = User::where('email', '=', Input::get('email'));
What can I do here to see if $user has a record?
Insomuch asked 23/11, 2014 at 22:24
4
Solved
I have the below case statement in python,
pd_df['difficulty'] = 'Unknown'
pd_df['difficulty'][(pd_df['Time']<30) & (pd_df['Time']>0)] = 'Easy'
pd_df['difficulty'][(pd_df['Time']>=30) ...
Chromatogram asked 12/3, 2018 at 5:23
4
Solved
Right now I have a class called A.
I have some code like this..
from my.package.location.A import A
...
foo = A.doSomething(bar)
This is great.
But now I have a new version of A called A, b...
Parasitology asked 22/7, 2011 at 17:25
6
Solved
I want to test to see if a variable has been assigned a variable and if not perform action. How can this be achieve?
I've attempted it with the following code but receive the error: The right ope...
Inboard asked 7/2, 2012 at 18:9
4
I want to use the if else statement in the ternary operator
if (open) {
setOpen(false)
} else {
setOpen(true)
navigator.clipboard.writeText(link)
}
There is no problem in "if" I ca...
Boong asked 6/6, 2022 at 17:26
4
I have a data frame with more than 400.000 observations and I'm trying to add a column to it which its values depend on another column and sometimes multiple ones.
Here is a simpler example of wha...
Dispermous asked 19/5, 2016 at 10:50
3
Solved
My question is simple, I have a dataframe and I groupby the results based on a column and get the size like this:
df.groupby('column').size()
Now the problem is that I only want the ones where s...
Dunaville asked 8/7, 2015 at 20:48
3
Solved
Basically I would like a select statement that would function like this
SELECT *
FROM table
WHERE column IS NOT INT
Is there a condition like this or how do you check for non-integers in an nv...
Fungosity asked 26/4, 2011 at 11:9
4
Solved
I am trying to understand how the switch is working in the dart. I have very simple code:
methodname(num radians) {
switch (radians) {
case 0:
// do something
break;
case PI:
// do something ...
Polytypic asked 15/6, 2014 at 11:47
3
Solved
I would like some help with syntax for a print statment that has multiple conditions. Currently, the quotes for '{{inventory_hostname}}' is causing errors and if I remove the quotes the playbook ru...
Socman asked 29/1, 2019 at 19:8
6
Solved
My system sends a configuration array to a function like this:
callThatFunction( array(k1 => v1, k2 => v2, ... kn=vn));
I want to make one of the key value pairs, conditional upon some...
Doi asked 7/11, 2010 at 17:44
2
Solved
Is it possible in azure devops that the choice of the first parameter by the user, determines the second parameter (type, displayName etc.)?
For example:
parameters:
- name: parametr1
displayName:...
Cohosh asked 28/9, 2020 at 21:55
3
Solved
What should I do if I want to skip the whole loop in Ansible?
According to guidelines,
While combining when with with_items (see Loops), ... when statement is processed separately for each ite...
Mufti asked 22/6, 2016 at 9:45
7
Solved
I have a for loop over an array. What I want to do is test for a certain condition in the loop and skip to the next iteration if true:
For i = LBound(Schedule, 1) To UBound(Schedule, 1)
If (Sched...
Pyrargyrite asked 30/12, 2011 at 14:50
14
Solved
How can I use a condition inside a switch statement for JavaScript?
In the example below, a case should match when the variable liCount is <= 5 and > 0; however, my code does not work:
switch...
Placeman asked 28/3, 2011 at 19:57
© 2022 - 2024 — McMap. All rights reserved.