Warum führt NP.Linspace (1,5,5, DTYPE = int, Endpoint = False) zu einem Array, das 1 zweimal enthält?Python

Python-Programme
Anonymous
 Warum führt NP.Linspace (1,5,5, DTYPE = int, Endpoint = False) zu einem Array, das 1 zweimal enthält?

Post by Anonymous »

Während Sie replizieren möchten: < /p>

Code: Select all

In [61]: np.arange(0,5)
Out[61]: array([0, 1, 2, 3, 4])
< /code>

Verwenden von np.linspace () < /code>, ich habe beobachtet: < /p>

In [70]: np.linspace(1,5,5, dtype = int, endpoint=False)
Out[70]: array([1, 1, 2, 3, 4])
Warum fasst NP.Linspace () den Wert 1 in diesem Fall zweimal ein?>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post