Index must be called with a collection of some kind: assign column name to dataframe

Documentation: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html

columns : Index or array-like

Column labels to use for resulting frame. Will default to np.arange(n) if no column labels are provided

Example:

df3 = DataFrame(np.random.randn(10, 5), columns=[‘a’, ‘b’, ‘c’, ‘d’, ‘e’])

Try to use:

pd.DataFrame(reweightTarget, columns=['t'])

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)