Questions tagged [scalar]

In computing and programming, a scalar variable or value refers to a single value, as opposed to data structures such as arrays or lists.

In computing and programming, a scalar variable refers to a single value, as opposed to data structures such as or s. A scalar can be of any type, including a complex type such as an object or string. Being scalar only means that it is manipulated as a single value.

As an example, the string type in C++ is considered to be a scalar as it is a primitive type containing a single value, although in the C language there is no such primitive type. Thus, the char array implementation of strings typically used would not be considered as a scalar.

See also:

532 questions
2
votes
1 answer

how to solve "If using all scalar values, you must pass an index" problem pandas

Following my previous question , all is working well but when the list it's long it's showing this erreur, This is a simple of d : ['Houda Golf & Aquapark Novostar Monastir ', " {'All Inclusive soft': ('202', '175', '15%'), 'Demi Pension': ('161',…
HiFAR
  • 48
  • 1
  • 13
2
votes
2 answers

Check data structure and disregard if hash or array

I have a bunch of Hashes inside of an array. When checking my keys and values I get the expected output except for some special cases as they refer to more Arrays/Hashes. Think of something like this: @AoH = ( { 'husband' => "homer", 'wife' =>…
Sheograph
  • 77
  • 4
2
votes
1 answer

Scalar Function To Return the Result of A Select

I want a function to find the maximum allowable length of a field; executed as cmd.ExecuteScalar(). This definition fails, why? CREATE FUNCTION getPWLen ( ) RETURNS int AS BEGIN return select max(len((password))) as return_value from…
elbillaf
  • 1,952
  • 10
  • 37
  • 73
2
votes
1 answer

Perl: assignment within scalar and string matching (regex)

I understand the general aim of the following piece of code (i.e. sum up the numeric part of the string, e.g. for currstr="3S47M" then seqlength=50). But could someone explain me what is happening line by line ? In particular, I have issue to…
Erica Fary
  • 363
  • 1
  • 2
  • 10
2
votes
1 answer

Scalar functions using BLToolkit and Linq

I'm in the process of converting my SQL procedures to Linq using the BLToolkit library. Now I'm stuck on a little problem so if anyone know is this possible I will really appreciate the help. Anyway I have the sql query that looks something like…
Mladen Macanović
  • 1,099
  • 7
  • 17
2
votes
1 answer

ID cannot represent a non-string and non-integer value

Here is the thing, I'm building a simple inventory app that has products and parts. Products can have many parts and part can be in many Products. I'm using React and GraphQL with Strapi backend and I want to update a product to add or remove…
fedjedmedjed
  • 415
  • 1
  • 6
  • 16
2
votes
2 answers

How to correlate scalar values of two pandas dataframes

How do I correlate two pandas dataframes, find a single r value for all values? I don't want to correlate columns or rows, but all scalar values. One dataframe is the x axis, and the other dataframe is the y axis. I downloaded identically structured…
Kaleb Coberly
  • 420
  • 1
  • 4
  • 19
2
votes
1 answer

Perl Conditional not substituting in scalar value

For some reason, my if statements aren't working the way I want them to. use strict; use warnings; my $syl; my $name = "Chris"; print "Enter my name\n"; $syl = <>; if ($syl eq $name) { print "You entered my name!\n"; } else { print "That's not…
Christian
  • 107
  • 1
  • 1
  • 5
2
votes
2 answers

Pandas Multiple Column by Floating List Scalars

Suppose i have a loop structure that looks like the following: numlist = [0.1, 0.25, 0.5, 0.75, 0.90, 1.1, 1.25, 1.5] numlist = np.array(numlist,dtype=float) apcnt = np.zeros((4,8)) for x in range(5): for y in numlist: apcnt[x][y] =…
user2100039
  • 1,280
  • 2
  • 16
  • 31
2
votes
1 answer

What is the difference between @ and $ while accessing array elements in perl?

I have 2 basic questions on perl variables. @names = ('Super_!','Massive_@',"Black#", "Hole*"); print "Top Player: @names[0]\n"; print "Top Player: $names[0]\n"; Although there is no difference between output, what is the actual difference while…
2
votes
2 answers

Is b a scalar object in this case?

#include int main(void) { char b[5]; scanf("%4s%4s", b, b); printf("%s", b); } What is the exact definition of a scalar object? Is b a scalar object in this case?
user13469230
2
votes
2 answers

Create Alias in Scalar Subquery - SQLServer

I am doing this in SAS, however the principles should apply from sqlserver. I have a table that is the result of a full join on account number, so it looks like this: abc_accno xyz_accno 11111 . 22222 22222 . 66666 33333 …
Jess
  • 57
  • 5
2
votes
2 answers

Multiplying all elements of a vector by each element in a for loop in R

I have a vector (x) that I want to multiply by a scalar. I want the entire x vector to be multiplied by each scalar value. Here is an example of the result I want: x <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) scalar <- c(1.2, 1.4, 1.6, 1,7, 1.8, 1.9,…
James
  • 23
  • 1
  • 3
2
votes
1 answer

Why are 0d arrays in Numpy considered scalar?

In a sense, this already has an excellent answer: One should not think too hard about it. It's ultimately better for the mental health and longevity of the individual. Mental health and longevity are of course nice, but what about this…
Paul Panzer
  • 51,835
  • 3
  • 54
  • 99
2
votes
2 answers

IF contains more than one string do "this" else "this"

Trying to make a script that request more info (group Id) if there are SCOM groups with identical names: function myFunction { [CmdletBinding()] Param( [Parameter(Mandatory=$true)] [string[]]$ObjectName ) foreach ($o…
Freshman
  • 293
  • 3
  • 8
  • 19