I would like to repeat these example_1 example_2 with my dataset.
import pandas_ml as pdml
df = pdml.ModelFrame({'A': [1, 2, 3], 'B': [2, 3, 4],
'C': [3, 4, 5]}, index=['a', 'b', 'c'])
df
A B C
a 1 2 3
b 2 3 4
c 3 4 5
But, the issue is I have my data set in a csv file.
x_test = pd.read_csv("x_test.csv",sep=';',header=None)
I've tried to convert pandas data frame to dict, but it didn't work.
So, the question is there a way for converting the pandas dataframe into Pandas-Ml ModelFrame?
I think you need DataFrame.to_dict
with parameter orient
:
x_test = pd.read_csv("x_test.csv",sep=';',header=None)
df = pdml.ModelFrame(x_test.to_dict(orient='list'))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With