1. import pandas as pd
    2. # list of strings
    3. lst = ['Geeks', 'For', 'Geeks', 'is',
    4. 'portal', 'for', 'Geeks']
    5. # Calling DataFrame constructor on list
    6. df = pd.DataFrame(lst)

    image.png

    1. # import pandas as pd
    2. import pandas as pd
    3. # list of strings
    4. lst = ['Geeks', 'For', 'Geeks', 'is', 'portal', 'for', 'Geeks']
    5. # Calling DataFrame constructor on list
    6. # with indices and columns specified
    7. df = pd.DataFrame(lst, index =['a', 'b', 'c', 'd', 'e', 'f', 'g'],
    8. columns =['Names'])

    image.png

    1. # Creating DataFrame using multi-dimensional list
    2. import pandas as pd
    3. # List1
    4. lst = [['tom', 25], ['krish', 30],
    5. ['nick', 26], ['juli', 22]]
    6. df = pd.DataFrame(lst, columns =['Name', 'Age'])

    image.png

    1. # Using multi-dimensional list with column name and dtype specified.
    2. import pandas as pd
    3. # List1
    4. lst = [['tom', 'reacher', 25], ['krish', 'pete', 30],
    5. ['nick', 'wilson', 26], ['juli', 'williams', 22]]
    6. df = pd.DataFrame(lst, columns =['FName', 'LName', 'Age'], dtype = float)