问题描述
import numpy as np
import pandas as pd
import plotly.express as px
from pandas import Timestamp
all_dwellings=pd.DataFrame(<yourData>)
first_timebuyers = pd.DataFrame(<yourData>)
# datagrab 1
lineplt_all = px.line(data_frame = all_dwellings,x='Date',y='Average House Price (£)',color= 'Country',hover_name='Country',color_discrete_sequence=['rgb(23,153,59)','rgb(214,163,21)','rgb(40,48,165)','rgb(210,38)']
)
# datagrab 2
lineplt_first = px.line(data_frame = first_timebuyers,38)']
)
### Your original setup
lineplt = px.line(data_frame = all_dwellings,38)']
)
updatemenus = [
{'buttons': [
{
'method': 'restyle','label': 'All Dwellings','args': [{'y': [dat.y for dat in lineplt_all.data]}]
},{
'method': 'restyle','label': 'First Time Buyers','args': [{'y': [dat.y for dat in lineplt_first.data]}]
}
],'direction': 'down','showactive': True,}
]
lineplt = lineplt.update_layout(
title_text='Average House Price in UK (£)',title_x=0.5,#plot_bgcolor= 'rgb(194,208,209)',xaxis_showgrid=False,yaxis_showgrid=False,hoverlabel=dict(font_size=10,bgcolor='rgb(69,95,154)',bordercolor= 'whitesmoke'),legend=dict(title='Please click legend item to remove <br>or add to plot',x=0,y=1,traceorder='normal',bgcolor='LightSteelBlue',xanchor = 'auto'),updatemenus=updatemenus
)
lineplt = lineplt.update_traces(mode="lines",hovertemplate= 'Date = %{x} <br>' + 'Price = £%{y:.2f}')
lineplt.show()
我收到此错误。问题是什么?我已经搜索了它,但是几乎到处都发现了相同的语法
这是我的整个模特。模型中还有其他问题吗?我正在音素上进行语音识别
model.add(layers.MaxPooling1D(pool_size=3))
^
SyntaxError: invalid syntax
解决方法
在此行
#Second Conv1D layer
model.add(layers.Conv1D(16,11,activation='relu',padding='valid',strides=1)
您忘记关闭括号。
将其更改为此
model.add(layers.Conv1D(16,strides=1))
下一行出现相同的错误
#Third Conv1D layer
model.add(layers.Conv1D(32,9,strides=1)
要解决此问题,只需添加最后一个括号
#Third Conv1D layer
model.add(layers.Conv1D(32,strides=1))