Questions tagged as 'pandas'

1
answer

Compare fields in two data sets

Consider two sets of data read from files of type *.CSV with Pandas . Each set has only one CPF Favorecido field, which contains millions of records. Each set of data is equal to one month. I need to find out what records (CP...
asked by 24.05.2016 / 19:11
1
answer

Stacked data. How to work with this in pandas? [closed]

I have a table that is structured with "stacked" data, that is, all the information of a customer occupy some first lines. After completing the information of this client, the next client occupies the next lines, and so on. I'm seeing how I can...
asked by 12.12.2018 / 21:46
1
answer

Warning looping Python Pandas, How do looping differently?

Personally I'm doing this looping here: for i in range(1, len(candles)): if candles['askclose'][i]> candles['askopen'][i]: candles['Fechamento'][i]= 'alta' But the jupyternotebook always returns this warning and sometimes han...
asked by 07.12.2018 / 00:30
0
answers

Random forest with very high accuracy

I'm working with this dataset and I applied random forest to create a pricing model, but the accuracy of the model is getting too high, so I'm wary of anything wrong. Apparently train and test are different, so it was not to give such a high a...
asked by 14.11.2018 / 14:08
1
answer

How to customize the x-axis of a graph with two axes and for text?

I would like to know how to change my x-axis of a graph with two axes y, since I want to assign the x-axis names of Brazilian states to the x axis. numpy_matrix = df.as_matrix() x = numpy_matrix[0:,0] y1 = numpy_matrix[1:,1] y2 = numpy_matrix[...
asked by 08.08.2018 / 17:57
2
answers

Python python - How to check if a "tuple" of elements of two Series is contained in a set?

I have a "set" of "tuples" as follows set = {(2, 3), (2, 4), (5, 5)} My DataFrame looks like this: df = pd.DataFrame( {'one': [1,2,4,1], 'two' : [5,3,2,2]}) I want to check if in each line the "tuple" formed by the elements of the two se...
asked by 15.07.2018 / 01:57
1
answer

How to put the xticks equal to this figure

I'm doing a Python course for finance. Hence in an exercise you are asked to plot a chart using the DataFrames. So far so good, I have managed to do everything right, but my xticks do not match those of the result! I basically have to get thi...
asked by 28.06.2018 / 22:33
0
answers

How to solve this encoding error in Pandas

I'm having a problem when python reads xlsx with the pandas. When you run des_pt = (f_pt.head()[pt][0]).encode('utf-8').strip() and put the pt variable. It has an encode problem because some characters are in utf-8. import pandas as pd...
asked by 21.06.2018 / 21:16
0
answers

Error plotting a dataframe Pandas with seaborn.jointplot: "builtins.ValueError: can not convert float NaN to integer"

My dataset : pizzas.data 15.0,24.50 20.0,31.50 25.0,45.50 35.0,61.25 45.0,63.00 20.0,38.50 22.5,29.75 27.5,52.50 40.0,63.00 30.0,38.50 o Code: # -*- coding: utf-8 -*- import pandas as pd import numpy as np import matplotlib.pyplot as plt...
asked by 27.05.2018 / 17:03
1
answer

Import CSV to bank Pandas without converting string to tuple

I carry a CSV file with more than 3 million lines and about 770 Mb , I use the pandas and I need to convert a column that is in string format. Below the 'lbBins' column, which when read from CSV came in string format (what is the best default fo...
asked by 08.03.2018 / 19:24