Question

How to create a Pandas DataFrame in Python?


Annonce
Ad

Answer

import pandas as pd
df = pd.DataFrame( { 'col1' : [1., 2., 3.] , 'col2' : [4., 5., 6.] } )
creates:

   col1  col2
0   1.0   4.0
1   2.0   5.0
2   3.0   6.0


[source]
# ID Query