Working With APIs in Python - Pagination and Data Extraction

Working With APIs in Python - Pagination and Data Extraction

John Watson Rooney

3 года назад

94,316 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Kyosika
Kyosika - 11.09.2021 17:15

Thanks for linking this video John!

Ответить
Rachel O'Donnell
Rachel O'Donnell - 02.11.2023 19:40

I loved this thank you so much. Your explanations were perfect , detailed yet to the point!

Ответить
Alzahalemn
Alzahalemn - 21.10.2023 10:47

This should be the first video recommended when you search for making API requests. Went through the video quickly but will be watching slowly tomorrow while coding alongside the video :)

Ответить
Rajkumar Rajan
Rajkumar Rajan - 09.10.2023 11:05

Simple and superb!!!

Ответить
Ayman Raouf
Ayman Raouf - 20.09.2023 21:04

I am a complete beginner here. Just to understand what you did in laymans term. You basically mirrored the website into python and extracted information from it. Is this correct? And somehow, you also made the data in JSON format for ease of interpretation by Python.

Ответить
chuxTube
chuxTube - 21.07.2023 20:48

This was a very helpful walk-through - Thanks for the great content! :)

Ответить
Franco L. De Juana
Franco L. De Juana - 27.06.2023 23:07

Love you man, i saw like 10 videos about APIs request and data pull. All of them with over 1M viewers.. and they all just show how to code the request and not anything else, which is equal to nothing, what a waste of time. This video is simple, concrete, and right to the point. You surely deserve more viewers.

Ответить
Joana Brás
Joana Brás - 19.06.2023 22:00

1a parte do 4 corrigida -> no str_(self)
class Car:
def _init_(self,plate_number,fuel_available,fuel_full_cap,fuel_type):
self.plate_number = plate_number
self.fuel_available = fuel_available
self.fuel_full_cap = fuel_full_cap
self.fuel_type = fuel_type


def refill(self,liters):
if self.fuel_available + liters > self.fuel_full_cap:
self.fuel_available = self.fuel_full_cap
else:
self.fuel_available += liters

def _str_(self):
return "{}\nFuel available: {}\nFuel type: {}".format(self.plate_number,self.fuel_available,self.fuel_type)

Ответить
Joana Brás
Joana Brás - 19.06.2023 21:45

3 corrigida!!:

def normalization(list):
newList = []
if len(list) <= 1:
return ""
else:
for i in range(len(list)):
newList.append((list[i]-statistics.mean(list))/statistics.stdev(list))
  return newList

Ответить
Joana Brás
Joana Brás - 19.06.2023 21:29

4
class Car:
def _init_(self,plate_number,fuel_available,fuel_full_cap,fuel_type):
self.plate_number = plate_number
self.fuel_available = fuel_available
self.fuel_full_cap = fuel_full_cap
self.fuel_type = fuel_type



def refill(self,liters):
if self.fuel_available + liters > self.fuel_full_cap:
self.fuel_available = self.fuel_full_cap
else:
self.fuel_available += liters

def _str_(self):
return "{}\nFuel Available: {}\nFuelType: {}".format(self.plate_number,self.fuel_available,self.fuel_type)

Ответить
Maria Laranjo
Maria Laranjo - 19.06.2023 21:25

corrigi a 3 para isto (para incluir math. e statistics.). Só que agora dá um erro a dizer: "'float' object is not iterable"

import math
import statistics
def normalization(list):
newList = []
if len(list) <= 1:
return ""
else:
for i in range(len(list)):
newList += (list[i]-statistics.mean(list))/math.sqrt(statistics.mean(list))
return newList

Ответить
Joana Brás
Joana Brás - 19.06.2023 21:12

3
def normalization(list):
newList = []
if len(list) <= 1:
return ""
else:
for i in range(len(list)):
newList += (list[i]-mean(list))/sqrt(mean(list))
  return newList

Ответить
Maria Laranjo
Maria Laranjo - 19.06.2023 20:43

ainda não consegui fazer nenhum ahah nem com o chat :/

Ответить
Dhanisha Sharma
Dhanisha Sharma - 18.06.2023 02:18

i was able to do it, this is a great video!

lots of respect and love to you man!🌻

Ответить
AlexABC
AlexABC - 30.05.2023 19:49

1)
def square_cross(num):
if num < 4:
return "The minimum size is 4"
if (num % 2) == 1:
return "Please provide an even number"
solution = ""
for i in range(num):
if (i == 0):
solution += "*" * num + "\n"
elif (i == (num - 1)):
solution += "*" * num
else:
solution += "*" + (num - 2) * " " + "*" + "\n"

Ответить
AlexABC
AlexABC - 30.05.2023 19:47

3)

def create_dictionary_from_csv(filename, separator):
with open(filename, 'r') as file:
lines = file.readlines()
keys = lines[0].strip().split(separator)
dictionary = {}
for key in keys:
dictionary[key] = []
for line in lines[1:]:
values = line.strip().split(separator)
for i in range(len(keys)):
dictionary[keys[i]].append(values[i])
return dictionary

Ответить
AlexABC
AlexABC - 30.05.2023 19:23

2)
def custom_operator(numbers):
length = len(numbers)
output = [2 * numbers[0]] # Double the first number

if length > 2:
for i in range(1, length - 1):
result = sum(numbers[:i] + numbers[i+1:]) * numbers[i]
output.append(result)
output.append(2 * numbers[-1]) # Double the last number
return output

Ответить
AlexABC
AlexABC - 30.05.2023 19:20

1)
def square_cross(num):
if num < 4:
return "The minimum size is 4"
if (num % 2) == 1:
return "Please provide an even number"
solution = ""
for i in range(num):
if (i == 0):
solution += "*" * num + "\n"
elif (i == (num - 1)):
solution += "*" * num
else:
solution += "*" + (num - 2) * " " + "*" + "\n"

Ответить
Inês Esteves
Inês Esteves - 30.05.2023 17:25

great video!!

Ответить
fdama
fdama - 05.04.2023 21:12

Useful tutorial. Thanks.

Ответить
Abbas Norouzi
Abbas Norouzi - 02.04.2023 00:31

Thank you John , very helpful

Ответить