About 774,000 results
Open links in new tab
  1. python - Best way to remove elements from a list - Stack Overflow

    Feb 2, 2014 · Scenarios: If you have few items to remove say one element or between 1 to 5. If you have to remove multiple items in a sequence. If you have to remove different items based on a …

  2. Difference between del, remove, and pop on lists in Python

    Related post on similar lines for set data structure - Runtime difference between set.discard and set.remove methods in Python?

  3. Remove all occurrences of a value from a list? - Stack Overflow

    Jul 21, 2009 · In Python remove() will remove the first occurrence of value in a list. How to remove all occurrences of a value from a list? This is what I have in mind: >>> …

  4. How to completely remove Python from a Windows machine?

    I would like to completely remove Python from my system. I tried running the 2.7 and 2.6 msi files and choosing remove Python and then running only 2.6 and reinstalling it. Still stuff don't work. How do I …

  5. python - Removing duplicates in lists - Stack Overflow

    Nov 1, 2011 · In fact, despite the title "Python removing duplicates in lists", it doesn't seem like OP wanted to remove duplicates from within the same list at all. Rather, it looks like OP wanted to take …

  6. How can I remove a key from a Python dictionary?

    How can I remove a key from a Python dictionary? Asked 13 years, 6 months ago Modified 1 year, 1 month ago Viewed 3.1m times

  7. How to remove or hide x-axis labels from a plot - Stack Overflow

    Apr 27, 2024 · 0 Remove xlabel The xlabels come from dataframe column labels, so if you pass lists / numpy ndarrays to x, y or hue parameter, their labels won't show because these data types are …

  8. python - How do I remove a substring from the end of a string …

    926 strip doesn't mean "remove this substring". x.strip(y) treats y as a set of characters and strips any characters in that set from both ends of x. On Python 3.9 and newer you can use the removeprefix …

  9. How to remove an element from a list by index - Stack Overflow

    Dec 13, 2016 · How do I remove an element from a list by index? I found list.remove(), but this slowly scans the list for an item by value.

  10. Remove specific characters from a string in Python

    Oct 15, 2010 · I'm trying to remove specific characters from a string using Python. This is the code I'm using right now. Unfortunately, it appears to do nothing to the string. for char in line: if char in &q...