On 03/23/2018 12:02 AM, Noor Alghanem wrote:
> Hello,
>
> I am trying to write a program that is basically multiplying two matrices
> one of size 1x8 and the other one of size 8x4. The different thing that I
> am trying to figure out is that I want the program to ask the user to enter
> the values
Hello,
I am trying to write a program that is basically multiplying two matrices
one of size 1x8 and the other one of size 8x4. The different thing that I
am trying to figure out is that I want the program to ask the user to enter
the values for the 1x8 matrix only which will be used in the multip
On 22/03/18 11:35, Connie Callaghan wrote:
> Hi,
> I was just looking help for a matrix that I am building, it needs to look
> like this
> 1, 0, 0, ...,0
> A,b,c,0,...,0
> 0,a,b,c,...,0
> 0,0,a,b,c,..0
> 0,0,0,a,b,c,...,0
> 0,0,0,0...0, 1
What exactly are the a,b,c values?
Are they variables o
Connie Callaghan wrote:
> Hi,
> I was just looking help for a matrix that I am building, it needs to look
> like this 1, 0, 0, ...,0
> A,b,c,0,...,0
> 0,a,b,c,...,0
> 0,0,a,b,c,..0
> 0,0,0,a,b,c,...,0
> 0,0,0,0...0, 1
>
> It has n rows and columns and the first and last line has to have 1s at
> t
Hi,
I was just looking help for a matrix that I am building, it needs to look like
this
1, 0, 0, ...,0
A,b,c,0,...,0
0,a,b,c,...,0
0,0,a,b,c,..0
0,0,0,a,b,c,...,0
0,0,0,0...0, 1
It has n rows and columns and the first and last line has to have 1s at the
corners as shown, and a,b,c going diago
On Sun, Apr 05, 2015 at 11:12:32AM -0300, Narci Edson Venturini wrote:
> The next code has an unexpected result:
>
> >>>a=3*[3*[0]]
> >>>a
> [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
> >>>a[0][0]=1
> >>>a
> [[1, 0, 0], [1, 0, 0], [1, 0, 0]]
It isn't obvious, and it is *very* common for people to run into
On 05/04/15 15:12, Narci Edson Venturini wrote:
The next code has an unexpected result:
a=3*[3*[0]]
Note that this makes three references to
the list of 3 references to 0.
In other words you reference the same list 3 times.
So when you change the first copy you change the
other 2 also.
Put a
On 4/5/2015 7:12 AM, Narci Edson Venturini wrote:
The next code has an unexpected result:
a=3*[3*[0]]
a now contains three references to the same object, hence the results
you show below.
You can create three distinct objects as follows:
>>> a = [ [0,0,0] for i in (0,1,2) ]
>>> a[1][1]=1
The next code has an unexpected result:
>>>a=3*[3*[0]]
>>>a
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
>>>a[0][0]=1
>>>a
[[1, 0, 0], [1, 0, 0], [1, 0, 0]]
The code assigned to "1" a(0,0), a(1,0) and a(2,0).
It was expected: [[1, 0, 0], [0, 0, 0], [0, 0, 0]]
When the followind code is ran, them the corre
On 13/07/13 05:05, Jack Little wrote:
Is there a way in python to do matrix multiplication and its inverse? No
external modules is preferred, but it is ok.
If you have numpy, you should use that.
If you want a pure Python version, here's a quick and dirty matrix multiplier
that works only f
On Friday 01 February 2008 23:13, Dinesh B Vadhia wrote:
> I've posted this on the Scipy forum but maybe there are answers on
> Tutor too. I'm performing a standard Scipy matrix* vector
> multiplication, b=Ax , (but not using the sparse module) with
> different sizes of A as follows:
>
>
> Assumin
On Friday 01 February 2008 23:13, Dinesh B Vadhia wrote:
> I've posted this on the Scipy forum but maybe there are answers on
> Tutor too. I'm performing a standard Scipy matrix* vector
> multiplication, b=Ax , (but not using the sparse module) with
> different sizes of A as follows:
>
>
> Assumin
I've posted this on the Scipy forum but maybe there are answers on Tutor too.
I'm performing a standard Scipy matrix* vector multiplication, b=Ax , (but not
using the sparse module) with different sizes of A as follows:
Assuming 8 bytes per float, then:
1. matrix A with M=10,000 and N=15,000
This doesn't seem to have been answered...
"Shi Mu" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I can not understand the use of "cell in row" for two times in the code:
>
> # convert the matrix to a 1D list
> matrix = [[13,2,3,4,5],[0,10,6,0,0],[7,0,0,0,9]]
> items = [cell for ro
I can not understand the use of "cell in row" for two times in the code:
# convert the matrix to a 1D list
matrix = [[13,2,3,4,5],[0,10,6,0,0],[7,0,0,0,9]]
items = [cell for row in matrix for cell in row]
print items
___
Tutor maillist - Tutor@python.o
Brian van den Broek wrote:
2) To get around that, and be more efficient with matricies with many
empty cells:
.>>> my_matrix_as_dict = {(1,1):4, (1,2):6, (1,3):8,
(2,1):56, (2,3):12,
(3,1):3, (3,2):3}
.>>> my_matrix_as_dict[(3,1)]
3
.>>> my_matrix_as_dic
On Sun, 19 Dec 2004, Bugra Cakir wrote:
> I want to create a matrix in Python. For example 3x4 how can i
> create this? thanks
Just for the heck of it would you tell us what you want to do with the
matrix? Sometimes there are interesting alternate ways to do things that
might not be obvious to a
On Sun, 19 Dec 2004, Bugra Cakir wrote:
> I want to create a matrix in Python. For example 3x4 how can i
> create this? thanks
Hi Bugra,
Just for reference, here's the relevant FAQ about how to do matrices in
Python:
http://python.org/doc/faq/programming.html#how-do-i-create-a-multidimension
> A list of lists is the most logical construction.
> But -- you don't need to assemble the rows separately --
> this works too:
> >>> my_matrix_as_lists = [ [4, 6, 8, 1],\
> ... [2, 5, 1, 3],\
> ... [2, 1, 2, 8] ]
And you don't need the line continuation characters either.
Because Python ca
Rob Kapteyn said unto the world upon 2004-12-19 22:44:
Hello to the list !
A list of lists is the most logical construction.
But -- you don't need to assemble the rows separately --
this works too:
>>> my_matrix_as_lists = [ [4, 6, 8, 1],\
... [2, 5, 1, 3],\
...
Juan:
Thanks for the tip, but the correct address seems to be:
http://www.scipy.com/
the .org does not answer.
Now I have to check out the graphing tools they have:-)
Rob
On Dec 19, 2004, at 8:01 PM, Juan Shen wrote:
Try SciPy.
http://www.scipy.org/
It has mat class to handle matrix and much els
Hello to the list !
A list of lists is the most logical construction.
But -- you don't need to assemble the rows separately --
this works too:
>>> my_matrix_as_lists = [ [4, 6, 8, 1],\
... [2, 5, 1, 3],\
... [2, 1, 2, 8] ]
Try SciPy.
http://www.scipy.org/
It has mat class to handle matrix and much else.
Juan
Bugra Cakir wrote:
hi,
I want to create a matrix in Python. For example 3x4 how can i
create this? thanks
___
Tutor maillist - [EMAIL PROTECTED]
http://mail.pyt
Bugra Cakir said unto the world upon 2004-12-19 10:33:
hi,
I want to create a matrix in Python. For example 3x4 how can i
create this? thanks
___
Tutor maillist - [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor
Hi,
at least two ways usin
hi,
I want to create a matrix in Python. For example 3x4 how can i
create this? thanks
___
Tutor maillist - [EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/tutor
25 matches
Mail list logo