Hi I have a set of data in 3 columns.
S N D100 0.0276 0.1012101 0.0279 0.1012102 0.0278 0.1017103 0.0334 0.102104 0.0289 0.1024105 0.0346 0.1014106 0.0296 0.1019107 0.0263 0.1018108 0.0324 0.1016109 0.0289 0.1021110 0.0314 0.1013111 0.0296 0.1013112 0.0331 0.1013113 0.0314 0.102114 0.0334 0.1021115 0.0301 0.1013116 0.0312 0.1008117 0.0308 0.1007118 0.0339 0.1019119 0.0306 0.1018120 0.0311 0.1015121 0.033 0.1021122 0.0303 0.1016123 0.0306 0.1019124 0.0312 0.1016125 0.0289 0.1021126 0.0293 0.102127 0.0293 0.1017128 0.0287 0.1019129 0.0263 0.1012130 0.0304 0.1013131 0.0299 0.1012132 0.0331 0.1015133 0.0293 0.1015134 0.0272 0.102135 0.0292 0.1017136 0.0283 0.102
I normally plot x-axis (S-D) against y-axis N^2. But i want to bin the data. So I want to bin the x-axis data (S-D) into the following bins [100 105 110 115 120 125 130 135 140].
For each bin I want to find the data that belongs to that bin and in each bin calculate the average value of all signals that fall into the BIN, as well as the median value of all noise values that belong to the BIN, and then replot using these binned data.
I have started with this but not sure where to go now.
edges = [100 105 110 115 120 125 130 135 140];X=S-D;Y=N^2;N = histcounts(X,edges)
Best Answer