0
Good night to you all!
I opened a csv file in python using the following command:
caminhoarquivo = r'C:\Users\user\Desktop\teste.csv'
basedados = pd.read_csv(caminhoarquivo,sep=';',decimal=',', encoding='latin-1')
But in the first row (label of csv) it inserts "index" and considers in this column the data of the first column of my csv, leaving the last column of csv without information. I would like someone to help me insert numbers into this "index" column instead of using data from my file. So as not to move the label, leaving the last column without information.
File example:
Ponto de Medição| Data |Hora|Consumo|Status
User1 | 30/11/2018 | 24 | 23,5 | OK
User1 | 30/11/2018 | 1 | 14,8 | OK
User1 | 30/11/2018 | 2 | 48,6 | OK
User1 | 30/11/2018 | 3 | 92,3 | OK
User1 | 30/11/2018 | 4 | 76,2 | OK
After opening in Python:
Index | Ponto de Medição| Data| Hora|Consumo|Status
User1 | 30/11/2018 | 24 | 23,5 | OK |
User1 | 30/11/2018 | 1 | 14,8 | OK |
User1 | 30/11/2018 | 2 | 48,6 | OK |
User1 | 30/11/2018 | 3 | 92,3 | OK |
User1 | 30/11/2018 | 4 | 76,2 | OK |
Thanks in advance!
And like this file of yours CSV ? It would have to put a part or an example of how this ?
– NoobSaibot
I inserted part of the csv file. When I open it in Python it displaces the first line and inserts "index" making 'User1" in the column labeled "index". So the "status" column is empty.
– Felipe Ferreira
Felipe, it would be important to put the text instead of image, due to restrictions I can’t see the image.
– NoobSaibot
I entered an example.
– Felipe Ferreira
I tested here and for me this normal, your code is only the one that put here or has more code?
– NoobSaibot