Creating a data frame using List in pandas
First we want to create a list. Next we want to convert the list into dataframe by using pd.dataframe in the pandas concepts for that we want to import the pandas.
Example-1
import pandas as pd l = [ "Welcome", "to", "mycrazycoding"] n = pd.DataFrame(l) print(n)
Output
0 0 Welcome 1 to 2 mycrazycoding
Example-2
import pandas as pd l = [ "I", "Love", "mycrazycoding"] n = pd.DataFrame(l) print(n)
Output
0 0 I 1 Love 2 mycrazycoding