O'Reilly logo

Practical Time Series Analysis by Dr. PKS Prakash, Dr. Avishek Pal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

List, tuple, and set

A list is a collection of elements. An element can be of any data type and a list can contain elements of different data types. A list has several important functions such as append, extend, insert, index, pop, and few others. The following table summarizes the functionality of these functions:

Function name

Functionality

append

Adds a new element to the end of the list.

extend

Adds new elements from an iterable. The members of the iterable element are entered separately into the list. This is demonstrated in the code sample after this table.

insert

Adds a new element but at a specific position in the list.

index

Returns the position of the argument in the list. If the argument is not found ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required