About 50 results
Open links in new tab
  1. python - How to efficiently use NumPy's StringDType for string ...

    Mar 23, 2025 · In the past, NumPy's string operations were somewhat slower compared to Python list comprehensions, and I was hoping that with the introduction of NumPy's StringDType (which …

  2. python - Math operations from string - Stack Overflow

    Nov 13, 2016 · Let's say I have a standard Python string (such as one obtained from raw_input()), maybe "2 + 2" for simplicity's sake. I'd like to convert this string to standard math operations in …

  3. Using "and" and "or" operator with Python strings

    Also the type of the variable parameter is a string. In this context, as I can't imagine a case where usage of boolean operators on strings would make sense, I want to ask the question: Why would one want …

  4. Is it possible to do bitwise operations on a string in Python?

    Aug 20, 2014 · I don't know about bitwise operations on strings but the struct worked great for me. Here's the use case. The SGF file format exists for recording certain games. In the case of Go, …

  5. Python: apply math order of operations to reorder strings following ...

    May 11, 2021 · 1 How can be done with Python to reorder a string applying the math operations order with parenthesys? Let me use an example: "son(father(granpa)mother))" ===> "granpa father mother …

  6. python - Vectorized string operations in Numpy: why are they rather ...

    Mar 5, 2018 · Starting from numpy 1.4, if one needs arrays of strings, it is recommended to use arrays of dtype object_, string_ or unicode_, and use the free functions in the numpy.char module for fast …

  7. python - Quickly applying string operations in a pandas DataFrame ...

    Oct 11, 2012 · Quickly applying string operations in a pandas DataFrame Asked 13 years, 3 months ago Modified 13 years, 3 months ago Viewed 16k times

  8. python - Applying string operations to numpy arrays? - Stack Overflow

    Aug 1, 2013 · Python is already really good at handling string processing The other (and really, the main) reason numpy doesn't try to offer string operations is that python is already really good at it.

  9. python - How to turn strings into operations? - Stack Overflow

    Jul 21, 2022 · The point of eval() is to execute Python code that is stored as a string. If the user is inputting values to be used within an eval() statement, you should absolutely do some error-checking …

  10. How do I get a substring of a string in Python? - Stack Overflow

    Aug 31, 2016 · And just for completeness, Java is like Python in that the String.substring () method takes start and one-past-end. This one just bit me hard, I had assumed it was length like every other …