Pandas dataframe is a very useful data structure.
In this notebook, I will show with examples how to convert Python List to Pandas Dataframe.
In [2]:
import pandas as pd
Let us create a dummy list of stock symbols.
In [49]:
stocks = ['AMC', 'GME', 'BB', 'CLOV', 'PLTR']
Creating Dataframe from list can be achieved using pandas.DataFrame.
In [32]:
df = pd.DataFrame(stocks,columns=['ticker'])
Let us look at our dataframe now.
In [33]:
df.head()
Out[33]:
ticker | |
---|---|
0 | AMC |
1 | GME |
from Planet SciPy
read more
No comments:
Post a Comment