如何使用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'))更多推荐
发布评论