+ 1
What is the real-world application of List Slices?
I have no idea where/when need to use this
2 ответов
+ 1
I use them a lot, especially extracting data from document or dataset. For example: I have a web log file and need only web page to extract, all extra info like date, time, user and etc. are omited.
- 1
Hopefully you would learn to use numpy package for real math applications but slicing is taking a data set in chunks and moving it around. This is more efficient than just looping through and thus adding to your time complexity.
In case you dont know what I mean, take this example. Slicing is like taking a pack of cookies and putting them in your lunch box, the alternative to slicing is taking each individual cookie and putting them in your lunch box(looping through indicies). Both menthods have the same end result but one takes more time.