Converting python lists to pd.DataFrame
<p>If I have 3 python lists items:</p>

<pre><code>list1 = [1,2,3]
list2 = ['a','b','c']
list3 = ['I',"II","III"]
</code></pre>

<p>And my goal is to build a pd.DataFrame using list1 as index and the rest as columns:</p>

<pre><code>     list2    list3
1     "a"     "I"
2     "b"     "II"
3     "c"     "III"
</code></pre>

<p>What would be the most efficient way to do it? Most of the similar questions I found here are joining <em>list of lists</em> or <em>dictionary</em>, but my data only has a simple structure and a natural order, so it should be simpler?</p>

<p>I have checked both <code>pd.Series</code> and <code>pd.DataFrame</code> documentation, but examples are also mostly about joining <code>Series</code> or <code>DataFrame</code> together.</p>

<p>Use the DataFrame constructor:</p>

<pre><code>In [1]: import pandas as pd, numpy as np

In [2]: list1 = [1,2,3]

In [3]: list2 = ['a','b','c']

In [4]: list3 = ['I',"II","III"]

In [5]: pd.DataFrame({'list2':list2,'list3':list3}, index=list1)
Out[5]: 
  list2 list3
1     a     I
2     b    II
3     c   III

In [6]: 
</code></pre>

python pandas