【发布时间】:2017-08-17 12:26:21
【问题描述】:
我使用 tsfresh 从时间序列数据中提取特征,并将结果保存到 pandas.DataFrame。如何仅提取使用命令调用的功能名称:
features.ix[0].index
在功能名称之前没有“u”并且能够将名称列另存为 txt 文件?
import numpy as np
import pandas as np
>>> (features.ix[0].index)
Index([ u'flux__time_reversal_asymmetry_statistic__lag_2',
u'flux__median',
u'flux__mean_abs_change_quantiles__qh_0.8__ql_0.0',
u'flux__mean_abs_change_quantiles__qh_0.4__ql_0.8',
u'flux__mean_abs_change_quantiles__qh_0.4__ql_0.4',
u'flux__sum_of_reoccurring_data_points',
u'flux__mean_abs_change_quantiles__qh_0.4__ql_0.6',
u'flux__mean_abs_change_quantiles__qh_0.4__ql_0.0',
u'flux__number_peaks__n_3',
u'flux__mean_abs_change_quantiles__qh_0.4__ql_0.2',
...
u'flux__fft_coefficient__coeff_0',
u'flux__fft_coefficient__coeff_1',
u'flux__fft_coefficient__coeff_2',
u'flux__fft_coefficient__coeff_3',
u'flux__fft_coefficient__coeff_4',
u'flux__fft_coefficient__coeff_5',
u'flux__fft_coefficient__coeff_6',
u'flux__fft_coefficient__coeff_7',
u'flux__fft_coefficient__coeff_8',
u'flux__fft_coefficient__coeff_9'],
dtype='object', length=222)
【问题讨论】:
标签: python pandas dataframe text indexing