前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >查看deepSEA中GitHub上代码的数据是什么样子的

查看deepSEA中GitHub上代码的数据是什么样子的

作者头像
bye
发布2021-12-07 15:15:26
5100
发布2021-12-07 15:15:26
举报
文章被收录于专栏:bye漫漫求学路bye漫漫求学路
代码语言:javascript
复制
C:\Users\Admin>python
Python 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated.  Libraries may fail to load.  To activate this environment
please see https://conda.io/activation

Type "help", "copyright", "credits" or "license" for more information.
Failed calling sys.__interactivehook__
Traceback (most recent call last):
  File "D:\Anaconda\lib\site.py", line 440, in register_readline
    readline.read_history_file(history)
  File "D:\Anaconda\lib\site-packages\pyreadline\rlmain.py", line 165, in read_history_file
    self.mode._history.read_history_file(filename)
  File "D:\Anaconda\lib\site-packages\pyreadline\lineeditor\history.py", line 82, in read_history_file
    for line in open(filename, 'r'):
UnicodeDecodeError: 'gbk' codec can't decode byte 0x9a in position 1421: illegal multibyte sequence
>>> import scipy
>>> from scipy import io
>>> z = scipy.io.loadmat("F:/googleCromeDownload/deepsea_train/test.mat")
>>> list(z.keys())
['__header__', '__version__', '__globals__', 'testdata', 'testxdata']
>>> z['testxdata'].shape
(455024, 4, 1000)
>>> z['testxdata'][1,:]
array([[0, 0, 0, ..., 0, 0, 0],
       [1, 0, 0, ..., 0, 0, 1],
       [0, 1, 0, ..., 0, 0, 0],
       [0, 0, 1, ..., 1, 1, 0]], dtype=uint8)
>>> z['testxdata'][1,:,:]
array([[0, 0, 0, ..., 0, 0, 0],
       [1, 0, 0, ..., 0, 0, 1],
       [0, 1, 0, ..., 0, 0, 0],
       [0, 0, 1, ..., 1, 1, 0]], dtype=uint8)
>>> z['testxdata'][1:3,:,:]
array([[[0, 0, 0, ..., 0, 0, 0],
        [1, 0, 0, ..., 0, 0, 1],
        [0, 1, 0, ..., 0, 0, 0],
        [0, 0, 1, ..., 1, 1, 0]],

       [[0, 0, 0, ..., 0, 1, 1],
        [0, 1, 1, ..., 1, 0, 0],
        [1, 0, 0, ..., 0, 0, 0],
        [0, 0, 0, ..., 0, 0, 0]]], dtype=uint8)
>>> z['testxdata'][1:455029,:,:]
array([[[0, 0, 0, ..., 0, 0, 0],
        [1, 0, 0, ..., 0, 0, 1],
        [0, 1, 0, ..., 0, 0, 0],
        [0, 0, 1, ..., 1, 1, 0]],

       [[0, 0, 0, ..., 0, 1, 1],
        [0, 1, 1, ..., 1, 0, 0],
        [1, 0, 0, ..., 0, 0, 0],
        [0, 0, 0, ..., 0, 0, 0]],

       [[0, 1, 0, ..., 0, 0, 1],
        [0, 0, 1, ..., 0, 1, 0],
        [1, 0, 0, ..., 0, 0, 0],
        [0, 0, 0, ..., 1, 0, 0]],

       ...,

       [[0, 0, 0, ..., 0, 1, 1],
        [0, 0, 0, ..., 0, 0, 0],
        [0, 1, 0, ..., 0, 0, 0],
        [1, 0, 1, ..., 1, 0, 0]],

       [[0, 0, 0, ..., 0, 0, 0],
        [0, 0, 1, ..., 0, 0, 1],
        [0, 0, 0, ..., 1, 0, 0],
        [1, 1, 0, ..., 0, 1, 0]],

       [[0, 0, 0, ..., 0, 0, 0],
        [0, 1, 1, ..., 0, 0, 1],
        [0, 0, 0, ..., 1, 0, 0],
        [1, 0, 0, ..., 0, 1, 0]]], dtype=uint8)
>>>

有的会提示用hp5y读取

代码语言:javascript
复制
import h5py
data=h5py.File('cebi.mat','r')
x=list(data.keys())
#data[x[1]]
#w=data[x[1]]['wave']
www=data[data[x[1]]['wave'][0][0]].value
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2021-04-15 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档