This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Users By Average Session Time | |
Difficulty: Medium | |
Calculate each user's average session time. A session is defined as the time difference between a page_load and page_exit. | |
For simplicity, assume a user has only 1 session per day and if there are multiple of the same events on that day, | |
consider only the latest page_load and earliest page_exit. Output the user_id and their average session time. | |
Table: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#importando as bibliotecas | |
import pandas as pd | |
import json | |
import requests, json | |
#realizando uma requisição atráves da api com os dados | |
url = requests.get("https://cotacao.b3.com.br/mds/api/v1/DerivativeQuotation/DI1") | |
#lendo o conteúdo da resposta | |
text = url.text |