I would like to create a dataframe without reading it from CSV.
For example, I would like to create the columns and one record. Please assume something like this:
Feature1 Feature 2 Feature 3 ... Feature n
1 20 False 3.2 True
I build a classifier and I would like to make prediction: classifier.predict(dataframe)
I received the record as string with "," between the features. I used split for extracting list of features:
record_features = "16,713,Danny, ..."
features = record_features.split(',')
After that I convert the list into series:
series = pd.Series(features)
And after that I would like to create a dataframe: column_names = ['feature1', 'feature2', ..., 'feature102']
df = pd.DataFrame(series, columns=column_names)
I got an error:
ValueError: Shape of passed values is (1, 102), indices imply (102, 102)
I have really 102 features and I would like to create a dataframe with columns and one record
Any suggestions?