PythonʹÓÃnp.arangeʱÓöµ½µÄÒ»¸öÎÊÌâ?

·½°¸Ò»:for i in np.linspace(1.5,2.2,7,endpoint=False): ... print(i)·½°¸¶þ:import decimal for i innp.arange(decimal.Decimal(1.5),decimal.Decimal(2.2),decimal.Decimal(0.1)): ... print(i)·½°¸Èý:for i in np.arange(15,22,1): ... print(i/10)


python - np.linspace ºÍ np.arange ÓÐÊ²Ã´Çø±ð...

>>> np.linspace(0,1,11)array([0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. ]) np.arange ÔÊÐíÄú¶¨Òå²½³¤²¢Íƶϲ½Êý(Äú»ñµÃµÄÖµµÄÊýÁ¿). >>> np....


Ïà¹ØËÑË÷

ÈÈÃÅËÑË÷