Questions tagged as 'pandas'

0
answers

Error deleting rows that have NaN in a column of a dataframe

With imports of .csv files, I created the following df. I try to delete the rows with NaN in the column "Iberdrola, using the loop.    if symbol == 'Iberdrola':               df = df.dropna (subset = 'Iberdrola') When executing...
asked by 24.11.2018 / 21:12
0
answers

Add user events in dif columns

My idea is to move on from this df2 = pd.DataFrame({'usuario': [1,1,1,2,2,2,3,3,3,3,3], 'evento': ["compro","compro","viopag","viopag","entropag","compro","entropag", "compro","salio","viopag...
asked by 24.11.2018 / 13:29
0
answers

Building graphics with bokeh - python

I have an error on line 23, it has been two hours and I still do not have the problem, this is a pie chart that shows the number of men and women in my excel file. from math import pi import pandas as pd from bokeh.io import output_file, sho...
asked by 25.11.2018 / 20:27
0
answers

pd.cut to establish quintiles based on the filtering of a field

I have an excel with three columns, one is the family code, another the product code and the other the price of the product, so I would have something similar to this: 1. Familia Producto Precio 1. -------- --------- -------- 1....
asked by 05.11.2018 / 13:30
1
answer

how to iterate row by row in pandas

How can I iterate row by row in a dataframe using python: For example, I have the following data: canciones={'albun':['cacho','beto','pedrito','loshermanos'], 'ano':[1992,1998,1994,1993], 'tiempo':['00:22:04','00:42:02','00:23:33...
asked by 03.11.2018 / 20:00
0
answers

Type of error in phyton 'str' object is not callable

import pandas as pd ds1 = pd.Series(np.random.randn(5)) #serie 1 ds2 = pd.Series(np.random.randn(5)) #serie2 print("Series1:") print(ds1) print("Series2:") print(ds2) print("Compare the elements of the said Series:") print("Equals:") print(ds1 ==...
asked by 03.11.2018 / 20:03
1
answer

how to add two pandas series

s1 = pd.Series(['2', '4', '6', '8', '10']) s2 = pd.Series(['1','3','5','7','9']) s1+s2 0 21 1 43 2 65 3 87 4 109 As you observe what I get is a " concat " of the values, with their respective index and what I need i...
asked by 31.10.2018 / 23:44
3
answers

how to iterate in a dataframe with loop for

I have a list I'm trying to iterate with a for loop in a dataframe to query a data in a webservice: value=[] for i in range(0, 10): nit = mydataset_df.CO_tin_no url = 'http://www.rues.org.co/RM/ConsultaNIT_json' headers,...
asked by 16.10.2018 / 23:44
1
answer

Remove column from a matrix

Passing a csv to an array with pandas creates a column to the left of everything indicating the row number that it is. How could it be eliminated? def cargar(): print("Indica la ruta donde se encuentra el CSV\n") print("Si desea salir puls...
asked by 08.10.2018 / 23:25
0
answers

Value travel in columns

I have the following dataframe: and I want to go through each line of the column "CO_tin_no" to consult it with a webservice item=[] for nit in mydataset_df.CO_tin_no: nit = mydataset_df.CO_tin_no url = 'http://www.rues.org.c...
asked by 16.10.2018 / 18:39