Home > other >  Consult a great god! Why will divide the python drawing axis label order
Consult a great god! Why will divide the python drawing axis label order

Time:09-19

 flights=pd. Read_csv (" flights. CSV ") 
Flights=flights. The pivot (" month ", "year", "passengers")
Ax=SNS. Heatmap (flights, annot=True, FMT="d", linewidths.=5)
PLT. The show ()


River's lake emergency! Why will divide map out in order?


CodePudding user response:

Flights. The index=pd. CategoricalIndex (flights. The index, categories=[" January ", "February", "March", "research", "May", "June", 'out', 'August', 'September', 'October, November,' another awarding '])

Flights. Sort_index (level=0, inplace=True)

Before drawing, combined with the above two sentences, custom order index, you try

CodePudding user response:

Taught by the great god, really effective ,,, I also want to ask, in addition to the custom index: are there any other way? I watch video class directly is sorted by December 1, but I was disorderly, is a version of the problem? Or other reason

CodePudding user response:

Your video class, isn't it directly from the SNS down load data?
I tried down here, through the excel to upload data, make like your figure, sorting is chaotic, but SNS load down is normal

CodePudding user response:

I direct the load down complains, so read data


  • Related