0
If the comparison is to see the number of occurrences of each type, Acidente
and Incidente
, and plot a bar graph, it is possible to use the function hist of the pandas themselves:
df['Investigation Type'].hist()
But I particularly find the matplotlib graph more beautiful:
import matplotlib.pyplot as plt
x = df['Investigation_Type'].unique() #['Acidente', 'Incidente']
# Também é possível pegar valores específicos fazendo: x = ['Acidente', 'Incidente']
y = [df['Investigation_Type'].value_counts()[key] for key in x]
plt.bar(x, y)
I did not understand the question. What comparison would you like to make? Count the occurrences of
Acidente
andIncidente
?– AlexCiuffa