简体   繁体   中英

Python equivalent to the MATLAB function “ischange”

Does anyone know if a Python function equivalent to the MATLAB function ischange .

I'm simply trying to extract the flat part of the curve in the following data.

在此处输入图像描述

I've tried numpy.diff which gives noisy results.

You can use numpy.diff with .round() added at the end, to get rid of noise, as I see your noise happens to be less than 0.5.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM