Now I'm taking a machine learning course. Now I should import my dataset after I read a "CSV" file to import my dataset I want to drop a column but I don't know how to do it.
Asked
Active
Viewed 1.0k times
1
-
4`df = df.drop('col_name', axis=1)` – James May 30 '19 at 01:08
-
These kind of questions are easily answered by perusing the docs. – suvayu May 30 '19 at 02:12
-
@omar: I suggest you first try to search for your question in StackOverflow, and only if you do not find an answer, then ask the question. Good luck with your machine learning courses as well! ML is fun! – alift May 30 '19 at 04:50
1 Answers
2
Let's assume LIKES as column, how to drop it?
df.drop('LIKES', axis=1, inplace=True)

Mazen Alhrazi
- 336
- 1
- 3
- 10
-
`inplace` is not recommended any more, @James's comment above is the recommended way. – suvayu May 30 '19 at 02:09