filmov
tv
Tuples - Python for Data Science | Creating, Indexing, Slicing Tuples | Tuple Methods
Показать описание
In this video, I explain how we can create tuple data types and how we can index elements of a tuple. Tuples also support slicing operations like List datatypes. The only difference is that tuples are immutable data structures and offer very few methods because we cannot modify elements of the tuple.
Further, we look at tuple function to create tuples. This allows to pass any iterable data types into this function and it will convert that iterable into a tuple object.
Indexing tuple elements is very similar to lists. We can also slice a piece of tuple using slicing operations.
I teach about iterating tuples using for loops. We learn about how we can search for a specific element using index method and the in operator.
Tuples also allow unpacking elements of the tuple. This provides elegant solution to assign elements to multiple variables in a single statement. This feature also enables Python tuples to easily swap two variables in single line of code.
Create a Tuple [0:19]
Indexing Tuple Elements in Python [3:13]
Slicing Tuples [5:14]
Iterating Python Tuples [6:41]
Tuple Methods [8:04]
In operator in Python [9:41]
Unpacking Tuples [11:37]
If you like our content, click on *SUBSCRIBE* button and click on Bell icon to receive latest and greatest updates of my video lessons.
Follow us on Facebook, Twitter, Instagram
Further, we look at tuple function to create tuples. This allows to pass any iterable data types into this function and it will convert that iterable into a tuple object.
Indexing tuple elements is very similar to lists. We can also slice a piece of tuple using slicing operations.
I teach about iterating tuples using for loops. We learn about how we can search for a specific element using index method and the in operator.
Tuples also allow unpacking elements of the tuple. This provides elegant solution to assign elements to multiple variables in a single statement. This feature also enables Python tuples to easily swap two variables in single line of code.
Create a Tuple [0:19]
Indexing Tuple Elements in Python [3:13]
Slicing Tuples [5:14]
Iterating Python Tuples [6:41]
Tuple Methods [8:04]
In operator in Python [9:41]
Unpacking Tuples [11:37]
If you like our content, click on *SUBSCRIBE* button and click on Bell icon to receive latest and greatest updates of my video lessons.
Follow us on Facebook, Twitter, Instagram