scalar Questions
16
Solved
I have a function that takes the argument NBins. I want to make a call to this function with a scalar 50 or an array [0, 10, 20, 30]. How can I identify within the function, what the length of NBin...
24
Solved
I have two variables as follows.
a = 2
b = 3
I want to construct a DataFrame from this:
df2 = pd.DataFrame({'A':a, 'B':b})
This generates an error:
ValueError: If using all scalar values, you mus...
Dean asked 24/7, 2013 at 16:40
17
Solved
This failed:
define('DEFAULT_ROLES', array('guy', 'development team'));
Apparently, constants can't hold arrays. What is the best way to get around this?
define('DEFAULT_ROLES', 'guy|developme...
3
Solved
I'd like to implement a series of queries with rounding in Google Query Language, such as:
select round(age,-1), count(id) group by round(age,-1)
or any combination of int/floor/etc.
select int...
3
Solved
I am trying to find a proper way to calculate the scalar product of two ranges. For instance, the product of A1:A3 and B1:B3 would be A1*B1 + A2*B2 + A3*B3. Is there a good way to do this? Hardcodi...
4
Solved
When I have a tensor m of shape [12, 10] and a vector s of scalars with shape [12], how can I multiply each row of m with the corresponding scalar in s?
8
Solved
In various articles I have read, there are sometimes references to primitive data types and sometimes there are references to scalars.
My understanding of each is that they are data types of somet...
Lemon asked 8/7, 2011 at 10:22
2
Solved
Let's say I have an Array variable called p:
julia> p = [5]
julia> typeof(p)
Array{Int64,1}
How should I convert it to scalar? p may also be 2-dimensional:
julia> p = [1]''
julia> ...
3
Solved
I have a program whose main performance bottleneck involves multiplying matrices which have one dimension of size 1 and another large dimension, e.g. 1000:
large_dimension = 1000
a = np.random.ran...
Psia asked 23/4, 2021 at 12:39
2
Solved
I am trying to perform some simple if statements, but all of the newer cmdlets that are based upon [Microsoft.Management.Infrastructure.CimInstance] don't seem to expose a .count method?
$Disks = ...
Scrap asked 13/7, 2017 at 19:46
1
Solved
I just begin to learn Pytorch and create my first CNN. The dataset contains 3360 RGB images and I converted them to a [3360, 3, 224, 224] tensor. The data and label are in the dataset(torch.utils.d...
Arytenoid asked 6/2, 2021 at 7:51
5
Solved
2
How do I convert a pandas data frame with 1 row, 1 column into a scalar value?
import pandas as pd
data = {'col1': 1}
df = pd.DataFrame(data=d)
2
Solved
6
I'm new to python and trying to do a HW assignment and it keeps throwing this error back at me (in iPython Notebook):
"TypeError: unsupported operand type(s) for ** or pow(): 'list' and 'float'"
...
Clareta asked 2/10, 2013 at 14:49
6
Solved
Here is the code...
use strict;
use warnings;
my @array= (1,2,3,4,5);
my $scalar= 5;
@array= $scalar*@array;
print @array;
Need something that can perform similar function with little code. T...
4
Solved
The JavaDoc says:
SQLQuery org.hibernate.SQLQuery.addScalar(String columnAlias, Type type)
Declare a scalar query result
I know what executeScalar is in C#, but this scalar and C# scalar seem t...
3
Solved
I have created a Scalar Functions, it was created successfully, but when I call the function using select statement, it says invalid object, I altered the function, I got the message command comple...
Rudie asked 23/12, 2011 at 18:58
3
Solved
A list assignment in scalar context returns the number of elements on the right hand side:
scalar(my ($hello, $there, $world) = (7,8)); #evaluates to 2
Why does it evaluate the right hand side a...
Floriaflorian asked 16/2, 2012 at 7:24
2
Solved
Trying to get a linear equation y = m*x + c. I've the following lines of code, trying to add a scalar to an array.
m = 1.1; c = 0.11;
x = rand(1,2)
1×2 Array{Float64,2}:
0.920045 0.660015
y = ...
5
I have been trying to achieve something which should pretty trivial and is trivial in Matlab.
Using methods of OpenCV, I want to simply achieve something such as:
cv::Mat sample = [4 5 6; 4 2 5; 1 ...
Congreve asked 27/7, 2013 at 0:3
1
Solved
I am building a GraphQL schema programmatically and in need of a Timestamp scalar type; a Unix Epoch timestamp scalar type:
const TimelineType = new GraphQLObjectType({
name: 'TimelineType',
fie...
Lipski asked 13/8, 2018 at 21:25
3
I have some default configurations, and some specific configurations which would be configurable. I need to merge the specific configurations into the default configurations.
In the case that th...
Greisen asked 22/2, 2016 at 11:40
2
Solved
I am new to programming. In my latest Python 2.7 project I encountered the following:
RuntimeWarning: overflow encountered in long_scalars
Could someone please elaborate what this means and wh...
6
Solved
Hello so I want to multiply the integers inside a list.
For example;
l = [1, 2, 3]
l = [1*2, 2*2, 3*2]
output:
l = [2, 4, 6]
So I was searching online and most of the answers were rega...
Mcclurg asked 19/10, 2014 at 1:29
1 Next >
© 2022 - 2025 — McMap. All rights reserved.