Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to calculate the upper and lower limits of box diagram by Python

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

In this article Xiaobian for you to introduce in detail "Python how to achieve the upper and lower limits of the box chart calculation", the content is detailed, the steps are clear, the details are handled properly, I hope that this "Python how to achieve the upper and lower limits of the box chart calculation" article can help you solve your doubts, the following slowly deepen with the editor's ideas, together to learn new knowledge.

The code implementation of Python:

There are four parameters to be passed in this implementation:

(1), the path to the indicators_path:excel file

(2) the name of the corresponding sheet under the path of the sheet_name:excel file

(3), all_data_list: data list, which is equivalent to list in Python

(4), single element in singal_data:all_data_list

The following are a large number of datasets in excel:

Line3-6: read each column of data in the excel table and convert it to an list collection

Line7: deletes the value of the last row of each column in the excel

Line9-10: determines that if the value of a column is exactly the same, a fixed string is assigned for the caller to use when judging

Line12: reverses all data in list and sorts them from smallest to largest

Line13-17: the goal is to put all the data except "nan" in the list into another list

Line20-24: using the numpy function to calculate the values of 1/4 and 3/4 quantiles in the box chart

Line25-30: using the formula mentioned above to calculate the values of the upper and lower edges in the box diagram is also the ultimate goal of this method.

When calling the function, the caller only needs to pass in the corresponding parameters according to the rules and get the upper and lower edge values returned by the method to judge the interval of the data returned on the page.

After reading this, the article "how to calculate the upper and lower limits of Python box chart" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report