Python Forum

Full Version: Syntax error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm getting a Syntax error on the final line, unsure why?

# Function to prepare data for deep learning
def prepare_dl_data(data):
    # Create data frame with relevant data
    dl_data = pd.DataFrame({
        'Price': data['close'],
        'Volume': data['volume'],
        'Open Interest': data['open_interest'],
        'Technical Indicator 1': data['indicator1'],
        'Technical Indicator 2': data['indicator2'],
        'Sentiment Score': data['sentiment'],
        'Topic 1': data['topic1'],
        'Topic 2': data['topic2'],
        ...
    })
... is not a valid dict entry, they should be key/value pairs.
Does your code really contain ellipsis (. . .) or is that just editing? If I remove the ellipsis there is no syntax error.