[sage-support] how to create a long dict?

2015-05-19 Thread Huayi Wei
Hi, everyone, I want to create a sparse matrix, so I need to create a dict first. I try to use `dict.fromkeys()` to do it, which like following: ``` sage: keys = [(0,1),(1,2)] # the length of keys maybe very long sage: values = [0,1] # values have the same length as keys sage: d = dict.fromkey

Re: [sage-support] how to create a long dict?

2015-05-19 Thread Huayi Wei
Hi, Dan, Thanks very much! It works very well. -- Huayi On 2015年05月20日 09:39, Dan Drake wrote: On Wed, 20 May 2015 at 06:27AM +0800, Huayi Wei wrote: Hi, everyone, I want to create a sparse matrix, so I need to create a dict first. I try to use `dict.fromkeys()` to do it, which like following

[sage-support] method to get the left-lower and right-upper triangular parts of a matrix

2015-05-19 Thread Huayi Wei
Hi, everyone, I have a sage matrix, and I want to get its left-lower and right-upper triangular parts. Does there exist any method to get them directly? In matlab, there are two functions `triu` and `tril` to do such things. Does sage have the similar functions? Best Huayi -- You receiv

Re: [sage-support] method to get the left-lower and right-upper triangular parts of a matrix

2015-05-19 Thread Huayi Wei
efficient ways for sparse matrix, can you give me some suggestion? Thanks very much. Best Huayi On 2015年05月20日 14:26, Vincent Delecroix wrote: Hi Huayi, On 20/05/15 08:20, Huayi Wei wrote: I have a sage matrix, and I want to get its left-lower and right-upper triangular parts. Does there

[sage-support] Can't install latest sagmath-upstream-binary from ppa

2015-05-31 Thread Huayi Wei
Hi, there, I met the following error when I install sage from ppa. My system is Ubuntu 14.04 LTS 64bit. I need your help. Thanks very much. Best Huayi ``` :~$ sudo apt-get install sagemath-upstream-binary Reading package lists... Done Building dependency tree Reading state information... Don

Re: [sage-support] Can't install latest sagmath-upstream-binary from ppa

2015-06-01 Thread Huayi Wei
th/+build/7362961/+files/sagemath-upstream-binary_6.6ppa1_amd64.deb> sudo apt-mark hold sagemath-upstream-binary And we can unhold the version-hold when we have a working PPA again. Hopefully within a few days. Apologies for the inconvenience. Regards, Jan On 1 June 2015 at 01:06, Huayi Wei &