Questions tagged as 'pandas'

3
answers

Working with parameters of a table using Pandas

I have a .csv file that contains this type of data: Nombre Curso Nota Miguel Primero 8 Juan Primer 2 Pedro Segundo 6 Luisa Primero 6 Teresa Primero 3 Pepe Segundo 5 Ana Segundo 6 Natalia Se...
asked by 14.11.2018 / 14:58
1
answer

Group strings by date using Pandas Python

I'm working on a program, and I need to group strings that are generated on a certain date. The form of grouping that I want is to group the same chain every time it is repeated, as long as a next repetition occurs in less than 30 days. In th...
asked by 10.07.2017 / 03:21
2
answers

Concatenate pandas DataFrames unifying by Dates

I have two DataFrames of pandas with Fechas and Datos : df_A = pd.DataFrame({ 'Fecha': ['15/12/2018', '16/12/2018', '18/12/2018'], 'Datos_A': [1, 5, 9] }) df_B = pd.DataFrame({ 'Fecha': ['15/12/2018', '16...
asked by 21.12.2018 / 13:47
1
answer

Know if a row of a dataframe has a NaN value - Pandas

I am trying to learn and get loose with pandas (which is costing me). I have a dataframe similar to this one: If I want to know if there is any NaN, None or NaT value in the set I apply the following code. t = df.isnull().any().any()...
asked by 10.12.2018 / 20:52
1
answer

How to split a .csv file by a field

It turns out that I have a file, in which to save the surveys and questions (columns) for example: opinion|date |¿Tienes coche?|Color coche|¿Tienes móvil?|Tipo_contrato|Seguro hogar Coches |28/08/18| Si |Rojo |...
asked by 29.08.2018 / 15:53
1
answer

Error with pd.DataFrame.replace, can not convert unicode string to float

I am trying to multiply a data frame by reference so I am using a dictionary to multiply it. When I try to fill my dictionary with the values in Excel rows I can not convert the values to float since they are unicode. I am using Python 2.7.10, c...
asked by 01.07.2018 / 00:50
1
answer

problem with an error counter list index out of range in python

hi I'm trying to make a for to iterate a list called coding the size (l) the problem is that I get the following error and I tried to solve it with the use of while but nothing: / follow the error, I understand that it is by the size of the list...
asked by 30.06.2018 / 21:55
1
answer

Filter dataframe from a tuple

I have the following dataframe (df2) Nombrearchivo Numero PosicionRegistro 20161020_113502_131221557378544949.jpg 208-13567 588 20161020_113448_131221555449704589.jpg 208-1356...
asked by 14.06.2018 / 21:10
1
answer

Filter an exact word in a dataframe (Pandas)

Code: texto = ['El', 'enfermo', 'grave', 'habla', 'de', 'trasplantes', '.'] for palabra in texto: filtro = data[data['palabra'].str.match(palabra, case=False )] print(filtro) An extract of the answer I get from the dataframe is:...
asked by 16.10.2018 / 01:19
1
answer

Average cycle with pandas

Good I have the following df , the question is that I need to filter the speeds per hour and with these take an average, I am utlizando the following code: import pandas as pd import numpy as np df = pd.read_csv('df.csv') b = df[(d...
asked by 30.04.2018 / 22:50