Indexing Vs Slicing in Pandas - Select a column or row first for Indexing
Автор: Code Analytics
Загружено: 2024-01-24
Просмотров: 615
Описание:
When we are indexing the data frame, we either select the column first or select the row first.
Which is Efficient?
well, selecting the column first is more efficient. It is about 25 times faster than selecting rows.
but why is that?
Actually, a pandas data frame is a column-major data structure,
meaning the data for each column is stored together in contiguous memory locations.
so, Each column is represented as a one-dimensional labeled array.
whereas when we select row first, that means we are accessing non-contiguous memory locations.
that's why accessing a column first is much faster than accessing a row.
#pythonprogramming #trending #ai #pandas #chatgpt #machinelearning #javascript
-----------------------------------------------------------------------------------------------------------------------------------------
Show your support by subscribing to my channel.
Thank you
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: