Questions tagged as 'pandas'

1
answer

Index group values in pandas (Python)

I would like to obtain the values separately from a dataframe that comes from a previous grouping: import numpy as np import pandas as pd import matplotlib.pyplot as plt mu, sigma = 0, 0.2 x = np.abs(np.random.normal(mu, sigma, 1000)) y = np....
asked by 06.11.2017 / 12:44
1
answer

a calculation is repeated in operations with columns in python

I'm trying to make subtractions between rows of 2 columns. For this I use a function that subtracts row1-row2, squares it and takes it out of square root to eliminate negative sign. Then it goes to row2-row3 and so on until the end of the data....
asked by 15.05.2017 / 18:24
1
answer

How to store imported data to Python in a memory cache

Working with Python 3.5. and Pandas I am developing an application which performs a series of calculations and processes on a dataframe in Pandas. I filled that dataframe through a select that I launched against my database in SQL Server thro...
asked by 19.01.2017 / 16:17
1
answer

Create a new field within a table and enter the value of another but taking the value of a next row

I commented: I have previously asked a question "Create a new field within a table and enter the value of another but taking the value of a previous row" and I have already solved. Now another problem arises and I want to do the same but taking...
asked by 24.01.2017 / 21:02
1
answer

How to work with datetime

My problem is that I do not know how I can do to work with datetime but faster, when I do for it takes almost 1 day to run df2 = pd.DataFrame({'fecha1': ["2018-3-3","2018-4-15"], 'fecha2':["2018-02-31","2018-...
asked by 04.01.2019 / 02:12
0
answers

Create an array by iterating the rows of a table of pandas with conditions. Python

I'm creating a table with pandas where the first two columns are created with numpy arrays: age = np.random.randint(20,85,size=400) possible_genders = ['male','female'] gender = [np.random.choice(possible_genders) for i in range(400)] the...
asked by 09.12.2018 / 19:58
1
answer

Load Dataframe in the background

I have a small tool made in pthon 3.6 in which I use pandas to load dataframes. I want to upload a very large .xlsx file, with about 200,000 records and I use file = pd.read_excel('archivo.xlsx') This takes a long time and leaves the t...
asked by 10.12.2018 / 14:37
0
answers

How do I apply Geopy using a dataframe to convert lat and long to address

I saw this example on the internet: What I want to do is apply that logic but having a df like this:     
asked by 05.12.2018 / 18:42
0
answers

insert the value of a variable in a panda dataset

I happen to have the following dataset in which I must insert the title column (which must contain only Mr, Mrs, Miss, as the case may be) between the survived and name columns, I did it in the following way: otra=data_tres['name'].st...
asked by 03.12.2018 / 23:05
0
answers

replace "," by "." in order to treat the quantity as a float

A column called age , which must contain only data int , has 2 fields with values separated by "," the question is that I need to pass that character to "." to be able to work, I leave what I have so far df['age'].replace(',' , '.'...
asked by 30.11.2018 / 20:20