×

Python Tutorial

Python Basics

Python I/O

Python Operators

Python Conditions & Controls

Python Functions

Python Strings

Python Modules

Python Lists

Python OOPs

Python Arrays

Python Dictionary

Python Sets

Python Tuples

Python Exception Handling

Python NumPy

Python Pandas

Python File Handling

Python WebSocket

Python GUI Programming

Python Image Processing

Python Miscellaneous

Python Practice

Python Programs

Scalar Multiplication of Vector using NumPy | Linear Algebra using Python

Linear Algebra using Python | Scalar Multiplication of Vector using NumPy: Here, we are going to learn how to find scalar multiplication of vector using numpy in Python?
Submitted by Anuj Singh, on May 21, 2020

Prerequisite: Defining Vector using Numpy

To read about the Scalar Multiplication of Vector, visit: Scalar Multiplication of Vector

Here, we will implement the python program to find the Scalar Multiplication of Vector using NumPy.

Python code to find scalar multiplication of vector using NumPy

# Linear Algebra Learning Sequence
# Scalar Multiplication of Vector using NumPy

import numpy as np

# Use of np.array() to define a vector
V1 = np.array([[14],[23],[32]])

# Scalar Multiplication with c =2
print("The Vector V1 = ", V1)
print("The Vector 2xV = ", 2*V1)

Output:

The Vector V1 =  [[14]
 [23]
 [32]]
The Vector 2xV =  [[28]
 [46]
 [64]]
Advertisement
Advertisement


Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2025 www.includehelp.com. All rights reserved.