I'm able to get the data from here in DataFrame. When I'm converting the DataFrame into SFrame using graphlab then this error is showing:
TypeError: A common type cannot be infered from types float, string.
My Code is
import graphlab
import pandas as pd
import numpy as np
import matplotlib.pyplot as pt
from numpy import array
from graphlab import SFrame
user_columns =['No','User id','User Name','Skill','Given Test Name','Given Test ID','Recommend Test','Recommend Test ID','Time Start','Time End','Score','Max Score']
data=pd.read_table('http://tech4partner.com.cp-in-5.webhostbox.net/recommend_test.php', sep='^',header=None,names = user_columns)
df2 = data.ix[2:]
df3=df2.reset_index()
df4=df3.drop('index', axis=1)
df5=df4.drop(df4.index[len(df4)-1])
df5=df5.reset_index(1,[len(df5)-1])
df7 = df5.reset_index()
df8=df7.drop('index', axis=1)
df9=df8.head(len(df8))
df9.index = np.arange(1, len(df9) + 1)
df9=df9.head(50)
df9
Data is showing in DataFrame at this line..When I convert the DataFrame into Sframe, It gives error.
DataFrame converts into SFrame using .Sframe() method
t_data = graphlab.SFrame(df9)
t_data
and according to me Data is in well format or may be not. And also I tried two solution but it didn't work for me.
1) I checked every column but no column has different data type.
2) I converted every column in a specific data type using
df.column_name.astype(str)
and df['column_name']= df[coulmn_name].astype(str)
but it didn't work any more.
TypeError Traceback (most recent call last)
<ipython-input-11-c852cd1e7f45> in <module>()
----> 1 t_data = graphlab.SFrame(df9)
2 t_data
3
C:\Anaconda2\lib\site-packages\graphlab\data_structures\sframe.pyc in __init__(self, data, format, _proxy)
951 pass
952 else:
--> 953 raise ValueError('Unknown input type: ' + format)
954
955 sframe_size = -1
C:\Anaconda2\lib\site-packages\graphlab\cython\context.pyc in __exit__(self, exc_type, exc_value, traceback)
47 if not self.show_cython_trace:
48 # To hide cython trace, we re-raise from here
---> 49 raise exc_type(exc_value)
50 else:
51 # To show the full trace, we do nothing and let exception propagate
**TypeError: A common type cannot be infered from types float, string.**
How can I convert this DataFrame into SFrame?