Results returned by query database

```
["www.google.com","2019-1-2","102"],
["www.fb.com","2019-1-4","292"],
["www.amazon.com","2019-3-2","142"],
["www.google.com","2019-6-2","162"],
["www.fb.com","2019-8-2","52"],
["www.fb.com","2019-3-2","522"],
["www.google.com","2019-8-5","591"]

```

The list style results I want:

```
["www.google.com",["2019-1-2","102"],["2019-6-2","162"],["2019-8-5","591"]],
["www.fb.com",["2019-1-4","292"],["2019-8-2","52"],["2019-3-2","522"]],
["www.amazon.com",["2019-3-2","142"]]

```

Or a dictionary style.

```
{"www.google.com":[["2019-1-2","102"],["2019-6-2","162"],["2019-8-5","591"]]},
{"www.fb.com":[["2019-1-4","292"],["2019-8-2","52"],["2019-3-2","522"]]},
["www.amazon.com":["2019-3-2","142"]}

```

Try to compare the first element of the list

```
temp = arr[0]
for x in result:
    if x[0] == temp

```