« first day (1904 days earlier)      last day (1461 days later) » 

4:34 AM
@tripleee posted question in stackoverflow.com/questions/61613379/…
 
 
5 hours later…
9:40 AM
1 message moved from Python
 
 
1 hour later…
11:05 AM
L = pd.Series(range(15))

def gen_strides(a, stride_len=5, window_len=5):
n_strides = ((a.size-window_len)//stride_len) + 1
return np.array([a[s:(s+window_len)] for s in np.arange(0, a.size, stride_len)[:n_strides]])

gen_strides(L, stride_len=2, window_len=4)
 
1 message moved from Python
 
 
2 hours later…
1:26 PM
peak_total_kms, lean_total_kms,odo_as_of_month_end
0 0 NA
0 0 NA
0 0 NA
0 0 NA
0 0 NA
0 0 NA
0 0 NA
1749 940 NA
1995 769 NA
747 718 NA
111 115 NA
2282 1162 NA
1611 1738 20648
1536 2610 NA
1821 1845 NA
603 868 31356

i have 3 columns here, i want to create a 4th column which says scaling factor. Means if the value in the third column is not null then i want to add the first two columns till that row where 3rd column value is not null and create a 4th column which is 3rd column
can anyone help with python script for this?
 
1 message moved from Python
 
 
4 hours later…
5:50 PM
If anyone can help me with this : stackoverflow.com/q/61641821/7792580 please do. Thanks
 
1 message moved from Python
 

« first day (1904 days earlier)      last day (1461 days later) »