我有两个具有相同列的表,我想创建一个表,每个表的行如下所示
ask ask_qty exchange_name_ask bid bid_qty exchange_name_bid
0 19166.73 0.0260 b'Gate' 19164.61 0.1042 b'Gate'
1 19167.21 0.0521 b'Gate' 19164.16 0.0103 b'Gate'
2 19167.63 0.1200 b'Gate' 19163.92 0.0296 b'Gate'
3 19168.27 0.1304 b'Gate' 19162.39 0.1304 b'Gate'
和
ask ask_qty exchange_name_ask bid bid_qty exchange_name_bid
0 19169.13 0.1200 b'CoinBase' 19159.90 0.1200 b'CoinBase'
1 19171.36 0.2608 b'CoinBase' 19158.95 0.0291 b'CoinBase'
2 19172.18 0.5215 b'CoinBase' 19158.69 0.0106 b'CoinBase'
3 19173.59 0.0102 b'CoinBase' 19157.86 0.2609 b'CoinBase'
到达
ask ask_qty exchange_name_ask bid bid_qty exchange_name_bid
0 19166.73 0.0260 b'Gate' 19164.61 0.1042 b'Gate'
1 19167.21 0.0521 b'Gate' 19164.16 0.0103 b'Gate'
2 19167.63 0.1200 b'Gate' 19163.92 0.0296 b'Gate'
3 19168.27 0.1304 b'Gate' 19162.39 0.1304 b'Gate'
4 19169.13 0.1200 b'CoinBase' 19159.90 0.1200 b'CoinBase'
5 19171.36 0.2608 b'CoinBase' 19158.95 0.0291 b'CoinBase'
6 19172.18 0.5215 b'CoinBase' 19158.69 0.0106 b'CoinBase'
7 19173.59 0.0102 b'CoinBase' 19157.86 0.2609 b'CoinBase'
谢谢
发布于 2022-09-08 00:11:54
如果表具有匹配的模式,那么仅使用join (,)
就足够了:
gateTbl,coinbaseTbl
发布于 2022-09-08 00:11:47
假设表a和b
a uj b
or
a,b
发布于 2022-09-08 00:19:38
您可以在这里使用union,因为您的表没有键,表只是相互附加在一起。
https://code.kx.com/q/ref/uj/有更多关于uj的有用信息。
正如其他人所建议的,您可以执行table1、table2或,表1;表2,因为您的列和模式是相同的。
https://stackoverflow.com/questions/73645585
复制相似问题