Answers for "pandas read_csv multiple separator"

0

pandas read_csv multiple separator

my_cols = [str(i) for i in range(45)] # create some col names
df_user_key_word_org = pd.read_csv(filepath+"user_key_word.txt",
                                   sep="\s+|;|:",
                                   names=my_cols, 
                                   header=None, 
                                   engine="python")
# I tested with s = StringIO(text_from_OP) on my computer
Posted by: Guest on April-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language