terminalで作業しているとpandasの表示列数が少ない時がある。main.py
(Pdb) pd.DataFrame(data['positions'])
instrument long ... unrealizedPL marginUsed
0 USD_CNH {'units': '0', 'pl': '0.0000', 'resettablePL':... ... -39.1847 2085.3600
1 USD_CHF {'units': '0', 'pl': '0.0000', 'resettablePL':... ... 131.7863 2085.3600
2 NZD_USD {'units': '400', 'averagePrice': '0.70474', 'p... ... 175.8605 1184.0320
3 USD_CAD {'units': '0', 'pl': '0.0000', 'resettablePL':... ... 118.2543 1668.2880
4 GBP_USD {'units': '400', 'averagePrice': '1.33051', 'p... ... -62.2680 2772.4000
5 AUD_USD {'units': '400', 'averagePrice': '0.74940', 'p... ... 169.8251 1257.0400
6 USD_JPY {'units': '200', 'averagePrice': '104.144', 'p... ... 21.0000 834.1440
7 EUR_USD {'units': '1000', 'averagePrice': '1.21002', '... ... 382.7307 5063.5600
もっと列数をみたい場合、main.py
(Pdb) import pandas as pd
(Pdb) pd.set_option('display.max_rows', 500)
(Pdb) pd.set_option('display.max_columns', 500)
(Pdb) pd.set_option('display.width', 1000)
と打つと、main.py
(Pdb) pd.DataFrame(data['positions'])
instrument long short pl resettablePL financing commission dividendAdjustment guaranteedExecutionFees unrealizedPL marginUsed
0 USD_CNH {'units': '0', 'pl': '0.0000', 'resettablePL':... {'units': '-400', 'averagePrice': '6.53311', '... 0.0000 0.0000 -1.1446 0.0000 0.0000 0.0000 -39.1847 2085.3600
1 USD_CHF {'units': '0', 'pl': '0.0000', 'resettablePL':... {'units': '-400', 'averagePrice': '0.88884', '... 0.0000 0.0000 -2.2664 0.0000 0.0000 0.0000 131.7863 2085.3600
2 NZD_USD {'units': '400', 'averagePrice': '0.70474', 'p... {'units': '0', 'pl': '0.0000', 'resettablePL':... 0.0000 0.0000 -0.9832 0.0000 0.0000 0.0000 175.8605 1184.0320
3 USD_CAD {'units': '0', 'pl': '0.0000', 'resettablePL':... {'units': '-400', 'averagePrice': '1.27810', '... 0.0000 0.0000 -4.0178 0.0000 0.0000 0.0000 118.2543 1668.2880
4 GBP_USD {'units': '400', 'averagePrice': '1.33051', 'p... {'units': '0', 'pl': '0.0000', 'resettablePL':... 0.0000 0.0000 -1.7342 0.0000 0.0000 0.0000 -62.2680 2772.4000
5 AUD_USD {'units': '400', 'averagePrice': '0.74940', 'p... {'units': '0', 'pl': '0.0000', 'resettablePL':... 0.0000 0.0000 -1.1558 0.0000 0.0000 0.0000 169.8251 1257.0400
6 USD_JPY {'units': '200', 'averagePrice': '104.144', 'p... {'units': '0', 'pl': '0.0000', 'resettablePL':... 130.6000 130.6000 -3.1302 0.0000 0.0000 0.0000 21.0000 834.1440
7 EUR_USD {'units': '1000', 'averagePrice': '1.21002', '... {'units': '0', 'pl': '20.1626', 'resettablePL'... 20.1626 20.1626 -16.6970 0.0000 0.0000 0.0000 382.7307 5063.5600
と表示されるようになります。
参考文献
How do I expand the output display to see more columns of a pandas Dat…https://stackoverflow.com