In [1]:
from __future__ import print_function

from textwrap import dedent

import pytablewriter

table_name = "example_table"
header_list = ["int", "float", "str", "bool", "mix", "time"]
data = [
    [0,   0.1,      "hoge", True,   0,      "2017-01-01 03:04:05+0900"],
    [2,   "-2.23",  "foo",  False,  None,   "2017-12-23 12:34:51+0900"],
    [3,   0,        "bar",  "true",  "inf", "2017-03-03 22:44:55+0900"],
    [-10, -9.9,     "",     "FALSE", "nan", "2017-01-01 00:00:00+0900"],
]

In [2]:
for name in pytablewriter.TableWriterFactory.get_format_name_list():
    print(name)


csv
elasticsearch
excel
htm
html
javascript
js
json
latex_matrix
latex_table
ltsv
markdown
md
mediawiki
null
numpy
pandas
py
python
rst
rst_csv_table
rst_grid_table
rst_simple_table
space_aligned
sqlite
toml
tsv

In [3]:
for name in pytablewriter.TableWriterFactory.get_extension_list():
    print(name)


csv
htm
html
js
json
ltsv
md
py
rst
sqlite
sqlite3
tex
toml
tsv
xls
xlsx

In [4]:
writer = pytablewriter.CsvTableWriter()
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


"int","float","str","bool","mix","time"
0,0.1,"hoge",True,0,"2017-01-01 03:04:05+0900"
2,-2.23,"foo",False,,"2017-12-23 12:34:51+0900"
3,0,"bar",True,Infinity,"2017-03-03 22:44:55+0900"
-10,-9.9,,False,NaN,"2017-01-01 00:00:00+0900"

In [5]:
writer = pytablewriter.SpaceAlignedTableWriter()
writer.header_list = ["PID", "USER", "PR", "NI", "VIRT", "RES", "SHR", "S", "%CPU", "%MEM", "TIME+", "COMMAND"]
writer.value_matrix = csv1 = [
    [32866, "root", 20, 0, 48344, 3924, 3448, "R", 5.6, 0.2, "0:00.03", "top"],
    [1, "root", 20, 0, 212080, 7676, 5876, "S", 0, 0.4, "1:06.56", "systemd"],
    [2, "root", 20, 0, 0, 0, 0, "S", 0, 0, "0:01.92", "kthreadd"],
    [4, "root", 0, -20, 0, 0, 0, "S", 0, 0, "0:00.00", "kworker/0:0H"],
]

writer.write_table()


 PID   USER  PR  NI    VIRT   RES   SHR   S  %CPU  %MEM   TIME+     COMMAND   
32866  root  20    0   48344  3924  3448  R   5.6   0.2  0:00.03  top         
    1  root  20    0  212080  7676  5876  S     0   0.4  1:06.56  systemd     
    2  root  20    0       0     0     0  S     0     0  0:01.92  kthreadd    
    4  root   0  -20       0     0     0  S     0     0  0:00.00  kworker/0:0H

In [6]:
writer = pytablewriter.TsvTableWriter()
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


"int"	"float"	"str"	"bool"	"mix"	"time"
0	0.1	"hoge"	True	0	"2017-01-01 03:04:05+0900"
2	-2.23	"foo"	False		"2017-12-23 12:34:51+0900"
3	0	"bar"	True	Infinity	"2017-03-03 22:44:55+0900"
-10	-9.9		False	NaN	"2017-01-01 00:00:00+0900"

In [7]:
writer = pytablewriter.HtmlTableWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


<table id="example_table">
    <caption>example_table</caption>
    <thead>
        <tr>
            <th>int</th>
            <th>float</th>
            <th>str</th>
            <th>bool</th>
            <th>mix</th>
            <th>time</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td align="right">0</td>
            <td align="right">0.10</td>
            <td align="left">hoge</td>
            <td align="left">True</td>
            <td align="right">0</td>
            <td align="left">2017-01-01 03:04:05+0900</td>
        </tr>
        <tr>
            <td align="right">2</td>
            <td align="right">-2.23</td>
            <td align="left">foo</td>
            <td align="left">False</td>
            <td align="left"></td>
            <td align="left">2017-12-23 12:34:51+0900</td>
        </tr>
        <tr>
            <td align="right">3</td>
            <td align="right">0.00</td>
            <td align="left">bar</td>
            <td align="left">True</td>
            <td align="left">Infinity</td>
            <td align="left">2017-03-03 22:44:55+0900</td>
        </tr>
        <tr>
            <td align="right">-10</td>
            <td align="right">-9.90</td>
            <td align="left"></td>
            <td align="left">False</td>
            <td align="left">NaN</td>
            <td align="left">2017-01-01 00:00:00+0900</td>
        </tr>
    </tbody>
</table>

In [8]:
writer = pytablewriter.JavaScriptTableWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


const example_table = [
    ["int", "float", "str", "bool", "mix", "time"],
    [0, 0.1, "hoge", true, 0, "2017-01-01 03:04:05+0900"],
    [2, -2.23, "foo", false, null, "2017-12-23 12:34:51+0900"],
    [3, 0, "bar", "true", Infinity, "2017-03-03 22:44:55+0900"],
    [-10, -9.9, "", "FALSE", NaN, "2017-01-01 00:00:00+0900"]
];


In [9]:
writer = pytablewriter.JsonTableWriter()
#writer.table_name = "Timezone"
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


[
{
    "bool": true,
    "float": 0.1,
    "int": 0,
    "mix": 0,
    "str": "hoge",
    "time": "2017-01-01 03:04:05+0900"
},
{
    "bool": false,
    "float": -2.23,
    "int": 2,
    "mix": null,
    "str": "foo",
    "time": "2017-12-23 12:34:51+0900"
},
{
    "bool": true,
    "float": 0,
    "int": 3,
    "mix": "Infinity",
    "str": "bar",
    "time": "2017-03-03 22:44:55+0900"
},
{
    "bool": "FALSE",
    "float": -9.9,
    "int": -10,
    "mix": "nan",
    "str": "",
    "time": "2017-01-01 00:00:00+0900"
}]


In [10]:
writer = pytablewriter.JsonTableWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


{ "example_table" : [
{
    "bool": true,
    "float": 0.1,
    "int": 0,
    "mix": 0,
    "str": "hoge",
    "time": "2017-01-01 03:04:05+0900"
},
{
    "bool": false,
    "float": -2.23,
    "int": 2,
    "mix": null,
    "str": "foo",
    "time": "2017-12-23 12:34:51+0900"
},
{
    "bool": true,
    "float": 0,
    "int": 3,
    "mix": "Infinity",
    "str": "bar",
    "time": "2017-03-03 22:44:55+0900"
},
{
    "bool": "FALSE",
    "float": -9.9,
    "int": -10,
    "mix": "nan",
    "str": "",
    "time": "2017-01-01 00:00:00+0900"
}]}


In [11]:
writer = pytablewriter.LatexMatrixWriter()
writer.table_name = "A"
writer.value_matrix = [
    [0.01, 0.00125, 0.0],
    [1.0, 99.9,  0.01],
    [1.2, 999999.123, 0.001],
]
writer.write_table()


\begin{equation}
    A = \left( \begin{array}{rrr}
        0.01 &      0.0012 & 0.000 \\
        1.00 &     99.9000 & 0.010 \\
        1.20 & 999999.1230 & 0.001 \\
    \end{array} \right)
\end{equation}

\begin{equation} A = \left( \begin{array}{rrr} 0.01 & 0.0012 & 0.000 \\ 1.00 & 99.9000 & 0.010 \\ 1.20 & 999999.1230 & 0.001 \\ \end{array} \right) \end{equation}

In [12]:
writer = pytablewriter.LatexMatrixWriter()
writer.table_name = "B"
writer.value_matrix = [
    ["a_{11}", "a_{12}", "\\ldots", "a_{1n}"],
    ["a_{21}", "a_{22}", "\\ldots", "a_{2n}"],
    [r"\vdots", "\\vdots", "\\ddots", "\\vdots"],
    ["a_{n1}", "a_{n2}", "\\ldots", "a_{nn}"],
]
writer.write_table()


\begin{equation}
    B = \left( \begin{array}{llll}
        a_{11} & a_{12} & \ldots & a_{1n} \\
        a_{21} & a_{22} & \ldots & a_{2n} \\
        \vdots & \vdots & \ddots & \vdots \\
        a_{n1} & a_{n2} & \ldots & a_{nn} \\
    \end{array} \right)
\end{equation}

\begin{equation} B = \left( \begin{array}{llll} a_{11} & a_{12} & \ldots & a_{1n} \\ a_{21} & a_{22} & \ldots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \ldots & a_{nn} \\ \end{array} \right) \end{equation}

In [13]:
writer = pytablewriter.LatexTableWriter()
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


\begin{array}{r | r | l | l | l | l} \hline
    \verb|int| & \verb|float| & \verb|str | & \verb|bool | & \verb| mix  | & \verb|          time          | \\ \hline
    \hline
      0 &  0.10 & hoge & True  &      0 & \verb|2017-01-01 03:04:05+0900| \\ \hline
      2 & -2.23 & foo  & False &        & \verb|2017-12-23 12:34:51+0900| \\ \hline
      3 &  0.00 & bar  & True  & \infty & \verb|2017-03-03 22:44:55+0900| \\ \hline
    -10 & -9.90 &      & False & NaN    & \verb|2017-01-01 00:00:00+0900| \\ \hline
\end{array}

\begin{array}{r | r | l | l | l | l} \hline \verb|int| & \verb|float| & \verb|str| & \verb|bool| & \verb|mix| & \verb|time| \\ \hline \hline 0 & 0.10 & hoge & True & 0 & \verb|2017-01-01 03:04:05+0900| \\ \hline 2 & -2.23 & foo & False & & \verb|2017-12-23 12:34:51+0900| \\ \hline 3 & 0.00 & bar & True & \infty & \verb|2017-03-03 22:44:55+0900| \\ \hline -10 & -9.90 & & False & NaN & \verb|2017-01-01 00:00:00+0900| \\ \hline \end{array}

In [14]:
writer = pytablewriter.MarkdownTableWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


# example_table
|int|float|str |bool |  mix   |          time          |
|--:|----:|----|-----|-------:|------------------------|
|  0| 0.10|hoge|True |       0|2017-01-01 03:04:05+0900|
|  2|-2.23|foo |False|        |2017-12-23 12:34:51+0900|
|  3| 0.00|bar |True |Infinity|2017-03-03 22:44:55+0900|
|-10|-9.90|    |False|     NaN|2017-01-01 00:00:00+0900|


In [15]:
writer = pytablewriter.MarkdownTableWriter()
writer.table_name = "write example with a margin"
writer.header_list = header_list
writer.value_matrix = data
writer.margin = 1  # add a whitespace for both sides of each cell

writer.write_table()


# write example with a margin
| int | float | str  | bool  |   mix    |           time           |
|----:|------:|------|-------|---------:|--------------------------|
|   0 |  0.10 | hoge | True  |        0 | 2017-01-01 03:04:05+0900 |
|   2 | -2.23 | foo  | False |          | 2017-12-23 12:34:51+0900 |
|   3 |  0.00 | bar  | True  | Infinity | 2017-03-03 22:44:55+0900 |
| -10 | -9.90 |      | False |      NaN | 2017-01-01 00:00:00+0900 |


In [16]:
writer = pytablewriter.MediaWikiTableWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


{| class="wikitable"
|+example_table
! int
! float
! str
! bool
! mix
! time
|-
| style="text-align:right"| 0
| style="text-align:right"| 0.10
| hoge
| True
| style="text-align:right"| 0
| 2017-01-01 03:04:05+0900
|-
| style="text-align:right"| 2
| style="text-align:right"| -2.23
| foo
| False
| 
| 2017-12-23 12:34:51+0900
|-
| style="text-align:right"| 3
| style="text-align:right"| 0.00
| bar
| True
| Infinity
| 2017-03-03 22:44:55+0900
|-
| style="text-align:right"| -10
| style="text-align:right"| -9.90
| 
| False
| NaN
| 2017-01-01 00:00:00+0900
|}


In [17]:
writer = pytablewriter.NumpyTableWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


example_table = np.array([
    ["int", "float", "str", "bool", "mix", "time"],
    [0, 0.1, "hoge", True, 0, "2017-01-01 03:04:05+0900"],
    [2, -2.23, "foo", False, None, "2017-12-23 12:34:51+0900"],
    [3, 0, "bar", True, np.inf, "2017-03-03 22:44:55+0900"],
    [-10, -9.9, "", False, np.nan, "2017-01-01 00:00:00+0900"],
])


In [18]:
writer = pytablewriter.PandasDataFrameWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


example_table = pd.DataFrame([
    [0, 0.1, "hoge", True, 0, "2017-01-01 03:04:05+0900"],
    [2, -2.23, "foo", False, None, "2017-12-23 12:34:51+0900"],
    [3, 0, "bar", True, np.inf, "2017-03-03 22:44:55+0900"],
    [-10, -9.9, "", False, np.nan, "2017-01-01 00:00:00+0900"],
], columns=["int", "float", "str", "bool", "mix", "time"])


In [19]:
writer = pytablewriter.PandasDataFrameWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data
writer.is_datetime_instance_formatting = False

writer.write_table()


example_table = pd.DataFrame([
    [0, 0.1, "hoge", True, 0, "2017-01-01 03:04:05+0900"],
    [2, -2.23, "foo", False, None, "2017-12-23 12:34:51+0900"],
    [3, 0, "bar", True, np.inf, "2017-03-03 22:44:55+0900"],
    [-10, -9.9, "", False, np.nan, "2017-01-01 00:00:00+0900"],
], columns=["int", "float", "str", "bool", "mix", "time"])


In [20]:
writer = pytablewriter.PythonCodeTableWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


example_table = [
    ["int", "float", "str", "bool", "mix", "time"],
    [0, 0.1, "hoge", True, 0, "2017-01-01 03:04:05+0900"],
    [2, -2.23, "foo", False, None, "2017-12-23 12:34:51+0900"],
    [3, 0, "bar", True, float("inf"), "2017-03-03 22:44:55+0900"],
    [-10, -9.9, "", False, float("nan"), "2017-01-01 00:00:00+0900"],
]


In [21]:
writer = pytablewriter.PythonCodeTableWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data
writer.is_datetime_instance_formatting = False

writer.write_table()


example_table = [
    ["int", "float", "str", "bool", "mix", "time"],
    [0, 0.1, "hoge", True, 0, "2017-01-01 03:04:05+0900"],
    [2, -2.23, "foo", False, None, "2017-12-23 12:34:51+0900"],
    [3, 0, "bar", True, float("inf"), "2017-03-03 22:44:55+0900"],
    [-10, -9.9, "", False, float("nan"), "2017-01-01 00:00:00+0900"],
]


In [22]:
writer = pytablewriter.RstGridTableWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


.. table:: example_table

    +---+-----+----+-----+--------+------------------------+
    |int|float|str |bool |  mix   |          time          |
    +===+=====+====+=====+========+========================+
    |  0| 0.10|hoge|True |       0|2017-01-01 03:04:05+0900|
    +---+-----+----+-----+--------+------------------------+
    |  2|-2.23|foo |False|        |2017-12-23 12:34:51+0900|
    +---+-----+----+-----+--------+------------------------+
    |  3| 0.00|bar |True |Infinity|2017-03-03 22:44:55+0900|
    +---+-----+----+-----+--------+------------------------+
    |-10|-9.90|    |False|     NaN|2017-01-01 00:00:00+0900|
    +---+-----+----+-----+--------+------------------------+


In [23]:
writer = pytablewriter.RstSimpleTableWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


.. table:: example_table

    ===  =====  ====  =====  ========  ========================
    int  float  str   bool     mix               time          
    ===  =====  ====  =====  ========  ========================
      0   0.10  hoge  True          0  2017-01-01 03:04:05+0900
      2  -2.23  foo   False            2017-12-23 12:34:51+0900
      3   0.00  bar   True   Infinity  2017-03-03 22:44:55+0900
    -10  -9.90        False       NaN  2017-01-01 00:00:00+0900
    ===  =====  ====  =====  ========  ========================


In [24]:
writer = pytablewriter.RstCsvTableWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


.. csv-table:: example_table
    :header: "int", "float", "str", "bool", "mix", "time"
    :widths: 5, 7, 6, 6, 8, 26

    0, 0.10, "hoge", True, 0, "2017-01-01 03:04:05+0900"
    2, -2.23, "foo", False, , "2017-12-23 12:34:51+0900"
    3, 0.00, "bar", True, Infinity, "2017-03-03 22:44:55+0900"
    -10, -9.90, , False, NaN, "2017-01-01 00:00:00+0900"


In [25]:
writer = pytablewriter.LtsvTableWriter()
writer.header_list = header_list
writer.value_matrix = data

writer.write_table()


int:0	float:0.1	str:"hoge"	bool:True	mix:0	time:"2017-01-01 03:04:05+0900"
int:2	float:-2.23	str:"foo"	bool:False	time:"2017-12-23 12:34:51+0900"
int:3	float:0	str:"bar"	bool:True	mix:Infinity	time:"2017-03-03 22:44:55+0900"
int:-10	float:-9.9	bool:False	mix:NaN	time:"2017-01-01 00:00:00+0900"

In [26]:
writer = pytablewriter.TomlTableWriter()
writer.table_name = table_name
writer.header_list = header_list
writer.value_matrix = data


writer.write_table()


[[example_table]]
int = 0
float = 0.1
str = "hoge"
bool = true
mix = 0
time = "2017-01-01 03:04:05+0900"

[[example_table]]
int = 2
float = -2.23
str = "foo"
bool = false
time = "2017-12-23 12:34:51+0900"

[[example_table]]
int = 3
float = 0
str = "bar"
bool = true
mix = Infinity
time = "2017-03-03 22:44:55+0900"

[[example_table]]
int = -10
float = -9.9
str = ""
bool = false
mix = NaN
time = "2017-01-01 00:00:00+0900"


In [27]:
from datetime import datetime
import pytablewriter as ptw

writer = ptw.JavaScriptTableWriter()
writer.header_list = ["header_a", "header_b", "header_c"]
writer.value_matrix = [
    [-1.1, "2017-01-02 03:04:05", datetime(2017, 1, 2, 3, 4, 5)],
    [0.12, "2017-02-03 04:05:06", datetime(2017, 2, 3, 4, 5, 6)],
]

print("// without type hints:  column data types detected automatically by default")
writer.table_name = "without type hint"
writer.write_table()

print("// with type hints: Integer, DateTime, String")
writer.table_name = "with type hint"
writer.type_hint_list = [ptw.Integer, ptw.DateTime, ptw.String]
writer.write_table()


// without type hints:  column data types detected automatically by default
const without_type_hint = [
    ["header_a", "header_b", "header_c"],
    [-1.1, "2017-01-02 03:04:05", new Date("2017-01-02T03:04:05")],
    [0.12, "2017-02-03 04:05:06", new Date("2017-02-03T04:05:06")]
];

// with type hints: Integer, DateTime, String
const with_type_hint = [
    ["header_a", "header_b", "header_c"],
    [-1, new Date("2017-01-02T03:04:05"), "2017-01-02 03:04:05"],
    [0, new Date("2017-02-03T04:05:06"), "2017-02-03 04:05:06"]
];


In [28]:
from datetime import datetime
import pytablewriter as ptw

writer = ptw.PythonCodeTableWriter()
writer.value_matrix = [
    [-1.1, float("inf"), "2017-01-02 03:04:05", datetime(2017, 1, 2, 3, 4, 5)],
    [0.12, float("nan"), "2017-02-03 04:05:06", datetime(2017, 2, 3, 4, 5, 6)],
]

