Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Issue Pandas TypeError: no numeric data to plot

# import pandas library
import pandas as pd
import matplotlib.pyplot as plt

# create pandas DataFrame
df = pd.DataFrame({'team': ['India', 'South Africa', 'New Zealand', 'England'],
                   'points': ['10', '8', '3', '5'],
                   'runrate': ['0.5', '1.4', '2', '-0.6'],
                   'wins': ['5', '4', '2', '2']})

# print the data frame
print(df)
df[['points', 'runrate', 'wins']].plot()
plt.show()
Source by itsmycode.com #
 
PREVIOUS NEXT
Tagged: #Issue #Pandas #numeric #data #plot
ADD COMMENT
Topic
Name
4+3 =