About 147,000 results
Open links in new tab
  1. Delete a column from a Pandas DataFrame - Stack Overflow

    Nov 16, 2012 · Actually addresses the WHY part of original question. I've implemented subclasses from pandas dataframe. Doing so will teach you vital part of this answer. …

  2. Drop columns whose name contains a specific string from pandas …

    143 Cheaper, Faster, and Idiomatic: str.contains In recent versions of pandas, you can use string methods on the index and columns. Here, str.startswith seems like a good fit. To remove all …

  3. What is the best way to remove columns in pandas [duplicate]

    Jul 4, 2018 · 17 The recommended way to delete a column or row in pandas dataframes is using drop. To delete a column,

  4. How to delete a column from a data frame with pandas?

    Jan 20, 2015 · How to delete a column from a data frame with pandas? Asked 10 years, 11 months ago Modified 7 years, 1 month ago Viewed 105k times

  5. How to delete a column in pandas based on a condition?

    I have a pandas DataFrame, with many NAN values in it. How can I drop columns such that number_of_na_values > 2000? I tried to do it like that: toRemove = set() …

  6. python - Pandas: drop columns with all NaN's - Stack Overflow

    Jul 17, 2017 · Pandas: drop columns with all NaN's Asked 8 years, 5 months ago Modified 2 years, 11 months ago Viewed 263k times

  7. Drop columns from Pandas dataframe if they are not in specific list

    Jul 4, 2019 · Can you make this a soft drop, as in, if it contains one of the words in the column then you should keep the columns?

  8. Pandas Merge - How to avoid duplicating columns - Stack Overflow

    7 I'm freshly new with Pandas but I wanted to achieve the same thing, automatically avoiding column names with _x or _y and removing duplicate data. I finally did it by using this answer …

  9. Remove or replace spaces in column names - Stack Overflow

    Jan 5, 2017 · Since pandas' vectorized string methods (pandas.Index.str and pandas.Series.str) aren't optimized, using Python string methods in a comprehension is usually faster, especially …

  10. python - Remove pandas columns based on list - Stack Overflow

    Remove pandas columns based on list Asked 5 years, 8 months ago Modified 3 years, 5 months ago Viewed 16k times