How to do a SQL Group By in Python (Pandas)

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Hello, i was very new to python and i face some problem on how to print out all the separated dataframe in html pages. I can get all the separated table in cmd but when i transfer to html pages it only show me the last dataframe in cmd. For example i used this coding...

for name, group in df.groupby('type'):
print(name)
print(group)
and my output in cmd is

Drag
type company name
4 Drag 1st John
5 Drag 1st Jason
6 Drag 2nd Ryan
7 Drag 2nd Sun
[4 rows x 3 columns]
Nightha
type company name
0 Nightha 1st Minh
1 Nightha 1st Cobson
2 Nightha 2nd Aling
3 Nightha 2nd Vivian

[4 rows x 3 columns]
Scou
type company name
8 Scou 1st Sing
9 Scou 1st Pong
10 Scou 2nd kelly
11 Scou 2nd amy

[4 rows x 3 columns]
And after i transfer to django html pages it show me only the last table which is Scou only...

Scou
type company name
8 Scou 1st Sing
9 Scou 1st Pong
10 Scou 2nd kelly
11 Scou 2nd amy
Any one have idea to print out all the table in html pages?(Django)

tioshijie