如何在python中的字符串中查找颜色表示字符串?

时间:2016-12-26 15:06:12

标签: python python-2.7 python-3.x wxpython ipython

示例:

col_str = 'South Shore Lily Rose 4 Drawer Chest in White Wash'

我想单独拿白色,我们不应该硬编码颜色字符串,默认它必须识别,怎么做?

1 个答案:

答案 0 :(得分:0)

正如你用wxpython标记了问题,我假设你有wxpython,下面的代码应该对你有用:

<code>#Model:
model = Sequential() 
model.add(LSTM(128, input_shape=(X.shape[1], X.shap[2]), return_sequences=True)) model.add(Dropout(0.25)) model.add(LSTM(64)) model.add(Dropout(0.25)) model.add(Dense(y.shape[1], activation='softmax'))
</code>