About 641,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 …

  2. 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: >>> …

  3. python - How to remove xticks from a plot - Stack Overflow

    How to remove xticks from a plot Asked 13 years ago Modified 1 year, 7 months ago Viewed 839k times

  4. 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?

  5. python - How to remove specific elements in a numpy array

    Jun 12, 2012 · How can I remove some specific elements from a numpy array? Say I have import numpy as np a = np.array ( [1,2,3,4,5,6,7,8,9]) I then want to remove 3,4,7 from a.

  6. 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.

  7. python - How can I remove a trailing newline? - Stack Overflow

    39 s = s.rstrip() will remove all newlines at the end of the string s. The assignment is needed because rstrip returns a new string instead of modifying the original string.

  8. 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. …

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

    How do I remove a substring from the end of a string (remove a suffix of the string)? Asked 16 years, 4 months ago Modified 13 days ago Viewed 1.2m times

  10. python - How do I remove NaN values from a NumPy array?

    Jul 23, 2012 · To remove NaN values from a NumPy array x: x = x[~numpy.isnan(x)] Explanation The inner function numpy.isnan returns a boolean/logical array which has the value True …