Python Forum
Checking a filename before reading it with pd.read_csv
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking a filename before reading it with pd.read_csv
#2
There is str.startswith method. So, you can just do:
if raw_file1.startswith('125'):
    pass # or do something
else:
    pass  # or do something
Reply


Messages In This Thread
RE: Checking a filename before reading it with pd.read_csv - by scidam - Oct-29-2019, 10:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pandas read_csv markf7319 0 1,341 Mar-03-2022, 04:59 AM
Last Post: markf7319
  pandas read_csv can't handle missing data mrdominikku 0 2,622 Jul-09-2020, 12:26 PM
Last Post: mrdominikku
  read_csv error and rows/columns missing karlito 9 5,604 Nov-11-2019, 06:48 AM
Last Post: karlito
  utf-8 error with pandas read_csv logues 0 3,954 Oct-23-2018, 05:25 PM
Last Post: logues
  pandas read_csv, numbers in footer mechanic310 1 2,907 May-22-2018, 10:38 AM
Last Post: buran

Forum Jump:

User Panel Messages

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