Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Syntax error
#1
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'],
        ...
    })
Reply
#2
... is not a valid dict entry, they should be key/value pairs.
Reply
#3
Does your code really contain ellipsis (. . .) or is that just editing? If I remove the ellipsis there is no syntax error.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  syntax error question - string mgallotti 5 387 Feb-03-2023, 05:10 PM
Last Post: mgallotti
  Syntax error? I don't see it KenHorse 4 363 Jan-15-2023, 07:49 PM
Last Post: Gribouillis
  Python-for-Android:p4a: syntax error in main.py while compiling apk jttolleson 2 727 Sep-17-2022, 04:09 AM
Last Post: jttolleson
  Mysql Syntax error in pymysql ilknurg 4 1,313 May-18-2022, 06:50 AM
Last Post: ibreeden
  Solving equation equal to zero: How to resolve the syntax error? alexfrol86 3 1,018 Feb-21-2022, 08:58 AM
Last Post: deanhystad
  Query Syntax Error hammer 2 932 Jan-03-2022, 02:30 PM
Last Post: hammer
Star I'm getting syntax error while using input function in def. yecktmpmbyrv 1 1,346 Oct-06-2021, 09:39 AM
Last Post: menator01
Exclamation Invalid syntax error(Predict Ethereum Price) lulu43366 2 2,244 Sep-24-2021, 01:24 PM
Last Post: lulu43366
  Line 42 syntax error..Help!!1 patpython 4 1,949 Sep-01-2021, 03:22 PM
Last Post: deanhystad
  Unexplained Invalid syntax Error cybertooth 5 2,090 Aug-02-2021, 10:05 AM
Last Post: cybertooth

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020