Re: 1062: Hw 6

5 views
Skip to first unread message

William Stein

unread,
Mar 8, 2012, 3:44:09 PM3/8/12
to Gautam Sisodia, uw-sage-2012
On Wed, Mar 7, 2012 at 10:42 PM, Gautam Sisodia
<gau...@math.washington.edu> wrote:
> Sounds good. I've run into an issue with list_plot3d. The following works:
>
> A = numpy.zeros((2,2,2))
> list_plot3d(A[0])
>
> But if I try to plot a different slice of A, as in
>
> list_plot3d(A[:,0])
>
> I get an error, namely
>
> TypeError: numpy matrix must be either c_contiguous or f_contiguous
>
> What am I doing wrong, or is there an easy work-around? Thanks,

Use

list_plot3d(A[:,0].copy())

This will make a copy of A[:,0], and the copy will be stored
*contiguously* in memory.

William

>
> -Gautam
>
>
> On Sat, 3 Mar 2012, William Stein wrote:
>
>> GRADE: 100%
>>
>> I think it will be good for both game of life projects to present, so
>> people can see how different presentations on seemingly the same topic
>> can be.
>>
>> It's good how your project is using all the tools I taught in the
>> class (numpy, Cython, etc.)
>>
>> William
>>
>> On Fri, Mar 2, 2012 at 7:04 PM, Gautam Sisodia
>> <gau...@math.washington.edu> wrote:
>>>
>>> Hi William,
>>>
>>> Attached is the rough draft for our project.
>>>
>>> We are currently scheduled to present after a Game of Life project, and
>>> since our project is essentially a Game of Life project, we feel that our
>>> presentation would be redundant. If you think our projects are different
>>> enough (or the other project doesn't present) we wouldn't mind
>>> presenting.
>>>
>>> -Zach Folwick, Shirshendu Ganguly and Gautam Sisodia
>>
>>
>>
>>
>> --
>> William Stein
>> Professor of Mathematics
>> University of Washington
>> http://wstein.org
>>
>

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Reply all
Reply to author
Forward
0 new messages