Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8130743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:50:06+00:00 2026-06-06T08:50:06+00:00

Hi I keep getting a syntax error but I cant figure out why. My

  • 0

Hi I keep getting a syntax error but I cant figure out why. My code is

data = numpy.loadtxt((etf + '.csv',dtype = ([("date", "S8"), ("value", "f8")]), delimiter= ',' , usecols=(0,-1)))
x = numpy.arange(len(data))
pl1.bar(x,data["value"], width = 0.8)
p1.xticks(x+.4, data["date"])
p1.show()

and the syntax error is

  data = numpy.loadtxt((etf + '.csv',dtype = ([("date", "S8"), ("value", "f8")]), delimiter= ',' , usecols=(0,-1)))
                                           ^

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T08:50:07+00:00Added an answer on June 6, 2026 at 8:50 am
    data = numpy.loadtxt((etf + '.csv',
    

    Once you get to here, Python thinks you’re building a tuple to send as one argument to loadtxt, rather than sending multiple arguments. So,

       dtype = ([("date", "S8"), ("value", "f8")])
    

    errors because the = isn’t valid in a tuple. You probably meant to do this:

    data = numpy.loadtxt((etf + '.csv'), ... )
    

    But the extra brackets around etf + '.csv' aren’t needed here – the string concatenation takes precedence anyway, so you can just remove the second ( and everything will work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting this error in my application and can't figure out what it
I have the following header file, but keep on getting: syntax error : missing
I keep getting the Syntax Error: Unexpected identifier JS error with this code: function
I can't seem to figure this out! I keep getting an error that says
Hey guys! I keep getting a syntax error (unexpected $end), and I've isolated it
I keep getting the following error: Parse error: syntax error, unexpected T_SL in /home/a4999406/public_html/willingLog.html
I keep getting an error: invaled syntax for 1.add_xpath('tagLine', '//p[@class=tagline]/text()') and I cannot seem
I keep getting a syntax error Parse error: syntax error, unexpected '{' in contact_form.php
I am trying to cache these images using this code... But i keep getting
I keep getting this error but this sql statement works fine in mysql it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.