Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

for 2d data compute standard deviation at each x

num_intervals = 3
#sort the arrays
sort_inds = np.argsort(x)
x = x[sort_inds]
y = y[sort_inds]
# create intervals
x_range = x.max() - x.min()
x_intervals = np.linspace(
				np.min(x)+x_range/num_intervals, 
                x.max()-x_range/num_intervals, 
                num_intervals)
split_indices = np.unique(np.searchsorted(x, x_intervals, side='left'))
ls_of_arrays_x = np.array_split(x, split_indices)
ls_of_arrays_y = np.array_split(y, split_indices)
y_stds = np.array([np.std(yi) for yi in ls_of_arrays_y])
x_mean = np.array([np.mean(xi) for xi in ls_of_arrays_x])
Comment

PREVIOUS NEXT
Code Example
Python :: how to increment datetime by custom months in python 
Python :: transpose([[1],[2],[3]]) 
Python :: python specify multiple possible types 
Python :: how to add the number to email address in faker library in python? 
Python :: iif python 
Python :: explained_variance_ratio kernel pca 
Python :: Factory reset the filesystem micropython 
Python :: python moref id vsphere 
Python :: Remove all duplicates words from a given sentence 
Python :: tz convert python 
Python :: useful functions in python 
Python :: math is python 
Python :: Filter xarray 
Python :: how to build a compiler in python 
Python :: limit entries in dataframe column 
Python :: Finding best model using GridSearchCV 
Python :: for count in range(size): 
Python :: <function chr(i, /)> error in python 
Python :: Assigning X and y using .iloc index 
Python :: how to convert array of arrays into single array with unique values in numpy 
Python :: discertize dara python 
Python :: mean first passage time markov chain python 
Python :: Mat.at(row,col) Opencv 
Python :: make image to string to use in tkinter 
Python :: jupyter_ascending 
Python :: dfs and bfs inn python 
Python :: python fibonacci sequence 
Python :: Modifiying line plots 
Python :: python tuple range 
Python :: python interseciton of 2 sets 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =