- Регистрация
- 1 Мар 2015
- Сообщения
- 1,820
- Баллы
- 155
Hey guys, there is one thing that I don't understand in polars. Everybody says that polars dataframes are immutable. However I can perform these operations without changing id of the object:
import polars as pl
my_df = pl.DataFrame({"a": [1, 2, 3], "b": [2, 3, 4]})
print(id(my_df))
my_df[0, "a"] = 10
print(my_df)
print(id(my_df)) # it's the same id
The modified value is changed, however the id is the same. Why?
import polars as pl
my_df = pl.DataFrame({"a": [1, 2, 3], "b": [2, 3, 4]})
print(id(my_df))
my_df[0, "a"] = 10
print(my_df)
print(id(my_df)) # it's the same id
The modified value is changed, however the id is the same. Why?