In [5]:
import pandas as pd
import numpy as np

In [ ]:
from keras.models import load_model
model = load_model('./resnet50_FT38_CW_STGTrain/checkpoint/weights.000-0.0327.hdf5')


Using TensorFlow backend.

In [ ]:
for i, layer in enumerate(model.layers):
    print(i, layer.name)

In [100]:
df = pd.DataFrame(np.random.randn(5,3),index=range(0,10,2),columns=list('ABC'))

In [101]:
df


Out[101]:
A B C
0 0.256054 -0.025630 -1.108797
2 1.766054 -1.003439 -0.703147
4 0.857863 -0.464332 1.225459
6 0.550564 0.168159 -0.768391
8 -1.238786 -0.419822 1.265726

In [102]:
df = df.loc[df['A']>1]

In [103]:
df


Out[103]:
A B C
2 1.766054 -1.003439 -0.703147

In [104]:
df.shape


Out[104]:
(1, 3)

In [105]:
df.index[0]


Out[105]:
2

In [106]:
df.at[df.index[0],'A']


Out[106]:
1.7660535685202161

In [107]:
df.loc[df.index[0],['B','C']]


Out[107]:
B   -1.003439
C   -0.703147
Name: 2, dtype: float64

In [108]:
test_pred_df = pd.DataFrame(columns=['B','C'])

In [109]:
test_pred_df.loc[len(test_pred_df)]=df.loc[df.index[0],['B','C']]

In [110]:
test_pred_df


Out[110]:
B C
0 -1.003439 -0.703147

In [ ]: