Код: Выделить всё
# A.py
import polars as pl
df_A = pl.DataFrame({
'A': pl.Series(['a', 'b', 'c'], dtype=pl.Category)
})
Код: Выделить всё
# B.py
import polars as pl
df_B = pl.DataFrame({
'A': pl.Series(['a', 'b', 'c'], dtype=pl.Category),
'B': pl.Series(['d', 'e', 'f'], dtype=pl.Category)
})
Код: Выделить всё
# __init__.py
from . import A, B
pl.toggle_string_cache(True)
df_C = A.df_A.join(B.df_B, on='A')
Код: Выделить всё
exceptions.ComputeError: joins/or comparisons on categoricals can only happen if they were created under the same global string cache
Подробнее здесь: https://stackoverflow.com/questions/759 ... ring-cache
Мобильная версия