I just started to code with Python.
I am doing some analysis on a database of papers extracted from the Scopus database. I downloaded the database in .csv and then performed some analyses and filtering on it. After the initial analyses I saved the file in .xlsx which is the current format of the database.
I am trying to obtain a graph showing how many times a journal is present in the database.
I have extracted the values using the value_counts()
command and then I have stored these data into a table with two columns (Journal
and Count
):
journals_count = data['Source_title'].value_counts().reset_index()
journals_count.columns = ['Journal', 'Count']
Journal Count
0 IEEE Transactions on Industrial Informatics 40
1 Expert Systems with Applications 37
2 Applied Energy 20
3 International Journal of Production Economics 13
4 Energy and Buildings 11
5 Information Sciences 11
6 International Journal of Information Management 10
7 Decision Support Systems 9
8 International Journal of Advanced Manufacturing 9
9 International Journal of Production Research 8
10 European Journal of Operational Research 7
Now I would like to create a bar chart from this table with the Journal
name on the x-axis and the Count
value on the y-axis using the following code:
import matplotlib.pyplot as plt
%matplotlib inline
plt.plot(journals_count['Journal'], journals_count['Count'])
The problem is that I obtain the following error:
ValueError: could not convert string to float: 'Service Industries Journal'
'Service Industries Journal'
is the last journal with the Count
value equal to 1.
How could I plot this into Python?