# Multiply Numpy n x 2 array by n x 1 array

Assuming I have a Numpy n x 2 array y: array([[1, 1], [2, 3], [1, 4], …]) and a Numpy n x 1 array x: array([2, 4, 5, …]), how can I efficiently obtain the following result, n x 2 array: array([2, 2], [8, 12], [5, 20], …]), where each element (array) of the y… Read More Multiply Numpy n x 2 array by n x 1 array

# Multiplication Table Based On BOTH User Inputs

I am trying to create a multiplication table that is based on BOTH user inputs. I want to ask the user the first and second integer and then to print out the first integer by the second integer that amount of times. For example, if I choose 5 for first integer and 10 for second… Read More Multiplication Table Based On BOTH User Inputs

# Multiplying elements in arrays using the forEach function

I’m currently learning about arrays and the different ways to manipulate them. I was asked to: "multiply 5 to the given array using the forEach function" Here is my code so far. It looks as if everything works when I console.log in the forEach function, but when I log the console for the array it’s… Read More Multiplying elements in arrays using the forEach function

# Mutiplying dataframe by -1 loses data

I have an issue and I have no idea what is causing it.. I have a very very simply dataframe which looks like the following; A B 01/01/2022 -34 -102.34 02/01/2022 -4 -89.23 03/01/2022 -78 -43.2 . . . 31/12/2022 -32 -34.21 I simply need to convert this dataframe to positive numbers. When I do… Read More Mutiplying dataframe by -1 loses data

# Multiply Array position Swift

I need to fix this code in Swift language. I don’t know how can I to multiply array positions mut1 and mut2 values. The result is 8. var mut1 = [7,-4,5] var mut2 = [3,2,-1] var multiply = mut1 * mut2 + mut1 * mut2 + mut1 * mut2 print(multiply) >Solution : If you want… Read More Multiply Array position Swift

# Input any mathematical table without using loops

I need to print mathematical table without using any loop (for, while, do while, etc.). Can anyone help me out, the easiest example I could find was writing console.writeline 10times for each line. This is my code! using System; using System.Linq; class Question4 { int product, i=1; public static void Main(string[] args) { int num;… Read More Input any mathematical table without using loops

# Java multiplication table, Writer writes in second line instead of first

It’s supposed to be a multiplication table in the shape of a square, but the writer doesn’t write the numbers in the first line and the first column. try { File file = new File("multi.txt"); // FileWriter Writer = new FileWriter("multi.txt"); BufferedWriter Writer = new BufferedWriter(new FileWriter(file)); for (int o = 1; o <= n;… Read More Java multiplication table, Writer writes in second line instead of first