Re: [Matplotlib-users] TypeError: can't multiply sequence by non-int of type 'float'

2015-09-28 Thread Eric Firing
On 2015/09/28 5:43 AM, Benjamin Root wrote:
> Confirmed using a fairly recent matplotlib checkout. Could you file a
> bug report? This is going to need some investigating.

Line3D.set_3d_properties is not doing anything to turn zs into an 
ndarray; in fact, when zs is a scalar, it is turning it into a list.  I 
suspect this is the place to make it an array.  Probably better here 
than anywhere farther down.  It also looks to me like Line3D.__init__ 
should be using self.set_3d_properties.

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] TypeError: can't multiply sequence by non-int of type 'float'

2015-09-28 Thread Jerzy Karczmarczuk

Le 28/09/2015 21:03, Benjamin Root a écrit :
> Where does he multiply a list by a float? The traceback shows the 
> multiplication happening much further down in the draw stack.

Look, Benjamin Root, I don't know, and I will not "investigate" where 
this operation happens. The diagnosis is a standard Python message. 
Thus, I took the program of Shakhti Kannan, and in a few seconds I changed


x = [1.0, 2.0, 3.0] into  x = np.array([1.0, 2.0, 3.0])

and in update_line:   x.append(1.0)   into x=np.concatenate((x,[1.0]))

And the program began to run without error messages. So, please, these 
are FACTS: somewhere the lists x,y,z get down in this draw stack.

> That shouldn't matter. ax.plot() accepts lists as valid inputs and it 
> should be converting them into numpy arrays under the hood.

There are two different issues, accepting any sequences/iterators is 
one, converting them into arrays - another one. This second operation 
visibly doesn't take place.



J. Karczmarczuk


--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] TypeError: can't multiply sequence by non-int of type 'float'

2015-09-28 Thread Benjamin Root
Jerzy,

On Mon, Sep 28, 2015 at 4:25 PM, Jerzy Karczmarczuk <
jerzy.karczmarc...@unicaen.fr> wrote:

>
> Le 28/09/2015 21:03, Benjamin Root a écrit :
>
>> Where does he multiply a list by a float? The traceback shows the
>> multiplication happening much further down in the draw stack.
>>
>
> Look, Benjamin Root, I don't know, and I will not "investigate" where this
> operation happens.


I did not ask you to investigate anything for me. You made the assertion
that the user was multiplying a list by a float, therefore, I assumed that
you were seeing something that I had not seen.


> The diagnosis is a standard Python message. Thus, I took the program of
> Shakhti Kannan, and in a few seconds I changed
>
>
> x = [1.0, 2.0, 3.0] into  x = np.array([1.0, 2.0, 3.0])
>
> and in update_line:   x.append(1.0)   into x=np.concatenate((x,[1.0]))
>
> And the program began to run without error messages. So, please, these are
> FACTS: somewhere the lists x,y,z get down in this draw stack.
>
>
I realize that, and that isn't in dispute. Nowhere did I say that
converting the lists into numpy arrays would not solve the problem.


> That shouldn't matter. ax.plot() accepts lists as valid inputs and it
>> should be converting them into numpy arrays under the hood.
>>
>
> There are two different issues, accepting any sequences/iterators is one,
> converting them into arrays - another one. This second operation visibly
> doesn't take place.
>
>
Of course the second operation isn't visible. I did say that it happens
"under the hood". His program is perfectly valid (albeit not ideal) and
demonstrated a bug in matplotlib's codebase. That is why I asked him to
file a bug report. My reading of your email is that you are upset for some
reason, but I have no clue why.

Ben Root
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] TypeError: can't multiply sequence by non-int of type 'float'

2015-09-28 Thread Daniele Nicolodi
On 28/09/15 22:25, Jerzy Karczmarczuk wrote:
> 
> Le 28/09/2015 21:03, Benjamin Root a écrit :
>> Where does he multiply a list by a float? The traceback shows the 
>> multiplication happening much further down in the draw stack.
> 
> Look, Benjamin Root, I don't know, and I will not "investigate" where 
> this operation happens. The diagnosis is a standard Python message. 
> Thus, I took the program of Shakhti Kannan, and in a few seconds I changed
> 
> 
> x = [1.0, 2.0, 3.0] into  x = np.array([1.0, 2.0, 3.0])
> 
> and in update_line:   x.append(1.0)   into x=np.concatenate((x,[1.0]))
> 
> And the program began to run without error messages. So, please, these 
> are FACTS: somewhere the lists x,y,z get down in this draw stack.

No one is doubting that.

>> That shouldn't matter. ax.plot() accepts lists as valid inputs and it 
>> should be converting them into numpy arrays under the hood.
> 
> There are two different issues, accepting any sequences/iterators is 
> one, converting them into arrays - another one. This second operation 
> visibly doesn't take place.

And this is a bug in matplotlib that needs to be fixed. Your solution is
just a workaround to an existing problem in matplotlib.

Cheers,
Daniele


--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] New version of "scipy lecture notes"

2015-09-28 Thread Gael Varoquaux
Dear Pythonistas,

We have just released a new version of the "scipy lecture notes":
http://www.scipy-lectures.org/

These are a consistent set of materials to learn the core aspects of the
scientific Python ecosystem, from beginner to expert. They are written
and maintained by a set of volunteers and published under a CC-BY
license.

Highlights of the latest version includes:

 * a chapter giving a introduction to statistics in Python
 * a new layout with emphasis on readability including on small devices
 * fully doctesting for Python 2 and 3 compatibility

We hope that you will find these notes useful, for you, your colleagues,
or your students.

Gaël



--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users