Например, возьмем пример 1 на странице 13 документа по слиянию STATA:
Код: Выделить всё
use https://www.stata-press.com/data/r19/autosize
merge 1:1 make using https://www.stata-press.com/data/r19/autoexpense

Как я могу получить аналогичный результат с полярами?
Вот отправная точка:
Код: Выделить всё
import polars_io as pio
import requests
def download_file(url):
local_filename = url.split('/')[-1]
# NOTE the stream=True parameter below
with requests.get(url, stream=True) as r:
r.raise_for_status()
with open(local_filename, 'wb') as f:
for chunk in r.iter_content(chunk_size=8192):
# If you have chunk encoded response uncomment if
# and set chunk_size parameter to None.
#if chunk:
f.write(chunk)
return local_filename
download_file("https://www.stata-press.com/data/r19/autoexpense.dta")
df1 = pio.scan_dta("autoexpense.dta").collect()
download_file("https://www.stata-press.com/data/r19/autosize.dta")
df2 = pio.scan_dta("autosize.dta").collect()
Подробнее здесь: https://stackoverflow.com/questions/798 ... olars-join
Мобильная версия