Last active
September 29, 2015 10:24
-
-
Save goindwalia/42a5e3ede1192d48f41e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
# getting values from user for no. of rows and columns | |
n = int(raw_input("Enter no. of rows: ")) | |
m = int(raw_input("Enter no. of columns: ")) | |
#generating matrix with the help of numpy | |
matrix = numpy.zeros(shape=(n,m)) | |
for rows in range(0,n): | |
x = float(raw_input("Enter the value of x for row %s: " % int(rows+1))) | |
matrix[rows] = [x ** n for n in range(0, m)] | |
print matrix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment