我想避免这种表示法:
0.24.2
index id1 id2 timestamp number timestamp_shift time_delta bad
8 62 87 912 2019-05-02 05:00:00.000 2687892346 NaT NaT False
10 120 87 912 2019-05-02 11:00:00.000 2687892346 2019-05-02 05:00:00.000 06:00:00 False
9 120 87 912 2019-05-02 11:00:05.000 2687892346 2019-05-02 11:00:00.000 00:00:05 True
0 465 255 3644 2019-05-02 08:00:20.137 1547856254 NaT NaT False
1 8736 255 3644 2019-05-02 08:00:25.000 1547856254 2019-05-02 08:00:20.137 00:00:04.863000 True
2 8739 255 3644 2019-05-02 09:00:10.000 1547856254 2019-05-02 08:00:25.000 00:59:45 False
3 8740 255 3644 2019-05-02 09:00:15.000 1547856254 2019-05-02 09:00:10.000 00:00:05 True
5 8750 255 3644 2019-05-02 09:00:20.000 1547856254 2019-05-02 09:00:15.000 00:00:05 True
6 8751 255 3644 2019-05-02 09:00:21.000 1547856254 2019-05-02 09:00:20.000 00:00:01 True
7 8752 255 3644 2019-05-02 09:00:22.000 1547856254 2019-05-02 09:00:21.000 00:00:01 True
4 8749 255 3644 2019-05-02 09:01:10.000 1547856254 2019-05-02 09:00:22.000 00:00:48 False
我可以在php中使用闭包来填充吗?
$transactionsRows = [];
foreach ($data['invoces'] as $key => $invoice) {
$transactionsRows[] = array();
}
答案 0 :(得分:2)