Python Forum
insert into python DF by position - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/Forum-Python-Coding)
+--- Forum: Data Science (https://python-forum.io/Forum-Data-Science)
+--- Thread: insert into python DF by position (/Thread-insert-into-python-DF-by-position)



insert into python DF by position - Johnse - Sep-09-2019

Hello,

Can someone show me example on how to insert values store in variable into python data frame by position ?

Thank you


RE: insert into python DF by position - perfringo - Sep-11-2019

There is lot of ambiguity in this question. However, simple example how to 'insert' sequence elements into dataframe:

>>> import pandas as pd
>>> letters = ['a', 'b', 'c']
>>> df = pd.DataFrame({'chars': letters})
>>> df
    chars
0	    a
1	    b
2	    c