Hi Guys,
I'm trying to read a csv file according to its type (X or Y, so if the file name starts with 125 I read the raw_file1 file otherwise raw_file2) but when I run the code I get no ouput.
Thks for help
Karlito
I'm trying to read a csv file according to its type (X or Y, so if the file name starts with 125 I read the raw_file1 file otherwise raw_file2) but when I run the code I get no ouput.
Thks for help
Karlito
import string import pandas as pd import numpy as np raw_file1 = '2340595954_header.csv' #csv typ X raw_file2 = '4325670000_things.csv' #csv typ Y # Get the first 3 digit/character of the raw_file1 first_3_char_raw_file1 = ''.join([s[0:3] for s in raw_file1.split(' ')]) #234 # Check if the first 3 digits/characters of the raw_file1 are 234(csv-type X) or 432(csv-type Y) #if yes then read raw_file1 if first_3_char_raw_file1 == 125: data = pd.read_csv(raw_file1) '''do something''' #data.head() #else read raw_file2 else: data = pd.read_csv(raw_file2) '''do something''' #data.head()