Need to plot a comparision graph to check which is better between model 2 and model3.
source is data is extracted from json file to macros excel file using power query.
I am getting error TypeError: no numeric data to plot
this is the details of df
df1.info()
out:<class 'pandas.core.frame.DataFrame'>
RangeIndex: 7513 entries, 0 to 7512
Data columns (total 4 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Name 7513 non-null object
1 Model2 7513 non-null object
2 Model3 7513 non-null object
3 Manual 7513 non-null object
dtypes: object(4)
memory usage: 234.9+ KB
this is the dataframe i want to plot for comparison between model2 with model3
df1
Name Model2 Model3 Manual
1 WH02_Met1 522.8 5228.6 0000.0
2 WH02_Met2 5229 5229 0000.0
3 WH02_Met3 5229.1 5229.1 0000.0
4 WH02_Met4 5229.5 5229.5 0000.0
... ... ... ... ...
7508 WH1_Met5 0000.0 0000.0 2651.4
7509 WH1_Met6 0000.0 0000.0 2651.4
7510 WH1_Met7 0000.0 0000.0 2651.4
7511 WH1_Met8 0000.0 0000.0 2651.4
7512 WH1_Met9 0000.0 0000.0 0000.0
7513 rows × 4 columns
here i checked the type
df1.dtypes
Name object
Model2 object
Model3 object
Manual object
dtype: object
df1.apply(pd.to_numeric, errors='ignore')
df1 = df1.infer_objects()
df1.dtypes
Name object
Model2 object
Model3 object
Manual object
dtype: object
df1[['Model2', 'Model3']] = df1[['Model2', 'Model3']].astype(float)
ValueError: could not convert string to float: 'Model2'