Questions tagged as 'pandas'

1
answer

Removing row of NaN values from a DataFrame

I joined two tables through the command pd.concat and I came across the problem of having multiple NaN values. It turns out that there are missing values in one of the dataframes. To facilitate my study of Data Science I want to remove...
asked by 22.08.2017 / 03:39
1
answer

Query in public database

I need to query in an online database, and transform the returned data into a data frame. I used an existing example on the database website, but I have no idea how to turn it into a database. The example looks like this sample: import u...
asked by 31.07.2017 / 15:24
1
answer

Cycle fordá results Nan! How to get real values?

One of the parts of my script is to determine the area of a graph by the trapezoid approximation. Within the class I created the following function that handles the self.df, which is a DataFrame def areas(self): area = 0. x = list(self...
asked by 23.07.2017 / 11:29
1
answer

Python No if error

I'm having an error in if and I do not know how to fix this error, I'm using Python 3.6 and Pandas for reading, writing and data analysis. df1 = pd.read_csv("JonnyTheBoy10.csv", usecols=['ART_TIPO', 'ART_DESIG', 'PORTA', 'CP4', 'CP3', 'LOCALID...
asked by 09.06.2017 / 11:05
0
answers

How to group numerical sequences?

Friends, I have a csv file with 5k lines which lists shopping transactions. There is an id for each purchase, it happens that for a lot where several purchase transactions are performed there is an id that always starts with the same numerical s...
asked by 10.06.2017 / 00:24
1
answer

Get common values in several columns of a dataframe?

I have a table with numeric values and I would like to get the values in common in all columns (intersection) and the unique values of each using Python. Position_a Position_b Position_c Position_d Position_e Position_f 0 45794939.0...
asked by 08.06.2017 / 14:06
1
answer

Read csv file using delimiter as the character "|" - Python

I tried to create a DataFrame with the lib pandas from a file that is sent to me in the following format: -------------------------------- |Indice|Preço|Quantidade|Cidade| -------------------------------- |1|1000|2|São Paulo| . . . I used t...
asked by 08.05.2017 / 00:38
1
answer

Create new DF based on a Pandas column

I'm new to Python and Pandas I have a DF that with 3 columns, as in the example below: SRC Data1 Data2 AAA 180 122 BBB 168 121 CCC 165 147 DDD 140 156 EEE 152 103 AAA 170 100 CCC 166...
asked by 09.05.2017 / 22:50
0
answers

This error happens when I run the program in Ubuntu, and in Win10 it works normal. What to do?

Program def trabaLinhas(caminho): colunas = extraindoZip.listaArq(caminho)[1] dadosV = pd.DataFrame(columns=colunas) for coluna in colunas: listaLinhas = lerTxt(caminho, coluna) dadosVazao = [] count = 0...
asked by 16.02.2017 / 15:30
1
answer

MAP function applied to only one column

I am trying to map the value "Others" to a "Career" column, according to some criteria. For example, when the column contains the Binder or Helper value, I want this value to be replaced with the Other value. The command below is running without...
asked by 09.12.2018 / 15:59