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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:43:56+00:00 2026-06-17T05:43:56+00:00

I am running python 2.7 on my Mac, and I’m working on a group

  • 0

I am running python 2.7 on my Mac, and I’m working on a group coding project with other people using Ubuntu. Every once and a while, code they write won’t work on my computer due to casting rule errors:

    273     # Apply column averages to image
--> 274     img[:middle] *= (bg[0]/np.tile(topCol, (middle,1)))
    275     img[middle:] *= bg[1]/np.tile(botCol, (middle,1))
    276 

TypeError: Cannot cast ufunc multiply output from dtype('float64') to dtype('int16') with casting rule 'same_kind'

I don’t think you need the specifics, since this happens in a few different places with different number types.

It works on all of their computers no problem. Everything I write works for them, but every so often what they write doesn’t work for me.

Is there a reason why our machines don’t agree and is there a way I can change things on my end?

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-17T05:43:57+00:00Added an answer on June 17, 2026 at 5:43 am

    This thread suggests that your numpy is newer than the version your colleagues are using (please check using numpy.version.version). In the 1.7.0 development branch, it seems they’ve changed the implicit casting rule to the more strict same_kind rule, which forbids (among other things) casts between floating-point and integer formats.

    To work around this, I’d recommend using code like this:

    img[:middle] *= (bg[0]/np.tile(topCol, (middle,1))).astype(img.dtype)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the Python templates for Xcode, I have a simple project running on one
I am running Mac OS X 10.6.8 and am using the Enthought Python Distribution.
I'm running Python 2.6.4 on Mac Snow Leopard. I installed pycurl using: sudo env
How do you end up running pypcap for python 2.6 on a mac? It
I recently installed python 2.7.2 on my Mac running OSX 10.6.8. Previously, I had
I'm running Mac OS X 10.7.3 on a Macbook Pro. It came with Python
I'm running Python 3.3 on Mac OS 10.6.8. I am writing a script that
I'm running Mac OSX. Until today I had Python 2.6 with psycopg2 running just
I have a Mac running Lion and Python 2.7.1. I am noticing something very
I'm running Mac OS X 10.8 with python 2.7. I installed libusb with MacPorts

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.