简体   繁体   English

如何使用 asammdf 库计算 mdf 文件中的通道?

[英]How to count a channel in mdf file using asammdf library?

the mdf file contain many channel with Cha_meas_1,Cha_meas_2,Cha_meas_3,Cha_meas_4,Cha_meas_5,......Cha_meas_15.i want to count the number of channel starting with Cha_meas _, mdf 文件包含许多通道,带有 Cha_meas_1、Cha_meas_2、Cha_meas_3、Cha_meas_4、Cha_meas_5、......Cha_meas_15。我想计算以Cha_meas _ 开头的通道数,

Currently i am doing as below:目前我正在做如下:

mdf_data = Data.to_dataframe(ignore_value2text_conversions=True,use_interpolation=False)
conditional_colum = [col for col in mdf_data.columns if 'Cha_meas_' in col]
num_cols = len(conditional_colum)

Is there any other way to do the same like counting the channel using asammdf library?有没有其他方法可以做同样的事情,比如使用 asammdf 库计算频道?

len([ch for ch in mdf.channels_db if ch.startswith("Cha_meas_"])

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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