Я пытаюсь построить гистограмму PLot путем интеграции matplotlib с Pyspark.Я получаю ошибку - PullRequest
1 голос
/ 29 сентября 2019

Я пытаюсь построить гистограмму, используя matplotlib в pyspark, я получаю ошибку.

import matplotlib.pyplot as plt
%matplotlib inline
x_labels = violationcode_freq['Violation Code'].values
fig = violationcode_freq[['count']].plot(kind='bar', facecolor='lightblue')
fig.set_xticklabels(x_labels)
fig.set_title('Counts of trips by passenger count')
fig.set_xlabel('Passenger count in trips')
fig.set_ylabel('Trip counts')
plt.show()
Error : 

TypeError                                 Traceback (most recent call last)
<ipython-input-22-19a8720dda44> in <module>()
      1 import matplotlib.pyplot as plt
      2 get_ipython().run_line_magic('matplotlib', 'inline')
----> 3 x_labels = violationcode_freq['Violation Code'].values
      4 fig = violationcode_freq[['count']].plot(kind='bar', facecolor='lightblue')
      5 fig.set_xticklabels(x_labels)

TypeError: 'NoneType' object is not subscriptable
...