我导入以下csv文件:
import pandas as pd
from numpy import log, abs, sign, sqrt
import brunel
# Read data
DISKAVGRIO = pd.read_csv("../DISKAVGRIO_nmon.csv")
DISKAVGRIO.head(6)
以下表格:
Hostname | Date-Time | hdisk1342 | hdisk1340 | hdisk1343 | ...
------------ | ----------------------- | ----------- | ------------- | ----------- | ------
host1 | 12-08-2015 00:56:12 | 0.0 | 0.0 | 0.0 | ...
host1 | 12-08-2015 01:11:13 | 0.0 | 0.0 | 0.0 | ...
host1 | 12-08-2015 01:26:14 | 0.0 | 0.0 | 0.0 | ...
host1 | 12-08-2015 01:41:14 | 0.0 | 0.0 | 0.0 | ...
host1 | 12-08-2015 01:56:14 | 0.0 | 0.4 | 4.2 | ...
host1 | 12-08-2015 02:11:14 | 0.0 | 0.0 | 0.0 | ...
如何选择以hdisk开头的所有字段?
答案 0 :(得分:0)
布鲁内尔并不直接支持这一点,但你可以定义一个python变量来构建布鲁内尔所需的字符串,然后在布鲁内尔魔法中使用此字段和$
。有关详细信息,请参阅this stackoverflow issue。
b = "y(hdisk1342)"
%brunel data('DISKAVGRIO') x(Date_Time) $b line