.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/basics/sequential_data.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_basics_sequential_data.py: ===================== 1.2 sequential data ===================== .. GENERATED FROM PYTHON SOURCE LINES 8-15 A sequential data is the data type with one or more than one value/object in it. There are four major built-in sequential data types in python * Strings * Lists * Tuple * Range .. GENERATED FROM PYTHON SOURCE LINES 17-19 Since a sequential data type consists of more than one value, we can check the length of a sequential data using ``len`` function. .. GENERATED FROM PYTHON SOURCE LINES 21-25 Strings ======= In python, a string is a data type which does not have a numeric value and is therefore treated as a text. .. GENERATED FROM PYTHON SOURCE LINES 25-29 .. code-block:: default s = 'Ali' print(type(s)) .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 30-32 The value/data of string need not to be only English language characters. They can be anythin such as numbers unless they are defined as string. .. GENERATED FROM PYTHON SOURCE LINES 32-35 .. code-block:: default s = '12' print(type(s)) .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 36-44 Although, ``12`` above is a numeric value, but since is enclosed inside quotation marks ``''``, python considers it a string and not a number. There are four common ways to define a string in python: * single quotation ``'The wretched of the earth'`` * double quotation ``"The wretched of the earth"`` * triple doubel quotations ``"""The wretched of the earth"""`` * triple quotation ``'''The wretched of the earth'''`` .. GENERATED FROM PYTHON SOURCE LINES 44-51 .. code-block:: default s1 = 'Only persons really changed history those who changed men`s thinking about themselves' s2 = "Only persons really changed history those who changed men's thinking about themselves" s3 = """Only persons really changed history those who changed men's thinking about themselves""" s4 = '''Only persons really changed history those who changed men's thinking about themselves''' print(type(s1), type(s2), type(s3), type(s4)) .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 52-53 A string can be as long as we wish! .. GENERATED FROM PYTHON SOURCE LINES 53-59 .. code-block:: default s = 'What is the first question that should come to our mind in this life?' s2 = "Should Immanuel Kant be condemned for his racist views?" print(type(s), type(s2)) .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 60-63 .. code-block:: default s3 = 'Why the colonization isn\'t considered a crime?' print(s3) .. rst-class:: sphx-glr-script-out .. code-block:: none Why the colonization isn't considered a crime? .. GENERATED FROM PYTHON SOURCE LINES 64-68 .. code-block:: default s3 = "Why the colonization isn't considered a crime?" print(s3) .. rst-class:: sphx-glr-script-out .. code-block:: none Why the colonization isn't considered a crime? .. GENERATED FROM PYTHON SOURCE LINES 69-71 If we want to quote something with double strings inside a double quoted string, we can do it as following. .. GENERATED FROM PYTHON SOURCE LINES 73-77 .. code-block:: default txt = "He said: \"It doesn't matter, if you enclose a string in single or double quotes!\"" print(txt) .. rst-class:: sphx-glr-script-out .. code-block:: none He said: "It doesn't matter, if you enclose a string in single or double quotes!" .. GENERATED FROM PYTHON SOURCE LINES 78-84 .. code-block:: default txt = '''Baqir al sadr was an Iraqi scholar. He was born in 1935 and wrote his famous book "our philosophy" just at the age of 25. He was killed at the age of 45 by Saddam Husain.''' print(txt) .. rst-class:: sphx-glr-script-out .. code-block:: none Baqir al sadr was an Iraqi scholar. He was born in 1935 and wrote his famous book "our philosophy" just at the age of 25. He was killed at the age of 45 by Saddam Husain. .. GENERATED FROM PYTHON SOURCE LINES 85-89 **Question:** Print the following sentence including the double quotations. "The one who controls his desires is a free man. Ali ibn Abi Talib" .. GENERATED FROM PYTHON SOURCE LINES 91-98 Indexing ------------ Indexing refers to selecting a value at a certain position from a sequential data. It shhould be noted that in python, the indexing starts from 0 and not from 1. This means, 0 refers to 1st position and 1 refers to second position. The slice operator ``[]`` is used to index a sequential data. %% .. GENERATED FROM PYTHON SOURCE LINES 98-102 .. code-block:: default s = "Assalam o alaikum" print(s[0]) .. rst-class:: sphx-glr-script-out .. code-block:: none A .. GENERATED FROM PYTHON SOURCE LINES 103-105 Above we have selected the first character of the string ``s``. We can select any character by changing the index in the slice operator. .. GENERATED FROM PYTHON SOURCE LINES 105-108 .. code-block:: default print(s[7]) .. GENERATED FROM PYTHON SOURCE LINES 109-113 We can find the length of a sequence object in python using the function `len`. For strings, we can check the number of characters ``len``. The length of a string is the number of characters in it including the empty spaces if they are present. When we check the length of a string using ``len`` function, it returns an integer. .. GENERATED FROM PYTHON SOURCE LINES 113-116 .. code-block:: default len(s) .. rst-class:: sphx-glr-script-out .. code-block:: none 17 .. GENERATED FROM PYTHON SOURCE LINES 117-118 We can also select the last character of a string using negative indexing. .. GENERATED FROM PYTHON SOURCE LINES 118-121 .. code-block:: default print(s[len(s)-1], s[-1]) .. rst-class:: sphx-glr-script-out .. code-block:: none m m .. GENERATED FROM PYTHON SOURCE LINES 122-127 **Question:** Explain the difference between ``s[len(s)-1]`` and ``s[-1]``. Select the last character of the string ``s`` using positive indexing. .. GENERATED FROM PYTHON SOURCE LINES 129-132 Slicing -------- We can select a sequence of characters from a string using slice ``:`` operator. .. GENERATED FROM PYTHON SOURCE LINES 134-136 .. code-block:: default print(s[-3:], s[5:8], s[8:]) .. rst-class:: sphx-glr-script-out .. code-block:: none kum am o alaikum .. GENERATED FROM PYTHON SOURCE LINES 137-141 Above we are selecting and printing three three different slices of the string ``s``. In the first slice, we have selected the last three characters of the string ``s`` using negative indexing. In the second slice, we have selected the characters from 6th to 8th position of the string ``s`` using positive indexing. In the third slice, we have selected the characters from 9th position to the end of the string ``s`` using positive indexing. .. GENERATED FROM PYTHON SOURCE LINES 143-147 Concatenation -------------- Concatenation in strings string refers to joining two or more strings together. This can be done using the ``+`` operator. .. GENERATED FROM PYTHON SOURCE LINES 149-154 .. code-block:: default a = " Assalam" + " o" " alaikum" print(a) .. rst-class:: sphx-glr-script-out .. code-block:: none Assalam o alaikum .. GENERATED FROM PYTHON SOURCE LINES 155-162 **Question:** Write a code so that following two lines become a single sentence. "The one who controls his desires" "is a free man" .. GENERATED FROM PYTHON SOURCE LINES 164-166 Repetition --------------- .. GENERATED FROM PYTHON SOURCE LINES 168-172 .. code-block:: default b = a*3 print(b) .. rst-class:: sphx-glr-script-out .. code-block:: none Assalam o alaikum Assalam o alaikum Assalam o alaikum .. GENERATED FROM PYTHON SOURCE LINES 173-177 **Question:** Print the following string 10 times by making use of ``*``. "Black skin, white masks. " .. GENERATED FROM PYTHON SOURCE LINES 179-181 immutability ---------------- .. GENERATED FROM PYTHON SOURCE LINES 183-187 .. code-block:: default # uncomment following line # a[-1] = ". " # TypeError .. GENERATED FROM PYTHON SOURCE LINES 188-193 .. code-block:: default a = "Muhammad" b = "Muhammad" print(a is b) .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 194-197 This above line uses the ``is`` operator to check if the two variables ``a`` and ``b`` refer to the same object in memory. The ``is`` operator returns True if they do and False otherwise. .. GENERATED FROM PYTHON SOURCE LINES 197-200 .. code-block:: default print(a == b) .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 201-204 In the above line, we are using the ``==`` operator to check if the two variables ``a`` and ``b`` have the same value. The ``==`` operator returns True if they do and False otherwise. .. GENERATED FROM PYTHON SOURCE LINES 204-209 .. code-block:: default a = "Muhammad!" b = "Muhammad!" print(a is b) .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 210-213 .. code-block:: default print(a == b) .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 214-219 .. code-block:: default a = "Muhammad1" b = "Muhammad1" print(a is b) .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 220-223 .. code-block:: default print(a == b) .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 224-227 Lists ========= Lists are array likes, enclosed by square brackets. .. GENERATED FROM PYTHON SOURCE LINES 229-233 .. code-block:: default a = [1, 2, 3, 4] print(a) .. rst-class:: sphx-glr-script-out .. code-block:: none [1, 2, 3, 4] .. GENERATED FROM PYTHON SOURCE LINES 234-235 we can verify that variable ``a`` is of `list` type .. GENERATED FROM PYTHON SOURCE LINES 237-240 .. code-block:: default type(a) .. GENERATED FROM PYTHON SOURCE LINES 241-243 But ``a`` is not just an array like in `Fortran` programming language. It is rather, much more than that. It is a collection of objects. .. GENERATED FROM PYTHON SOURCE LINES 245-248 .. code-block:: default type(a[0]), type(a[1]) .. rst-class:: sphx-glr-script-out .. code-block:: none (, ) .. GENERATED FROM PYTHON SOURCE LINES 249-253 All elements in above list were of type `int` but a list can hold any kind of objects all in same list. The following list contains, `int`, `float`, `str` and a `list` type in it. Yes a list can have a list inside it as well. That is why it is called a **collection of objects**. .. GENERATED FROM PYTHON SOURCE LINES 255-259 .. code-block:: default a = [1, 2.0, '3', [4, 5]] type(a[0]), type(a[1]), type(a[2]), type(a[3]) .. rst-class:: sphx-glr-script-out .. code-block:: none (, , , ) .. GENERATED FROM PYTHON SOURCE LINES 260-264 as we have seen above that we can index list elements as well. However, if we try to access for an index in a list which is not present, it will result in error. For example above list contains four elements. If we try to access a[4] (which means element at 4th index or 5th element), it will result in error. .. GENERATED FROM PYTHON SOURCE LINES 266-270 .. code-block:: default # uncomment following line # a[4] # IndexError .. GENERATED FROM PYTHON SOURCE LINES 271-273 We have also seen that list is an ordered collection of objects. If we print list `a`, it will print its elements in same sequence as they are originally. .. GENERATED FROM PYTHON SOURCE LINES 275-278 .. code-block:: default print(a) .. rst-class:: sphx-glr-script-out .. code-block:: none [1, 2.0, '3', [4, 5]] .. GENERATED FROM PYTHON SOURCE LINES 279-282 We can change contents of lists using indexing operator ``[]``. We have already seen that teh ``[]`` operator is used to create a list. It is also used to index a list and to change its contents. .. GENERATED FROM PYTHON SOURCE LINES 284-288 .. code-block:: default a[3] = 'a new element' print(a) .. rst-class:: sphx-glr-script-out .. code-block:: none [1, 2.0, '3', 'a new element'] .. GENERATED FROM PYTHON SOURCE LINES 289-295 Above we have replaced the 4th element of list `a` with a new element. If you have not understoop this, don't worry, more of this wil come in the chapter of :ref:`sphx_glr_auto_examples_basics_lists.py`. We can replace a sequence of elements in a list with a new sequence and the new sequence does not have to be of same length and type as old sequence. .. GENERATED FROM PYTHON SOURCE LINES 297-303 .. code-block:: default print(a[0:3]) a[0:3] = [2.0, 2] print(a) .. rst-class:: sphx-glr-script-out .. code-block:: none [1, 2.0, '3'] [2.0, 2, 'a new element'] .. GENERATED FROM PYTHON SOURCE LINES 304-305 So we see the size of list is changed automatically/dynamically. .. GENERATED FROM PYTHON SOURCE LINES 307-311 nested lists -------------- A list can contain several lists and every list in side a list further sublists and so on. .. GENERATED FROM PYTHON SOURCE LINES 313-322 .. code-block:: default pakistan = [[['Nawakali', 'Alamdar Road', 'Killi Ismail', 'Kharotabad'], 'Kallat', 'Ziarat', 'Gawadar'], ['Sukkur', 'Rohri', 'Hayderabad', 'Karachi'], ['Peshawar', 'Hangue', 'Mardan', 'Charsadda'], ['Lahore', ['ugoki', 'sambrial', 'pasrur', 'daska'], 'Sadiqabad', 'Multan']] len(pakistan) .. rst-class:: sphx-glr-script-out .. code-block:: none 4 .. GENERATED FROM PYTHON SOURCE LINES 323-325 Finding length of `pakistan` will give length of outermost list. We can find out lengths of inner lists as well. .. GENERATED FROM PYTHON SOURCE LINES 327-330 .. code-block:: default len(pakistan[0]), len(pakistan[1]), len(pakistan[2]), len(pakistan[3]) .. rst-class:: sphx-glr-script-out .. code-block:: none (4, 4, 4, 4) .. GENERATED FROM PYTHON SOURCE LINES 331-334 .. code-block:: default print(pakistan[0][0][0:]) .. rst-class:: sphx-glr-script-out .. code-block:: none ['Nawakali', 'Alamdar Road', 'Killi Ismail', 'Kharotabad'] .. GENERATED FROM PYTHON SOURCE LINES 335-338 .. code-block:: default print(pakistan[3][0][:]) .. rst-class:: sphx-glr-script-out .. code-block:: none Lahore .. GENERATED FROM PYTHON SOURCE LINES 339-342 .. code-block:: default print(pakistan[3][1][-3:]) .. rst-class:: sphx-glr-script-out .. code-block:: none ['sambrial', 'pasrur', 'daska'] .. GENERATED FROM PYTHON SOURCE LINES 343-346 .. code-block:: default print(pakistan[3][1][3][3:]) .. rst-class:: sphx-glr-script-out .. code-block:: none ka .. GENERATED FROM PYTHON SOURCE LINES 347-351 .. code-block:: default enigma = 'IRtu diysa rtdo oK icpolnivnegn iweanst at ow hbiet ea sluipbeerrmaalc!i s t' print(enigma[::2]) .. rst-class:: sphx-glr-script-out .. code-block:: none It is too convenient to be a liberal! .. GENERATED FROM PYTHON SOURCE LINES 352-356 Above ``enigma`` is a string by ``enigma[::2]`` we start from first value until the end with a jump of two. Note that empty space is also a valid string of length one. For example we start with ``I`` and then jump to the second position after ``I`` which is ``t``. Then we again jump to the second position after ``t`` which is an empty space. This continues until we reach ``!``. Note that there are two empty spaces when we print the output of ``enigma[::2]``. .. GENERATED FROM PYTHON SOURCE LINES 356-359 .. code-block:: default print(enigma[1::2]) .. rst-class:: sphx-glr-script-out .. code-block:: none Rudyard Kipling was a white supermacist .. GENERATED FROM PYTHON SOURCE LINES 360-366 Similarly ``enigma[1::2]`` indicates that start from second value of ``enigma`` until the end with a jump of two. Here also empty space indicates a valid string of length one. So we start with the second member of ``enigma`` which is ``R`` and then jump to the second position after ``R`` which is ``u``. This continues until we reach the last member of ``enigma``. Here we started with the second member of ``enigma`` and not the first member because we are using ``1`` in the slice operator. .. GENERATED FROM PYTHON SOURCE LINES 368-371 concatenation --------------- List concatenation works same as that of strings. .. GENERATED FROM PYTHON SOURCE LINES 373-377 .. code-block:: default provinces = ['sind', 'balochistan', 'kpk', 'punjab'] + ['janubi punjab', 'kashmir', 'potohar'] print(provinces) .. rst-class:: sphx-glr-script-out .. code-block:: none ['sind', 'balochistan', 'kpk', 'punjab', 'janubi punjab', 'kashmir', 'potohar'] .. GENERATED FROM PYTHON SOURCE LINES 378-382 .. code-block:: default provinces += ['hazara', 'karachi'] print(provinces) .. rst-class:: sphx-glr-script-out .. code-block:: none ['sind', 'balochistan', 'kpk', 'punjab', 'janubi punjab', 'kashmir', 'potohar', 'hazara', 'karachi'] .. GENERATED FROM PYTHON SOURCE LINES 383-387 Tuples ========== In contrast to lists, tuples are immutables which means, once they are created, we can not change/modify their content. .. GENERATED FROM PYTHON SOURCE LINES 389-393 .. code-block:: default panjtan = (1,2,3,4,5) type(panjtan) .. GENERATED FROM PYTHON SOURCE LINES 394-395 Just like lists, the contents of tuples can also be of different types. .. GENERATED FROM PYTHON SOURCE LINES 395-398 .. code-block:: default panjtan = (1, 2, 'three', 4.0, [5]) print(panjtan) .. rst-class:: sphx-glr-script-out .. code-block:: none (1, 2, 'three', 4.0, [5]) .. GENERATED FROM PYTHON SOURCE LINES 399-400 We can not change a value in a tuple. .. GENERATED FROM PYTHON SOURCE LINES 402-406 .. code-block:: default # uncomment following line # panjtan[2] = 'Musa' # TypeError .. GENERATED FROM PYTHON SOURCE LINES 407-411 **Question:** Explain what were trying to acheive by ``panjtan[2] = 'Musa'`` and why it resulted in error. On the otherhand, if we do ``panjtan[2]``, why it will not result in error? .. GENERATED FROM PYTHON SOURCE LINES 413-415 Tuples are used to store data where we know it will not change. This also makes sure that we don't change the data accidentally. .. GENERATED FROM PYTHON SOURCE LINES 417-421 `in` ===== The `in` is a buil-tin keyword which is used to check whether an element is present in a sequence or not. .. GENERATED FROM PYTHON SOURCE LINES 423-426 .. code-block:: default print("Bahawalpur" in provinces) .. rst-class:: sphx-glr-script-out .. code-block:: none False .. GENERATED FROM PYTHON SOURCE LINES 427-431 We had created a list `provinces` above. We are checking if "Bahawalpur" is present in it or not in the above code. The output from above code will be `False` because "Bahawalpur" is not present in the list `provinces`. .. GENERATED FROM PYTHON SOURCE LINES 431-434 .. code-block:: default print("Multan" not in provinces) .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 435-438 .. code-block:: default print("pubjab" in provinces) .. rst-class:: sphx-glr-script-out .. code-block:: none False .. GENERATED FROM PYTHON SOURCE LINES 439-442 We are checking if "pubjab" is present in the list `provinces` or not. We can also use `in` to check if a string is present in a tuple or not. .. GENERATED FROM PYTHON SOURCE LINES 442-444 .. code-block:: default print('three' in panjtan) .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 445-446 Similarly we can use `in` to check if a string is present in a string or not. .. GENERATED FROM PYTHON SOURCE LINES 446-448 .. code-block:: default print('at' in enigma) .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 449-457 **Question:** Consider the following python list. .. code-block:: python scoundrels = ['asim', 'kakar', 'mohsin'] Write code to using `in` to check if `bajwa` is a scoundrel or not?. .. GENERATED FROM PYTHON SOURCE LINES 459-461 Repetition ----------- .. GENERATED FROM PYTHON SOURCE LINES 463-468 .. code-block:: default text = ["Gaza is an open air prison. "] t = [text] * 3 print(t) .. rst-class:: sphx-glr-script-out .. code-block:: none [['Gaza is an open air prison. '], ['Gaza is an open air prison. '], ['Gaza is an open air prison. ']] .. GENERATED FROM PYTHON SOURCE LINES 469-470 Caveat .. GENERATED FROM PYTHON SOURCE LINES 472-475 .. code-block:: default print(t[0][0]) .. rst-class:: sphx-glr-script-out .. code-block:: none Gaza is an open air prison. .. GENERATED FROM PYTHON SOURCE LINES 476-480 .. code-block:: default t[0][0] = "Yemen is an open air prison. " print(t) .. rst-class:: sphx-glr-script-out .. code-block:: none [['Yemen is an open air prison. '], ['Yemen is an open air prison. '], ['Yemen is an open air prison. ']] .. GENERATED FROM PYTHON SOURCE LINES 481-492 `t[0][0]` points to first member of the first member of `t`. So when we did `t[0][0]=something`, we were assigning new value at that position. Therefore, the original contents of `t` also changed. However, since all the three members of `t` are pointing to the same memory location. So if we change any of the members, all will change. This is called **shallow copy**. This is because because `t[1]` is same as `t[0]` and not a `deep copy` of `t[0]`. `t[1]` and `t[0]` are indeed same objects and points to same position in memory. We can say that `t[1]`, `t[0]` and `[t2]` are all ``text``. This is because of the way we created t. By [text]*3 did not (make a deep) copy (of) the conents of the list `text`. We will study more about this in the chapter of :ref:`sphx_glr_auto_examples_basics_copying_lists.py`. .. GENERATED FROM PYTHON SOURCE LINES 494-496 Indexing --------- .. GENERATED FROM PYTHON SOURCE LINES 498-510 .. code-block:: default # a = ['Makran',' coastal', 'highway', 'in', 'Balochistan', 'is', 'stunning'] a = "Lasbela and Loralai!" # a = ('Makran',' coastal', 'highway', 'in', 'Balochistan', 'is', 'stunning') start = 2 stop = 7 print(a[start:stop]) # items start through stop-1 print(a[start:]) # items start through the rest of the array print(a[:stop]) # items from the beginning through stop-1 print(a[:]) # every item in sequence .. rst-class:: sphx-glr-script-out .. code-block:: none sbela sbela and Loralai! Lasbela Lasbela and Loralai! .. GENERATED FROM PYTHON SOURCE LINES 511-516 .. code-block:: default print(a[-1]) # last item in the sequence print(a[-2:]) # last two items in the sequence print(a[:-2]) # whole sequence .. rst-class:: sphx-glr-script-out .. code-block:: none ! i! Lasbela and Lorala .. GENERATED FROM PYTHON SOURCE LINES 517-521 .. code-block:: default print(a[::-1]) # all items in the sequence, reversed print(a[-3::-1]) # starting with the 3rd item from the end, all items in the sequence, reversed .. rst-class:: sphx-glr-script-out .. code-block:: none !ialaroL dna alebsaL alaroL dna alebsaL .. GENERATED FROM PYTHON SOURCE LINES 522-526 Range ====== It gives immutable sequence. We will further study its use later during in :ref:`sphx_glr_auto_examples_basics_for_loops.py`. .. GENERATED FROM PYTHON SOURCE LINES 528-532 .. code-block:: default a = range(4) print(a) .. rst-class:: sphx-glr-script-out .. code-block:: none range(0, 4) .. GENERATED FROM PYTHON SOURCE LINES 533-534 .. code-block:: default print(type(a)) .. rst-class:: sphx-glr-script-out .. code-block:: none .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.018 seconds) .. _sphx_glr_download_auto_examples_basics_sequential_data.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/AtrCheema/python-seekho/master?urlpath=lab/tree/notebooks/auto_examples/basics/sequential_data.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: sequential_data.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: sequential_data.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_