Syntax error - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Syntax error (/thread-38876.html) |
Syntax error - tibbj001 - Dec-05-2022 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'], ... }) RE: Syntax error - Yoriz - Dec-05-2022 ... is not a valid dict entry, they should be key/value pairs.
RE: Syntax error - deanhystad - Dec-05-2022 Does your code really contain ellipsis (. . .) or is that just editing? If I remove the ellipsis there is no syntax error. |