-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataFrame - Drop multiple columns #6497
Comments
37 tasks
@luisquintanilla Is there currently a way to drop just one column? |
@amine-aboufirass you can do the following currently: // Drop the ID column
df.Columns.Remove("ID"); |
A temporary workaround around removing multiple at once would be logic like this: // Remove unnecessary columns
string[] columnsToDrop = new string[] { "first_name", "last_name", "name", "player_id", "index", "current_club_id", "player_code", "city_of_birth", "country_of_citizenship", "date_of_birth", "contract_expiration_date", "agent_name", "image_url", "url", "current_club_domestic_competition_id", "current_club_name" };
foreach (string columnName in columnsToDrop) {
df.Columns.Remove(columnName);
} You could wrap this into a static class with a static extension method that took in a params array of strings if you wanted, then you could call |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: