Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

performance

Python Sets vs Lists

August 20, 2022 by Magenaut

In Python, which data structure is more efficient/speedy? Assuming that order is not important to me and I would be checking for duplicates anyway, is a Python set slower than a Python list?

Categories Python, Q&A Tags data-structures, list, performance, python, set Leave a comment

A faster strptime?

August 20, 2022 by Magenaut

I have code which reads vast numbers of dates in ‘YYYY-MM-DD’ format. Parsing all these dates, so that it can add one, two, or three days then write back in the same format is slowing things down quite considerably.

Categories Python, Q&A Tags datetime, performance, python, strptime Leave a comment

What is the most efficient way of finding all the factors of a number in Python?

August 20, 2022 by Magenaut

Can someone explain to me an efficient way of finding all the factors of a number in Python (2.7)?

Categories Python, Q&A Tags algorithm, factorization, performance, python, python-2.7 Leave a comment

numpy: most efficient frequency counts for unique values in an array

August 20, 2022 by Magenaut

In numpy / scipy, is there an efficient way to get frequency counts for unique values in an array?

Categories Python, Q&A Tags arrays, numpy, performance, python Leave a comment

Replace values in list using Python

August 20, 2022 by Magenaut

what if I had a generator that yields
the values from range(11) instead of a
list. Would it be possible to replace
values in the generator?

Categories Python, Q&A Tags list, performance, python, replace Leave a comment

Performance of Pandas apply vs np.vectorize to create new column from existing columns

August 20, 2022 by Magenaut

I am using Pandas dataframes and want to create a new column as a function of existing columns. I have not seen a good discussion of the speed difference between df.apply() and np.vectorize(), so I thought I would ask here.

Categories Python, Q&A Tags arrays, numpy, pandas, performance, python Leave a comment

Are tuples more efficient than lists in Python?

August 19, 2022 by Magenaut

Is there any performance difference between tuples and lists when it comes to instantiation and retrieval of elements?

Categories Python, Q&A Tags list, performance, python, python-internals, tuples Leave a comment

Get the second largest number in a list in linear time

August 19, 2022 by Magenaut

I’m learning Python and the simple ways to handle lists is presented as an advantage. Sometimes it is, but look at this:

Categories Python, Q&A Tags performance, python Leave a comment

Pandas: peculiar performance drop for inplace rename after dropna

August 19, 2022 by Magenaut

I have reported this as an issue on pandas issues.
In the meanwhile I post this here hoping to save others time, in case they encounter similar issues.

Categories Python, Q&A Tags in-place, pandas, performance, python Leave a comment

What is the best way to generate all possible three letter strings?

August 19, 2022 by Magenaut

I am generating all possible three letters keywords e.g. aaa, aab, aac.... zzy, zzz below is my code:

Categories Python, Q&A Tags performance, python Leave a comment
Older posts
Newer posts
← Previous Page1 … Page6 Page7 Page8 … Page20 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress