Skip to content
Advertisement

Remove DataFrames from a list of DataFrames

I have a dataframe that looks like this one:

DataFrame abalone.csv

JavaScript

I am implementing K-Neighbors Algorithm with Pandas and Numpy and when getting a list of dataframes, I can’t remove the one I am looping on with a list. How to remove the one I am looping on from the list so I can concatenate the remaining ones on cross fold validation?

Advertisement

Answer

You can delete the dataframe by index from your list with del.

Try this minimal example:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement