PYTHON DELIMITER

Asked

Viewed 395 times

-1

How do I read a file containing data separated by period and comma appear in the table in Pyhton?

Initially I have two txt files, I am using the pandas library I need to generate a txt third and put these two files together in a single table

example of the data in the tables: 4;1000 ;1000 ;0 ;0 ;1000 ;00000;00000;00003;0.00 ;0

import pandas as pd

df_bonus = pd.read_csv('bonus.txt')
df_bonus

df_clientes = pd.read_csv('clientes.txt')
df_clientes

1 answer

1


The read_csv() method supports a parameter with the delimiter.

df_bonus = pd.read_csv('bonus.txt', delimiter=';')

Browser other questions tagged

You are not signed in. Login or sign up in order to post.