To view your application in the web browser run: $ gcloud app browse
(myenv) kktxt1103@host1:~/Dash$ gcloud app browse
Did not detect your browser. Go to this link to view your app:https://analytical-poet-25330门-6.appspot.com
(django2-gae2) ~/mysite $ python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
October 27, 2018 - 17:07:02
Django version 2.1.2, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/ #點擊此連結瀏覽開發網站
Quit the server with CONTROL-C.
“HDF” stands for “Hierarchical Data Format”. Every object in an HDF5 file has a name, and they’re arranged in a POSIX-style hierarchy with/-separators:
最基本的操作,讀,寫,更新
Read HDF5
import h5py
filename ='file.hdf5'
f = h5py.File(filename,'r')# List all groupsprint("Keys: %s"% f.keys())
a_group_key = list(f.keys())[0]# Get the data
data = list(f[a_group_key])
Write HDF5
#!/usr/bin/env pythonimport h5py
# Create random dataimport numpy as np
data_matrix = np.random.uniform(-1,1, size=(10,3))# Write data to HDF5
data_file = h5py.File('file.hdf5','w')
data_file.create_dataset('group_name', data=data_matrix)
data_file.close()
另一個讀取範例
Reading the file
import h5py
f = h5py.File(file_name, mode)
Studying the structure of the file by printing what HDF5 groups are present
for key in f.keys():print(key)#Names of the groups in HDF5 file.
Extracting the data
#Get the HDF5 group
group = f[key]#Checkout what keys are inside that group.for key in group.keys():print(key)
data = group[some_key_inside_the_group].value
#Do whatever you want with data#After you are done
f.close()