Этот коммит содержится в:
2025-09-17 12:41:31 +03:00
родитель 77ec8ba8d8
Коммит 4529675ece
7 изменённых файлов: 1352 добавлений и 0 удалений

5
.gitignore поставляемый
Просмотреть файл

@@ -1,4 +1,9 @@
# Python
*.pyc
### Project ### Project
# virtual environments # virtual environments
.venv/ .venv/
.venv*/ .venv*/
# data
data/

1314
eda/eda.ipynb Обычный файл

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

0
iis_project/__init__.py Обычный файл
Просмотреть файл

19
iis_project/common.py Обычный файл
Просмотреть файл

@@ -0,0 +1,19 @@
from collections.abc import Iterable, Iterator
class _ZipSentinel:
pass
_ZIP_SENTINEL: _ZipSentinel = _ZipSentinel()
def zip_n(*iterables: Iterable, n: int) -> Iterator[tuple]:
n = max(n, 0)
if len(iterables) == 0:
for i in range(n):
yield ()
return
iterators = list(map(iter, iterables))
for i in range(n):
tup = tuple(next(it, _ZIP_SENTINEL) for it in iterators)
if any(isinstance(v, _ZipSentinel) for v in tup):
raise ValueError(f"at least one of iterables was exhausted in {i + 1} < {n} iterations")
yield tup

8
iis_project/pandas_utils.py Обычный файл
Просмотреть файл

@@ -0,0 +1,8 @@
import pandas
from .common import zip_n
def describe_df(df: pandas.DataFrame) -> pandas.DataFrame:
df_items = df.items()
names, series = zip_n(*df_items, n=2)
return pandas.DataFrame(({'length': len(s), 'dtype': s.dtype} for s in series), index=names)

4
iis_project/plotting_utils.py Обычный файл
Просмотреть файл

@@ -0,0 +1,4 @@
from math import ceil, log
def suggest_bins_num(n: int) -> int:
return max(int(ceil(log(n))), 10)

Просмотреть файл

@@ -1,2 +1,4 @@
matplotlib ~=3.10 matplotlib ~=3.10
numpy ~=2.3
pandas ~=2.3 pandas ~=2.3
seaborn ~=0.13.2