Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
276 views
in Technique[技术] by (71.8m points)

python - Limit the range of values displayed in my graph by adding a maximum and minium limit for the values

I am looking for a simple solution for what i think is a simple problem.

I have this dataframe, and i wish to plot graph to determine if there is any correlation between number of violations a committed and a zipcode. So in my dataframe I have a column for violations and a column for zipcode.

The issue is, there are 285 zipcodes, with a big range between them, from 1 being the lowest and 2092 being the highest. I have opted to plot these into a scatter graph, but the graph does not look neat. So I am asking if there is a way for me to limit the axis of the graph or somehow group the zipcodes in a way that will still reflect if there is a correlation between zipcodes and violations.

    Zip Codes_y Violations
12  3224.0  1
39  4015.0  1
261 25730.0 1
43  4026.0  2
38  4012.0  2
... ... ...
150 23076.0 1598
79  9329.0  1701
147 22728.0 1740
163 23446.0 1902
179 23676.0 2092

GroupZip.plot.scatter(x='Zip Codes_y',
                      y='Violations',
                     )


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...