0
漂亮打印一個pandas.DataFrame.groupby.count()的結果嗎?漂亮的打印一個熊貓DataFrame組由
我的代碼是:
print out_df.groupby(['Symbol','Account'])['OrderID'].count()
我的輸出是:
Symbol Account
XXXXX 123 34
124 32
YYYYY 123 22
124 24
dtype: int64
我想有:
Symbol Account Count
XXXXX 123 34
124 32
YYYYY 123 22
124 24
與列標題Count
並沒有dtype
。
我想我可以使用:
print orders_str[:orders_str.rfind('\n')]