Questions tagged as 'pandas'

2
answers

Python / Pandas - How to create a data frame that contains the original line and the duplicate line

In a data frame that contains two lines with Country = India, I was able to create a data frame without duplicity with only one line in India A data frame only with the duplicate line I need to create a data frame that contains only the two line...
asked by 29.06.2017 / 16:26
2
answers

Transform columns into python panda lines

I need to make some modifications to a dataframe but I can not. I'm using pandas. I have the table below: ButdoIwantittolooklikethis? Can anyone help me?     
asked by 27.04.2017 / 20:38
1
answer

Filling in Python

Good morning, I have a data frame with air temperature, global radiation and CO2, but my CO2 data is with NaN and I need to find data in other "lines" similar to fill the Nan with the CO2 data. import numpy as np import pandas as pd df...
asked by 13.03.2017 / 14:16
1
answer

Problem concatenating csv files

I'm trying to concatenate one csv file with another. My goal is to extract data from an HTML every day and my routine should get a csv file called 'old_date' where a saved dataframe is located in csv, and when I run again I should create a new u...
asked by 04.04.2017 / 16:10
1
answer

Warning pandas, 2 loopings!

I have a problem with this looping, because it is a situation that I can not solve with np.where , why have to run DataFrame to find the value of the gain or loss from another condition, whichever comes first . It's working but I...
asked by 22.12.2018 / 02:16
0
answers

Group data with pandas

I have this code: import pandas as pd df = pd.read_csv('dados.csv') ndf = df.set_index('Codigo').T ndf That returns: WhatIwantedwasforhimto"flip" information from Codigo to use as an index. In this case, one code per line, an...
asked by 14.12.2018 / 16:51
1
answer

I can not extract data from a specific column

My DataFrame has multiple columns and one of them is not being read when I try to use indexing (eg bar_0617 = media_0617 ['Bar']). The following error appears: KeyError: 'Bar'. I do not know what to do, I already checked the file with my data an...
asked by 16.12.2018 / 03:15
0
answers

IndexError: index 1 is out of bounds for axis 0 with size 1

if ind == 0: for j in range (c_source-1,f_source): place.iloc[j,0]=place.iloc[j,0]+1 legenda = pd.DataFrame([lado_source]) place = pd.concat((legenda, place), join='outer') if ind == 1:...
asked by 29.11.2018 / 18:33
1
answer

Find all the different elements of a column (pandas)

I developed this part with the functions learned in the classroom #importando pandas import pandas as pd #criando o dataframe base = pd.read_csv('C:\Users\lsilv\Desktop\acessos.csv') #renomeei as colunas para ficar mais fácil de usar base.colu...
asked by 30.11.2018 / 16:29
0
answers

What is the difference between Train Test Split and Holdout?

From what I've already researched, they both divide the set into two subsets of training and testing. Are there any differences between the two?     
asked by 14.11.2018 / 15:23