All Questions
34 questions
-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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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:
...
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
------------------------------------------...
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 ...
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 ...
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 ...
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 ...
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 ...
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'],
...
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 ...