About 295,000 results
Open links in new tab
  1. How to check if the string is empty in Python? - Stack Overflow

    Does Python have something like an empty string variable where you can do: if myString == string.empty: Regardless, what's the most elegant way to check for empty string values? I find …

  2. How to check whether a str (variable) is empty or not?

    Mar 29, 2012 · Python strings are immutable and hence have more complex handling when talking about its operations. Note that a string with spaces is actually an empty string but has a …

  3. Pandas Replace NaN with blank/empty string - Stack Overflow

    Nov 10, 2014 · I have a Pandas Dataframe as shown below: 1 2 3 0 a NaN read 1 b l unread 2 c NaN read I want to remove the NaN values with an empty string so that it looks like so:...

  4. python - Most idiomatic way to convert None to empty string?

    by far the most pythonic. Uses the fact that python treats None, an empty list, an empty string, 0, etc as false. Also uses the fact that the or statement returns the first element that is true or the …

  5. python - Remove empty strings from a list of strings - Stack …

    Oct 2, 2010 · I want to remove all empty strings from a list of strings in python. My idea looks like this: while '' in str_list: str_list.remove('') Is there any more pythonic way to do this?

  6. What is the best way to create a string array in python?

    31 In Python, the tendency is usually that one would use a non-fixed size list (that is to say items can be appended/removed to it dynamically). If you followed this, there would be no need to …

  7. null - None vs Empty String in Python - Stack Overflow

    Dec 15, 2011 · None vs Empty String in Python Asked 13 years, 11 months ago Modified 5 years, 6 months ago Viewed 55k times

  8. Empty String in python? - Stack Overflow

    Mar 12, 2015 · Empty String in python? Asked 10 years, 8 months ago Modified 10 years, 8 months ago Viewed 12k times

  9. Assigning empty value or string in Python - Stack Overflow

    Feb 24, 2014 · Empty string is a literal, in Python literals are immutable objects and there value never changes. However, in some cases two literal objects having same value can have …

  10. Matching an empty string with regex - Stack Overflow

    Jul 12, 2013 · 2 As others said, you probably mean ^\s*$, not ^\s+$, because ^\s+$ will fail to match the empty string, . Whether ^\s*$ matches an empty string depends on your definition of …