如何使用numpy.random生成int数矩阵(how to use numpy.random to generate a matrix of int number)

编程入门 行业动态 更新时间:2024-10-27 22:31:29
如何使用numpy.random生成int数矩阵(how to use numpy.random to generate a matrix of int number)

正如我在标题中提到的,我没有在我的代码中实现它。 这是我的代码,我尝试使用这两种方法,但最终它仍然无法工作。

# using python 2.7.12 import pandas as pd dates = pd.date_range('20141001', periods = 7) import numpy as np dates1 = pd.DataFrame(np.random.randn(7,3), index =dates, columns = list('ABC')) print dates1 dates2 = pd.DataFrame(np.random.randint(0,100), index =dates, columns = list('ABC'))

as I have mentioned in title, I fail to make it happened in my code. Here is my code, I try to use the two methods, but eventually it still cannot work.

# using python 2.7.12 import pandas as pd dates = pd.date_range('20141001', periods = 7) import numpy as np dates1 = pd.DataFrame(np.random.randn(7,3), index =dates, columns = list('ABC')) print dates1 dates2 = pd.DataFrame(np.random.randint(0,100), index =dates, columns = list('ABC'))

更多推荐

本文发布于:2023-07-28 23:32:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1310187.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:矩阵   如何使用   random   int   numpy

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!