浮子范围列表 [英] list of range of floats
问题描述
我正在尝试创建一系列浮动并遇到问题。
我一直在尝试类似的事情:
a = 0.0
b = 10.0
flts = range(a,b)
fltlst.append(flts)
当我运行它时,我得到以下DeprecationWarning:整数参数
预期,浮动。我怎样才能存储花车清单?
TIA
史蒂夫
Steve写道:
我正在尝试创建一系列浮动并遇到问题。
我一直在尝试这样的事情:
a = 0.0
b = 10.0
flts = range(a ,b)
fltlst.append(flts)
当我运行它时,我得到以下DeprecationWarning:整数参数
预期,浮动。如何存储浮动列表?
TIA
史蒂夫
范围仅限整数。如果你想要花车,你必须自己编写
版本。
2007年2月14日, Steve< sa ****** @ southslope.netwrote:
我正在尝试创建一系列浮动并遇到问题。
我一直在尝试这样的事情:
a = 0.0
b = 10.0
flts = range(a,b)
fltlst.append(flts)
当我运行它时,我得到以下DeprecationWarning:整数争论
预期,浮动。如何存储浮动列表?
在零到十之间会有一个*巨大的浮点数。你真的希望所有这些都在你的清单中吗?
我希望你有一些额外的内存数据?
或者你只想将整数值作为浮点数?
适合=列表(浮点数(a)表示范围内(0,10))
-
干杯,
Simon B
si***@brunningonline.net
http://www.brunningonline.net/simon/blog/
2007年2月14日星期三17:27:06 +0000,Dale Strickland-Clark写道:
Steve写道:
>我正在尝试创建浮动列表范围并遇到问题。
我一直在尝试这样的事情:
< br => a = 0.0
b = 10.0
flts =范围(a,b)
fltlst.append(flts)
>当我运行它时,我得到以下DeprecationWarning:整数参数
预期,浮动。如何存储花车清单?
TIA
史蒂夫
范围只有整数。如果你想要花车,你必须自己编写
版本。
我很害怕。感谢您的快速回复。
Steve
I''m trying to create a list range of floats and running into problems.
I''ve been trying something like:
a = 0.0
b = 10.0
flts = range(a, b)
fltlst.append(flts)
When I run it I get the following DeprecationWarning: integer argument
expected, got float. How can I store a list of floats?
TIA
Steve
Steve wrote:
I''m trying to create a list range of floats and running into problems.
I''ve been trying something like:
a = 0.0
b = 10.0
flts = range(a, b)
fltlst.append(flts)
When I run it I get the following DeprecationWarning: integer argument
expected, got float. How can I store a list of floats?
TIA
Steverange only does ints. If you want floats, you''ll have to write your own
version.
On 2/14/07, Steve <sa******@southslope.netwrote:I''m trying to create a list range of floats and running into problems.
I''ve been trying something like:
a = 0.0
b = 10.0
flts = range(a, b)
fltlst.append(flts)
When I run it I get the following DeprecationWarning: integer argument
expected, got float. How can I store a list of floats?There would be an *enormous* number of floats between zero and ten. Do
you really want all of them in your list? I hope you have a few
terrabytes of RAM...
Or do you just want the integer values as floats?
fits = list(float(a) for a in range(0, 10))
--
Cheers,
Simon B
si***@brunningonline.net
http://www.brunningonline.net/simon/blog/
On Wed, 14 Feb 2007 17:27:06 +0000, Dale Strickland-Clark wrote:
Steve wrote:
>I''m trying to create a list range of floats and running into problems.
I''ve been trying something like:
a = 0.0
b = 10.0
flts = range(a, b)
fltlst.append(flts)
When I run it I get the following DeprecationWarning: integer argument
expected, got float. How can I store a list of floats?
TIA
Steve
range only does ints. If you want floats, you''ll have to write your own
version.I was afraid of that. Thanks for the quick reply.
Steve
这篇关于浮子范围列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!