Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
-2 votes
1 answer
77 views

How to speed up process when apply a function in Python

I have a function peak_value which takes two iuputs area and data and returns a new column in data with potential peaks as output. I actually want to apply this peak value function on list of ...
Sam's user avatar
  • 45
0 votes
1 answer
62 views

How to apply a function fastly on the list of DataFrame in Python?

I have a list of DataFrames with equal length of columns and rows but different values, such as data = [df1, df2,df3.... dfn] . How can I apply a function function on each dataframe in the list ...
Sam's user avatar
  • 45
0 votes
1 answer
599 views

Linear 1D interpolation on multiple datasets using loops

I'm interested in performing Linear interpolation using the scipy.interpolate library. The dataset looks somewhat like this: DATAFRAME for interpolation between X, Y for different RUNs I'd like to ...
SSM's user avatar
  • 62
0 votes
1 answer
539 views

How do I get a DataFrame with pearsonr correlation coefficient for each month?

Ok so I have two DataFrames that look like the following. The first is called load and the second is called lmp. read_date hour_ending reading 0 2016-02-12 1 6.3634 1 2016-02-12 ...
Ravaal's user avatar
  • 3,369
0 votes
3 answers
5k views

How to merge columns from multiple CSV files using Python

may be the answer of this question is available but I could not get proper solution and thus I am looking for the perfect solution. Suppose I have multiple CSV files (around 1500) having single column ...
Vishal Singh's user avatar
1 vote
1 answer
181 views

How to control X's and Y's when interplolating with pandas

I want to use spline interpolation so I can fill some nulls, but I can not find a way to specify X's and Y's for Pandas. It automatically select the index to be the X's and fill nulls for all columns ...
pkz's user avatar
  • 41
1 vote
0 answers
2k views

MemoryError Issue in scipy.sparse.csr.csr_matrix

I have scipy.sparse.csr.csr_matrix object size of (118723, 20748) when I am trying to convert it into an array by using toarray() function it giving me *** MemoryError: Please find below my code: ...
Vikram Singh Chandel's user avatar
0 votes
3 answers
6k views

pandas dataframe: how to group by value?

I am working with the following pandas dataframe (from csv file): ---------------------------------------------- buyer_id itemX itemY bid1 bid2 ------------------------------------------...
asmsr2's user avatar
  • 91
16 votes
5 answers
4k views

Fastest way to create strictly increasing lists in Python

I would like to find out what is the most efficient way to achieve the following in Python: Suppose we have two lists a and b which are of equal length and contain up to 1e7 elements. However, for ...
Rickson's user avatar
  • 1,090
5 votes
2 answers
4k views

Warning using Scipy with Pandas

I'm working with Python 2.7 to test the following example: # importando pandas, numpy y matplotlib import matplotlib as matplotlib import scipy as scipy import pandas as pd import numpy as np import ...
Daniel ORTIZ's user avatar
  • 2,520
0 votes
1 answer
248 views

Parameter estimates for generic data for any function

I have a function. For example: def g(w,d,e): s = w-1. s1 = s**d+2. s2 = 42. + s1*e**(1/2) return s2 Lets data = np.array([1,2,3,4,5]) it is s2. But I don't know d and e. How I ...
ooolllooo's user avatar
  • 351
1 vote
1 answer
228 views

Evaluating stringified formulas with pandas datatypes

Using python2 I want to be able to parse and evaluate formulas that have been saved as a string. Basically, I want clients to be able to describe formulas to apply over their data. Some of these ...
Jerry Londergaard's user avatar
12 votes
2 answers
9k views

Pandas how to split dataframe by column by interval

I have a gigantic dataframe with a datetime type column called dt, the data frame is sorted based on dt already. I want to split the dataframe into several dataframes based on dt, each dataframe ...
9blue's user avatar
  • 4,753
4 votes
1 answer
524 views

Why am I getting incorrect results from scipy.optimize.fmin?

import pandas as pd from scipy.optimize import fmin data = pd.DataFrame({'DIV': [1,2,3]*3, 'MONTH': ['May','May','May','June','June','Jun','Jul','Jul','Jul'], ...
Mateyobi's user avatar
  • 123
0 votes
1 answer
2k views

Extrapolate using interp2d from scipy python

I am trying to 2d extrapolate with the scipy package such as : interp2d(df['maturity'], df['strike'], df['IV'], fill_value='extrapolate')(0.08, 0.65) the minimum value of df['maturity'] is 0.09 and I ...
Steven G's user avatar
  • 17.2k

15 30 50 per page