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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:03:56+00:00 2026-06-01T11:03:56+00:00

I am having difficulties multiplying the numpy datatype timedelta64 with floats. For a task

  • 0

I am having difficulties multiplying the numpy datatype timedelta64 with floats.

For a task i need to calculate the period of a star using Kepler’s second law. There are a lot of data points, so I want python to calculate the area between 2 positions and divide it by the period, using following code:

D = data['data']  
vect = D-c  #Data point minus center of ellipse
date = data['time'] #time for data point in np.timedelta64
Area_tot = np.pi*np.sqrt(chi[0])*np.sqrt(chi[1])  #total area of ellipse
P = np.array([])  
for i in range(1,len(D[0])):  
    Area = LA.norm(np.cross(vect[i],vect[i-1]))/2 #usie cross product to calculate area
    Time = date[i]-date[i-1]  
    P = np.append(P,(Area_tot/Area)*Time)

When doing this, however, I get the following error:

TypeError: ufunc 'multiply' not supported for the input types, and the inputs could 
not be safely coerced to any supported types according to the casting rule 'safe'

So, I am wondering how I can multiply the timedelta64 datatype with a float…

Thanks in advance and be gentle, I am quite new to both stackoverflow and programming 🙂

  • 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-01T11:03:57+00:00Added an answer on June 1, 2026 at 11:03 am
    Time.tolist().total_seconds()
    

    gets the difference as a float.

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

Sidebar

Related Questions

I'm having difficulties removing the lineStyle lines in JTrees using Netbeans. In a standalone
I'm having difficulties reading an app.config using the ConfigurationManager. I have a custom section,
I'm using libxml2.2.7.3 to parse html pages and I'm having difficulties getting it work
Having difficulties with Imagemagick and Snow Leopard. Imagemagick was installed using the install script
I am having difficulties performing a search using Solr on certain fields. I am
I am having difficulties in retrieving 50 results from google. I'm using this: public
I'm having difficulties controlling the vertical alignment of my floats. My current situation looks
I'm having difficulties with multiple joins in the NHibernate Criteria search. Say I had
I am having difficulties when trying to insert files into a SQL Server database.
I am having difficulties getting a span tag to work properly inside a table.

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.