Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 如何绘制分类数据的大型数据集?_Python 3.x_Matplotlib_Seaborn - Fatal编程技术网

Python 3.x 如何绘制分类数据的大型数据集?

Python 3.x 如何绘制分类数据的大型数据集?,python-3.x,matplotlib,seaborn,Python 3.x,Matplotlib,Seaborn,鉴于有超过4119个城市,我如何绘制以下分类数据 print(len(city)) #4119 print(len(customers)) #4119 城市看起来像:[“旧金山”、“伦敦”、“巴黎”] 客户看起来像:[1,2200] 这段代码绝对不能与这么多类别一起运行 # %matplotlib inline # plt.style.use('ggplot') # x_pos = [i for i, _ in enumerate(city)] # plt.bar(x_pos

鉴于有超过4119个城市,我如何绘制以下分类数据

print(len(city))        #4119
print(len(customers))   #4119
城市
看起来像:
[“旧金山”、“伦敦”、“巴黎”]

客户
看起来像:
[1,2200]

这段代码绝对不能与这么多类别一起运行

# %matplotlib inline
# plt.style.use('ggplot')
# x_pos = [i for i, _ in enumerate(city)]
# plt.bar(x_pos, customers, color='green')
# plt.xlabel("City")
# plt.ylabel("Customers #")
# plt.title("Number of customers per city")
# plt.xticks(x_pos, customers)
# plt.show()

city
变量是否仅包含唯一值,或者是否存在重复值?
np.unique(city).size
的结果是什么?
np.unique(city).size
是4119因为你在处理地理数据,也许在地图上绘图更有意义?