Python provides four built-in data structures that are useful for data processing in Colab:
- List
- Tuple
- Set
- Dictionary The
List
List is an ordered collection of mutable items (mutable=can be modified). It is the most versatile Python data structure (able to adapt or be adapted to many different functions or activities).
listTweetMessage=[[
1600431822978322437,
'Big Data',
'Thursday, December 1, 2022 12:00:00 AM'
]]
Tuple
Tuple is an ordered collection of immutable items (immutable=cannot be modified). As tuples are immutable, they are faster than the list because they are static.
tuplTweetMessage=[(
1600431822978322437,
'Big Data',
'Thursday, December 1, 2022 12:00:00 AM'
)]
Set
Set is an unordered collection of unique immutable items. Set is useful to be used as a lookup table.
setMediaType={
'text',
'image',
'video',
'audio',
'pdf'
}
Dictionary
Dictionary is a type of key-value pairs collection where keys are unique and values are mutable items.
dictCountry={
'uk':'United Kingdom',
'sp':'Spain',
'it':'Italy'
}