Segmenting Arrays Python [on hold]

Clash Royale CLAN TAG#URR8PPP
Segmenting Arrays Python [on hold]
xx = np.array(x)
tt = np.array(t)
peaks, _ = find_peaks(xx, height = -220, distance =50)
plt.plot(tt, xx, label='x')
plt.plot(tt[peaks], xx[peaks],'o')
ab = (tt[peaks],xx[peaks])
b = xx[peaks]
print(b[:],end='')
xx[peaks] = [-205. -182. -199. -196. -210.]
xx[peaks] = [-205. -182. -199. -196. -210.]
xx =
[-241. -241. -240. -240. -240. -240. -240. -240. -239. -239. -239. -246.
-246. -246. -250. -250. -250. -239. -239. -239. -236. -236. -236. -235.
-235. -235. -244. -244. -244. -220. -220. -220. -229. -229. -229. -248.
-248. -248. -242. -242. -242. -235. -235. -235. -226. -226. -226. -205.
-205. -205. -208. -208. -208. -235. -235. -235. -247. -247. -247. -242.
-242. -242. -239. -239. -239. -241. -241. -241. -242. -242. -242. -215.
-215. -215. -207. -207. -207. -198. -198. -198. -218. -218. -218. -228.
-228. -228. -243. -243. -243. -238. -238. -238. -252. -252. -252. -243.
-243. -243. -241. -241. -241. -231. -231. -231. -210. -210. -210. -193.
-193. -193. -182. -182. -182. -212. -212. -212. -233. -233. -233. -243.
-243. -243. -244. -244. -244. -243. -243. -243. -228. -228. -228. -223.
-223. -223. -205. -205. -205. -199. -199. -199. -202. -202. -202. -224.
-224. -224. -229. -229. -229. -242. -242. -242. -233. -233. -233. -246.
-246. -246. -242. -242. -242. -237. -237. -237. -213. -213. -213. -207.
-207. -207. -199. -199. -199. -203. -203. -203. -222. -222. -222. -244.
-244. -244. -237. -237. -237. -239. -239. -239. -243. -243. -243. -246.
-246. -246. -239. -239. -239. -221. -221. -221. -219. -219. -219. -202.
-202. -202. -214. -214. -214. -224. -224. -224. -232. -232. -232. -241.
-241. -241. -240. -240. -240. -241. -241. -241. -243. -243. -243. -239.
-239. -239. -228. -228. -228. -224. -224. -224. -209. -209. -209. -206.
-206. -206. -218. -218. -218. -226. -226. -226. -242. -242. -242. -242.
-242. -242. -240. -240. -240. -244. -244. -244. -244. -244. -244. -244.
-244. -244. -231. -231. -231. -222. -222. -222. -219. -219. -219. -204.
-204. -204. -196. -196. -196. -214. -214. -214. -223. -223. -223. -230.
-230. -230. -241. -241. -241. -245. -245. -245. -242. -242. -242. -239.
-239. -239. -235. -235. -235. -215. -215. -215. -224. -224. -224. -209.
-209. -209. -219. -219. -219. -226. -226. -226. -233. -233. -233. -237.
-237. -237. -242. -242. -242. -244. -244. -244. -242. -242. -242. -241.
-241. -241. -227. -227. -227. -212. -212. -212. -215. -215. -215. -210.
-210. -210. -222. -222. -222. -231. -231. -231.]
Things i need to solve for my code
1) Using the 'peaks' value that ive gotten in the first array.
2) Taking the 'peaks' values and implementing it to the 2nd array.
3) Extracting peak to peak value. eg first peak and second peak is '-205' and '-182'. I need to extract data from '-205' to '-182'.
4) With those data i will save it in a txt file maybe called 'data1.txt'
5) Continue the same steps till i get all data extracted, and saved into its individual txt file, till i get all data from each peak to each peak.
6) In this code i should get 4 data.txt files
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
ive added the code, not sure how much it will help tho
– burgerwurger
2 days ago
It is difficult to understand your problem. It will be more helpful if you can show some code that you have tried if any.
– Avi
2 days ago