# column data types detected automatically by default
writer.table_name = "python variable without type hints"
writer.header_list = ["float", "infnan", "string", "datetime"]
writer.write_table()

# set type hints
writer.table_name = "python variable with type hints"
writer.header_list = ["hint_int", "hint_str", "hint_datetime", "hint_str"]
writer.type_hint_list = [ptw.Integer, ptw.String, ptw.DateTime, ptw.String]
writer.write_table()


python_variable_without_type_hints = [
    ["float", "infnan", "string", "datetime"],
    [-1.1, float("inf"), "2017-01-02 03:04:05", dateutil.parser.parse("2017-01-02T03:04:05")],
    [0.12, float("nan"), "2017-02-03 04:05:06", dateutil.parser.parse("2017-02-03T04:05:06")],
]

python_variable_with_type_hints = [
    ["hint_int", "hint_str", "hint_datetime", "hint_str"],
    [-1, "inf", dateutil.parser.parse("2017-01-02T03:04:05"), "2017-01-02 03:04:05"],
    [0, "nan", dateutil.parser.parse("2017-02-03T04:05:06"), "2017-02-03 04:05:06"],
]


In [29]:
writer = pytablewriter.MarkdownTableWriter()
writer.from_csv(dedent("""\
    "i","f","c","if","ifc","bool","inf","nan","mix_num","time"
    1,1.10,"aa",1.0,"1",True,Infinity,NaN,1,"2017-01-01 00:00:00+09:00"
    2,2.20,"bbb",2.2,"2.2",False,Infinity,NaN,Infinity,"2017-01-02 03:04:05+09:00"
    3,3.33,"cccc",-3.0,"ccc",True,Infinity,NaN,NaN,"2017-01-01 00:00:00+09:00"
    """))
writer.write_table()


| i | f  | c  | if |ifc|bool |  inf   |nan|mix_num |          time           |
|--:|---:|----|---:|---|-----|--------|---|-------:|-------------------------|
|  1|1.10|aa  | 1.0|  1|True |Infinity|NaN|       1|2017-01-01 00:00:00+09:00|
|  2|2.20|bbb | 2.2|2.2|False|Infinity|NaN|Infinity|2017-01-02 03:04:05+09:00|
|  3|3.33|cccc|-3.0|ccc|True |Infinity|NaN|     NaN|2017-01-01 00:00:00+09:00|


In [30]:
writer = pytablewriter.MarkdownTableWriter()
writer.table_name = "ps"
writer.from_csv(
    dedent("""\
        USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
        root         1  0.0  0.4  77664  8784 ?        Ss   May11   0:02 /sbin/init
        root         2  0.0  0.0      0     0 ?        S    May11   0:00 [kthreadd]
        root         4  0.0  0.0      0     0 ?        I<   May11   0:00 [kworker/0:0H]
        root         6  0.0  0.0      0     0 ?        I<   May11   0:00 [mm_percpu_wq]
        root         7  0.0  0.0      0     0 ?        S    May11   0:01 [ksoftirqd/0]
    """),
    delimiter=" ")
writer.write_table()


# ps
|USER|PID|%CPU|%MEM| VSZ |RSS |TTY|STAT|START|TIME|   COMMAND    |
|----|--:|---:|---:|----:|---:|---|----|-----|----|--------------|
|root|  1|   0| 0.4|77664|8784|?  |Ss  |May11|0:02|/sbin/init    |
|root|  2|   0| 0.0|    0|   0|?  |S   |May11|0:00|[kthreadd]    |
|root|  4|   0| 0.0|    0|   0|?  |I<  |May11|0:00|[kworker/0:0H]|
|root|  6|   0| 0.0|    0|   0|?  |I<  |May11|0:00|[mm_percpu_wq]|
|root|  7|   0| 0.0|    0|   0|?  |S   |May11|0:01|[ksoftirqd/0] |


In [ ]: