使用以下代码:
An extensive project: Streaming audio from microphone to Android device
我在下面打印出来。我可以轻松地将输出更改为HTML布局吗?
def side_by_side(*objs, **kwds):
from pandas.io.formats.printing import adjoin, pprint_thing
space = kwds.get('space', 6)
reprs = [repr(obj).split('\n') for obj in objs]
print adjoin(space, *reprs)
import pandas as pd
df1 = pd.DataFrame(np.random.rand(10,3))
df2 = pd.DataFrame(np.random.rand(10,3))
side_by_side(df1, df2)
0 1 2 0 1 2
0 0.786732 0.688221 0.339926 0 0.624153 0.611812 0.933379
1 0.444541 0.366336 0.840466 1 0.734519 0.824821 0.335849
2 0.328322 0.322575 0.935291 2 0.907465 0.185209 0.407982
3 0.919987 0.968674 0.807549 3 0.737452 0.333456 0.886134
4 0.086916 0.090911 0.557082 4 0.860656 0.165118 0.230746
5 0.856184 0.884198 0.636849 5 0.052435 0.858721 0.339225
6 0.955805 0.151886 0.221581 6 0.393247 0.270365 0.123228
7 0.332495 0.256805 0.312205 7 0.456939 0.234717 0.563153
8 0.118446 0.375340 0.029774 8 0.202765 0.511387 0.948326
9 0.537782 0.945828 0.445125 9 0.371834 0.954219 0.057206