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 7511315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:30:47+00:00 2026-05-29T23:30:47+00:00

I’m trying to read in an Ascii file using loadtxt. The file looks like

  • 0

I’m trying to read in an Ascii file using loadtxt. The file looks like this

UT, L, R, LocT, MLT, MLAT
      240000      1.03033      1.06433      2.73627      2.93244      8.51725
      300000      1.01964      1.05914      3.07449      3.24764      6.54548
      360000      1.01194      1.05747      3.41200      3.56224      4.51283
      420000      1.00746      1.05935      3.74672      3.87489      2.44624
      480000      1.00702      1.06476      4.07669      4.18431     0.373423

However there can be at least 9 characters in any of the rows.

I’ve been using this code

posdata = np.loadtxt(denfile, dtype={'names':('UT', 'L', 'R', 'loct', 'MLT', 'Mlat'), 'formats':('I9', 'f9', 'f9', 'f9', 'f9', 'f9')} , skiprows = 1)

and I get an error which reads TypeError: data type not understood. When I use a lower case i I get the same error. However in the line above where I read in a different file if the i is lowercase it doesn’t work, but if it’s upper case it does.

I’m not sure where the error is occurring or how to fix it. Any ideas would be greatly appreciated.

  • 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-05-29T23:30:48+00:00Added an answer on May 29, 2026 at 11:30 pm

    There’s no such thing as a 72-bit float in numpy.

    Either specify 'f8'/'I8' or for easier readibility: np.float/np.uint. There’s no 'f9' (which would be a 72-bit float).

    Have a look at the documentation for defining a dtype in numpy.

    For your case you probably don’t need to bother with this, though.

    If you don’t really need things as a structured array, then don’t use one. (If you don’t know what a structured array is, you probably don’t need it in this case.)

    Just do data = np.loadtxt("datafile.txt", skiprows=1). If you do need a structured array, then consider doing data = np.genfromtxt("datafile.txt", names=True). For simple cases, it’s easier to cast the first column as an unsigned integer later, rather than explicitly defining a dtype.

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

Sidebar

Related Questions

I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I am trying to render a haml file in a javascript response like so:
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is

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.