About 63,000 results
Open links in new tab
  1. python - How can strings be concatenated? - Stack Overflow

    The OP asked for Python 2.4 but about version 2.7, Hatem Nassrat has tested (July 2013) three concatenation techniques where + is faster when concatenating less than 15 strings but he …

  2. python - How to concatenate (join) items in a list to a single string ...

    Sep 17, 2012 · @Wouter, it will not. On the one hand, only lists of strings can be joined; so list.join would be inappropriate for an arbitrary list. On the other, the argument of str.join can be any …

  3. What is the most efficient string concatenation method in Python ...

    The speed can be contrasted with the fastest method for Python 2, which is + concatenation on my computer; and that takes 0.203 µs with 8-bit strings, and 0.259 µs if the strings are all …

  4. Concatenate strings from several rows using Pandas groupby

    I want to apply some sort of concatenation of the strings in a column using groupby. This is my code so far: import pandas as pd from io import StringIO data = StringIO(""" …

  5. Which is the preferred way to concatenate a string in Python?

    Aug 29, 2012 · But on 2.4 it isn't anymore (or at least Python 2.4.7), so the recommendation to use append/join became outdated in 2008, when Python 2.3 stopped being updated, and you …

  6. python - Most Pythonic way to concatenate strings - Stack Overflow

    Jan 26, 2010 · Unless you've got a very very very good reason to concatenate strings using + or operator.add (the most frequent one, that you've got few, fixed number of strings), you should …

  7. python - Print Combining Strings and Numbers - Stack Overflow

    Aug 18, 2012 · To print strings and numbers in Python, is there any other way than doing something like: first = 10 second = 20 print "First number is %(first)d and second number is …

  8. Python bytes concatenation - Stack Overflow

    Bytes don't work quite like strings. When you index with a single value (rather than a slice), you get an integer, rather than a length-one bytes instance. In your case, a[0] is 20 (hex 0x14). A …

  9. python - Concatenate path and filename - Stack Overflow

    To anyone else stumbling across this question, you can use \ to concatenate a Path object and str. Use path.Path for paths compatible with both Unix and Windows (you can use it the same …

  10. Is python += string concatenation bad practice? - Stack Overflow

    Sep 24, 2016 · Concatenation of strings have the disadvantage of needing to create a new string and allocate new memory for every concatenation! This is time consuming, but isn't that big of …

Refresh