学习笔记(10):NumPy数据分析-NumPy创建数组的方法-fromfile

立即学习:https://edu.csdn.net/course/play/25878/316059?utm_source=blogtoedu

fromfile:

      a1=np.arange(6).reshape(2,3)

      print(a1)

      with open('test.data','w') as if:

               a=np.fromfile(f,dtype=int)

               print(a,reshape(2,3))

       with open('test.data') as if:

                a=np.fromfile(f,dtype=int)

                print(a.reshape(2,3))

发布了24 篇原创文章 · 获赞 8 · 访问量 1171

猜你喜欢

转载自blog.csdn.net/qq_41739233/article/details/104241515