Python Forum
drop rows that doesnt matched
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
drop rows that doesnt matched
#1
Hi,
I'm working on data cleaning for a while (already posted some questions about this Wink ) and this one is really bit "complicated" for me(beginner :p).
So this is how my raw file looks like: csv.file
How can I drop those rows that are not in a dateformat(the column type is still an object NOT datetime64[ns]!!!)

I tried this approach :

df= pd.read_csv('file.csv', header = None)
for index, row in df.iterrows():
    if df[df[1].apply(lambda x: type(x)==int)]:
        df.drop(index, inplace=True)
but didnt work
Thks
Karlito
Reply


Messages In This Thread
drop rows that doesnt matched - by karlito - Oct-25-2019, 05:58 PM
RE: drop rows that doesnt matched - by snippsat - Oct-26-2019, 11:57 AM
RE: drop rows that doesnt matched - by karlito - Oct-26-2019, 02:14 PM
RE: drop rows that doesnt matched - by snippsat - Oct-26-2019, 04:51 PM
RE: drop rows that doesnt matched - by karlito - Oct-28-2019, 10:19 AM
RE: drop rows that doesnt matched - by snippsat - Oct-28-2019, 10:55 AM
RE: drop rows that doesnt matched - by karlito - Oct-28-2019, 12:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Drop rows if a set of columns has a value dervast 1 2,014 Sep-12-2019, 04:18 PM
Last Post: sd_0912
  Drop rows from data with zero value Devilish 3 3,775 Dec-27-2018, 02:06 AM
Last Post: Devilish

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020