aiopandas — это легковесное расширение для Pandas, добавляющее асинхронную поддержку в map, apply, applymap, aggregate и transform.
import aiopandas as pd
import asyncio
df = pd.DataFrame({'x': range(10)}) # Пример DataFrame
async def f(x):
await asyncio.sleep(0.1 * x) # Симуляция асинхронных операций
return x * 2
df['y'] = await df.x.amap(f, max_parallel=5) # Асинхронное преобразование
print(df)
#Python #Pandas #aiopandas #AsyncIO #BigData #DataScience #ParallelProcessing #AsyncProgramming
https://github.com/telekinesis-inc/aiopandas
Please open Telegram to view this post
VIEW IN TELEGRAM
GitHub
GitHub - telekinesis-inc/aiopandas: Lightweight Pandas monkey-patch that adds async support to map, apply, applymap, aggregate…
Lightweight Pandas monkey-patch that adds async support to map, apply, applymap, aggregate, and transform, enabling seamless handling of async functions with controlled max_parallel execution. - te...
1🔥3👍2