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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:11:12+00:00 2026-06-17T21:11:12+00:00

For a lot of functions, it is possible to use either native Python or

  • 0

For a lot of functions, it is possible to use either native Python or numpy to proceed.

This is the case for math functions, that are available with Python native import math, but also with numpy methods. This is also the case when it comes to arrays, with narray from numpy and pythons list comprehensions, or tuples.

I have two questions relative to these features that are in Python and also in numpy

  1. in general, if method is available in native Python AND numpy, which of both solutions would you prefer ? In terms of efficiency ? Is it different and how Python and numpy would differ in their proceeding?

  2. More particularly, regarding arrays, and basic functions that are dealing with arrays, like sort, concatenate…, which solution is more efficient ? What makes the efficiency of the most efficient solution?

This is very open and general question. I guess that will not impact my code greatly, but I am just wondering.

  • 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-17T21:11:13+00:00Added an answer on June 17, 2026 at 9:11 pm

    In general, it probably matters most (efficiency-wise) to avoid conversions between the two. If you’re mostly using non-numpy functions on data, then they’ll be internally operating using standard Python data types, and thus using numpy arrays would be inefficient due to the need to convert back and forth.

    Similarly, if you’re using a lot of numpy functions to manipulate data, transforming it all back to basic Python types in between would also be inefficient.


    As far as choosing functions goes, use whichever one was designed to operate on the form your data is already in – e.g. if you already have a numpy array, use the numpy functions on it; similarly, if you have a basic Python data type, use the Python functions on it. numpy’s functions are going to be optimized for working with numpy’s data types.

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

Sidebar

Related Questions

i have written a lot of javascript functions that i want to use in
I try to generate a csv file through a lot of functions like that
Possible Duplicate: is “else if” faster than “switch() case” ? I've encountered a lot
I have some different Map/Reduces functions that I use in my project. But one
Is it possible to monitor the amount of memory that is in use or
I know that PHP includes a lot of built-in functions for handling files and
is it possible to use EXSLT functions within Visual Studio? I write and debug
I have to use an extern library providing lots of free functions that do
I'm writing some unit tests and I have a lot of functions of the
I have a Perl codebase, and there are a lot of redundant functions and

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.