I want to create a python pandas DataFrame with one row to use additional pandas functions like dumping to * .csv.
I saw that the following code is used, but I only get the column structure, but empty data
import pandas as pd df = pd.DataFrame() df['A'] = 1 df['B'] = 1.23 df['C'] = "Hello" df.columns = [['A','B','C']] print df Empty DataFrame Columns: [A, B, C] Index: []
As long as I know that there are other ways to do this (for example, from a dictionary), I want to understand why this piece of code does not work for me !? Is this a problem with the version? (using pandas == 0.19.2)
source share