交互式和非交互式_發布交互式劇情

交互式和非交互式

Python中的Visual EDA (Visual EDA in Python)

I like to learn about different tools and technologies that are available to accomplish a task. When I decided to explore data regarding COVID-19 (Coronavirus), I knew that I would want the ability to present visualizations interactively. After all, the Coronavirus pandemic is tracked, monitored, and reported daily, from all over the world. Data science and analysis projects that involve temporal data lend themselves well to interactive plotting and timeline animation.

我喜歡學習可用于完成任務的不同工具和技術。 當我決定探索有關COVID-19(冠狀病毒)的數據時,我知道我希望能夠以交互方式呈現可視化效果。 畢竟,每天跟蹤,監視和報告來自世界各地的冠狀病毒大流行。 涉及時間數據的數據科學和分析項目非常適合交互式繪圖和時間線動畫。

To support the desired interactive capabilities, notebooks for this project were composed in Deepnote, an online, Jupyter-style environment that enables the publishing of complete Python notebooks that retain interactive outputs. The Plotly Express library was used to produce interactive plot objects. Finally, the embedding of those individual visualizations in this article is made possible by the Datapane library for Python.

為了支持所需的交互功能,該項目的筆記本由Deepnote (一種在線Jupyter風格的環境)組成,可以發布保留交互輸出的完整Python筆記本。 Plotly Express庫用于生成交互式繪圖對象。 最后,通過Python的Datapane庫,可以在本文中嵌入這些單獨的可視化文件。

This article presents a brief overview of the project, including the following.

本文簡要介紹了該項目,包括以下內容。

  • Motivations for the project

    項目動機
  • Methods of investigation

    調查方法
  • Summary highlights and representative, interactive plots

    摘要亮點和代表性的互動情節

Note: While this article includes interactive examples of cell outputs from project notebooks, we will not be demonstrating any code. You can, however, find links to the related repository on Github, linked below.

注意:雖然本文包括項目筆記本中單元輸出的交互式示例,但我們不會演示任何代碼。 不過,您可以在Github上找到指向相關存儲庫的鏈接,如下所示。

概述和動機 (Overview and Motivation)

Effective July 1, 2020, the state of Virginia entered the third phase of the “Forward Virginia” plan to gradually ease restrictions in place for COVID-19. On July 28, additional restrictions were imposed on restaurants and bars in the Hampton Roads area of Southeastern Virginia (Schneider, Gregory S., Virginia governor adds restrictions in Hampton Roads region after surge in coronavirus cases (July 28, 2020). The Washington Post.).

從2020年7月1日起,弗吉尼亞州進入“ Forward Virginia”計劃的第三階段,以逐步放寬對COVID-19的限制。 7月28日,對東南弗吉尼亞州漢普頓路地區的餐館和酒吧施加了額外的限制( 弗吉尼亞州州長施奈德,格雷戈里S. 在冠狀病毒病例激增之后 (2020年7月28日) 在漢普頓路地區增加了限制 。 )。

This project is inspired in part by a subsequent interest in comparing the severity of later outbreaks, in the Hampton Roads region, with the number and proportion of cases in other areas of the state. In other words, in areas where cases, hospitalizations, or deaths were decreasing, were they higher or lower than in lately restricted areas?

該項目的部分靈感來自于后來的興趣,即比較漢普頓路地區后來爆發的嚴重程度與該州其他地區的病例數量和比例。 換句話說,在病例,住院或死亡人數減少的地區,它們比最近限制的地區高還是低?

Of course, the goal of the project was not to perform a full, medical study. Along with comparing aggregated case data for various localities, the project was strongly motivated by an interest in exploring the options we employ to publish relatively simple-but-informative, animated plots.

當然,該項目的目標不是進行完整的醫學研究。 除了比較各個地區的匯總案例數據外,該項目還受到了對探索我們用來發布相對簡單但內容豐富的動畫情節的選擇的興趣的強烈推動。

Static map of the United States, with white borders and the state of Virginia filled in red.
Highlighting the state of Virginia. All images by the author, unless otherwise indicated.
突出弗吉尼亞州。 除非另有說明,否則所有圖片均由作者提供。

數據集 (The Datasets)

Coronavirus data for this exploration is sourced from the Virginia Department of Health (VDH). The particular copy of the Virginia public COVID-19 cases dataset used in this repository was last updated on July 30, 2020. VDH is itself a robust source of data and visualizations related to this health crisis. Their dataset continues to be updated regularly.

此次勘探的冠狀病毒數據來自弗吉尼亞衛生署 (VDH)。 此存儲庫中使用的弗吉尼亞州公共COVID-19病例數據集的特定副本最近一次更新是在2020年7月30日。VDH本身是與該健康危機相關的數據和可視化的可靠來源。 他們的數據集將繼續定期更新。

Each row in the dataset represents the overall count of COVID-19 cases, hospitalizations, and deaths for each locality in Virginia by report date since reporting began.

自報告開始以來,按報告日期,數據集中的每一行代表弗吉尼亞州每個地區的COVID-19病例,住院和死亡總數。

As we progress through the project, we bring in population data for additional context and insight.

隨著項目的進展,我們會引入人口數據以獲取更多背景信息和見解。

Population estimates data was sourced from the University of Virginia’s Weldon Cooper Center for Public Service Demographics Research Group, published on January 27, 2020. The group notes that estimates are population approximations “based on a variety of observed administrative record data, such as births, deaths, school enrollment, and residential housing construction.” The above-linked site happens to include a handy, interactive map that highlights a relevant row of population data as the cursor moves over the relevant locality segment.

人口估算數據來自弗吉尼亞大學韋爾頓·庫珀公共服務人口統計研究中心,該研究組于2020年1月27日發布。該組指出,估算值是“基于各種觀察到的行政記錄數據(例如出生,死亡,入學率和住宅建設。” 上面鏈接的站點碰巧包括一個方便的交互式地圖,當光標移到相關位置區域上時,該地圖突出顯示了相關的人口數據行。

方法 (Methods)

To gauge how the Hampton Roads numbers compare to other areas of Virginia, such as the state’s capital city of Richmond, this study primarily investigates data using interactive plotting. This approach enables visualization of data for multiple localities on a single figure, with the option to hover a cursor over the plot for detail.

為了評估漢普頓公路的數量與弗吉尼亞州其他地區(例如該州的首府里士滿)的比較,該研究主要使用交互式繪圖調查數據。 這種方法可以在單個圖形上可視化多個位置的數據,并可以選擇將光標懸停在圖形上以獲取詳細信息。

Static horizontal-bar plot of hospitalizations, by locality. The first bar, for Fairfax, represents the highest count.
Static horizontal-bar plat of Coronavirus related hospitalizations, by locality.
冠狀病毒相關住院的靜態單杠圖,按地區劃分。

The covered time period spans between two-and-four months. We include a few static plots, for the ten localities with the highest reported numbers in each statistical area; but expecting readers to take-in multiple measures for multiple areas over 60–120 days, using only static plots, seemed like an unrealistic ask. Using interactive plots will help viewers quickly understand how the data changes over time or easily isolate features of the dataset at a particular point, within the context of a broader time frame.

涵蓋的時間跨度為兩到四個月。 對于每個統計區域中報告的數字最高的十個地區,我們包括一些靜態圖; 但是,希望讀者在60-120天之內僅使用靜態圖表,對多個區域采取多種措施,似乎是不切實際的要求。 使用交互式繪圖將幫助查看者快速了解數據隨時間的變化,或在較寬的時間范圍內輕松隔離特定點的數據集特征。

The project is not a predictive analysis. Instead, it serves a comparative purpose for a limited subset of relevant data. Of course, it is topical, as we move into the 2020–2021 school year and take into account the precautions required for a safe and effective educational environment.

該項目不是預測分析。 相反,它僅對相關數據的有限子集起到比較作用。 當然,這是熱門話題,因為我們進入2020-2021學年,并考慮到安全有效的教育環境所需的預防措施。

觀察結果 (Observations)

Interactive line-plot for all localities. Hover over the plot to view data relevant to each line.
適用于所有地區的交互式線圖。 將鼠標懸停在圖上可以查看與每條線相關的數據。

Let’s review some of our project discoveries:

讓我們回顧一下我們的一些項目發現:

  • Cases in some Northern Virginia localities exceeded those in Southeastern Virginia localities, many times over. The Fairfax locality, to the west of Washington, D.C., exceeds Southeastern Virginia localities in total cases, hospitalizations, and deaths throughout our timeframe. Total hospitalizations in Fairfax between the middle of March and the end of July 2020, number 138,320. Chesapeake’s total for the same period is 11,378.

    北弗吉尼亞州某些地區的病例數比維吉尼亞州東南部地區的病例數高出許多倍。 在整個時間范圍內,華盛頓特區以西的費爾法克斯地區在總病例,住院和死亡人數方面均超過弗吉尼亞東南地區。 截至3月中旬至2020年7月底,費爾法克斯的住院總人數為138,320。 切薩皮克在同一時期的總數為11,378。
A dataframe subset, showing the last rows for select localities, from the Virginia public COVID-19 cases dataset.
Last rows of a Pandas dataframe, filtered for select localities, from Virginia public COVID-19 cases dataset.
來自弗吉尼亞州公共COVID-19案例數據集的按特定地點過濾的熊貓數據框的最后幾行。
  • For a more balanced comparison, we narrow our broad, preliminary view to focus on the state capital of Richmond as it compares to select independent cities and counties of the Hampton Roads region.

    為了更平衡地進行比較,我們將廣義的初步觀點縮小為集中在里士滿州首府,因為它與漢普頓路地區的選定獨立城市和縣進行了比較。
Static image of a control for a plot animation, with ticks at the bottom, indicating the period between May 1 and July 24.
Image of a timeline control for an animated plot.
動畫情節的時間軸控件的圖像。

Note: Each of the following plot animations may be played by selecting the triangle at the start of the timeline.

注意:可以通過選擇時間軸開始處的三角形來播放以下每個情節動畫

Interactive bar-plot for select localities. Plot animation covers the period from March 17 through July 30, 2020.
交互式條形圖,用于選擇地區。 劇情動畫涵蓋了從2020年3月17日到2020年7月30日的時間段。
  • Among the localities of interest, Richmond led in total cases from March through July, when it then was surpassed by Norfolk and Virginia Beach.

    在感興趣的地區中,從3月到7月,里士滿(Richmond)領導著所有案件,隨后被諾福克(Norfolk)和弗吉尼亞海灘(Virginia Beach)超越。
Interactive scatter-plot for select localities, from May through July. The total number of cases is represented by data-point size.
特定地區的交互式散點圖,從五月到七月。 案例總數由數據點大小表示。
  • An animated plot highlights that Richmond presented a greater number of hospitalizations due to Coronavirus, even as Virginia Beach eventually surpassed it for related cases and deaths.

    動畫情節突出顯示,即使弗吉尼亞海灘因相關病例和死亡最終超過了里希蒙,也由于冠狀病毒而使里士滿住院的人數增加了。
Scatter-plot animation for select localities, illustrating statistics per 1,000 of the population for each represented locality.
選定地點的散點圖動畫,說明每個代表地點的每1,000人口統計數據。
  • Similarly, Richmond reports a larger proportion of hospitalization and mortality per 1,000 of the population than each of the other localities, by the end of our timeline.

    同樣,到我們的時間表結束時,里士滿報告的每千人中住院和死亡率的比例高于其他每個地方。

演練之前的后退 (A Step Back Before the Walkthrough)

We will break here.

我們將在這里休息。

This article previewed our process for working with Pandas datasets in Deepnote’s online, interactive notebook environment. We also explored using Plotly and Datapane, to create interactive plots that we were then able to embed in this article.

本文預覽了我們在Deepnote的在線交互式筆記本環境中使用Pandas數據集的過程。 我們還探索了如何使用Plotly和Datapane創建交互式圖,然后將其嵌入到本文中。

In addition to interactive deployment, the full project benefits from the following:

除了交互式部署,整個項目還可以從以下方面受益:

  • The merging of multiple data sources into Pandas dataframes

    將多個數據源合并到Pandas數據框中
  • Transformation of raw data, for comparison as a proportion of the population

    轉換原始數據,以便在總人口中進行比較
  • The ability to be time-scaled and to limit or expand location scope

    具有時間縮放能力以及限制或擴展位置范圍的能力

Though we avoided the use of interactive choropleth maps in this project, Plotly offers significant potential for including additional, geospatial analysis using state-or-county-level maps, lat./lon. coordinates, and/or geoJSON data

盡管在該項目中我們避免使用交互式的弧??度圖,但Plotly 具有很大的潛力 ,可以使用州/縣級地圖(緯度/經度)進行其他地理空間分析。 坐標和/或geoJSON數據

You can follow me, here, to be notified when I publish new articles. In the meantime, you can find code and links to interactive notebooks available on my Github repository.

您可以在這里關注我,以便在我發表新文章時得到通知。 同時,您可以在我的Github 存儲庫中找到代碼和指向交互式筆記本的鏈接。

翻譯自: https://medium.com/the-innovation/publishing-interactive-plots-86a637c9fb74

交互式和非交互式

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/389969.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/389969.shtml
英文地址,請注明出處:http://en.pswp.cn/news/389969.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

5886. 如果相鄰兩個顏色均相同則刪除當前顏色

5886. 如果相鄰兩個顏色均相同則刪除當前顏色 總共有 n 個顏色片段排成一列,每個顏色片段要么是 ‘A’ 要么是 ‘B’ 。給你一個長度為 n 的字符串 colors ,其中 colors[i] 表示第 i 個顏色片段的顏色。 Alice 和 Bob 在玩一個游戲,他們 輪…

Sunisoft.IrisSkin.SkinEngine 設置winform皮膚

Sunisoft.IrisSkin.SkinEngine se; se new Sunisoft.IrisSkin.SkinEngine { SkinAllForm true, SkinFile "..\..\skin\EmeraldColor2.ssk" };Sunisoft.IrisSkin.SkinEngine skin new Sunisoft.IrisSkin.SkinEngine(); //具體樣式文件 地址,可以自行修…

docker 相關操作

docker-compose down //關閉所有容器 docker-compose up //開啟所有容器docker-compose restart //重啟所有容器單獨更新某個容器時用腳本$ docker ps // 查看所有正在運行容器 $ docker stop containerId // containerId 是容器的ID$ docker ps -a // 查看所有容器 $…

電子表格轉換成數據庫_創建數據庫,將電子表格轉換為關系數據庫,第1部分...

電子表格轉換成數據庫Part 1: Creating an Entity Relational Diagram (ERD)第1部分:創建實體關系圖(ERD) A Relational Database Management System (RDMS) is a program that allows us to create, update, and manage a relational database. Structured Query …

【Vue.js學習】生命周期及數據綁定

一、生命后期 官網的圖片說明: Vue的生命周期總結 var app new Vue({el:"#app", beforeCreate: function(){console.log(1-beforeCreate 初始化之前);//加載loading},created: function(){console.log(2-created 創建完成);//關閉loading},be…

5885. 使每位學生都有座位的最少移動次數

5885. 使每位學生都有座位的最少移動次數 一個房間里有 n 個座位和 n 名學生,房間用一個數軸表示。給你一個長度為 n 的數組 seats ,其中 seats[i] 是第 i 個座位的位置。同時給你一個長度為 n 的數組 students ,其中 students[j] 是第 j 位…

Springboot(2.0.0.RELEASE)+spark(2.1.0)框架整合到jar包成功發布(原創)!!!

一、前言 首先說明一下,這個框架的整合可能對大神來說十分容易,但是對我來說十分不易,踩了不少坑。雖然整合的時間不長,但是值得來紀念下!!!我個人開發工具比較喜歡IDEA,創建的sprin…

求一個張量的梯度_張量流中離散策略梯度的最小工作示例2 0

求一個張量的梯度Training discrete actor networks with TensorFlow 2.0 is easy once you know how to do it, but also rather different from implementations in TensorFlow 1.0. As the 2.0 version was only released in September 2019, most examples that circulate …

docker環境 快速使用elasticsearch-head插件

docker環境 快速使用elasticsearch-head插件 #elasticsearch配置 #進入elk容器 docker exec -it elk /bin/bash #head插件訪問配置 echo #head插件訪問# http.cors.enabled: true http.cors.allow-origin: "*" >>/etc/elasticsearch/elasticsearch.yml#重啟el…

476. 數字的補數

476. 數字的補數 給你一個 正 整數 num ,輸出它的補數。補數是對該數的二進制表示取反。 例 1:輸入:num 5 輸出:2 解釋:5 的二進制表示為 101(沒有前導零位),其補數為 010。所以你…

zabbix網絡發現主機

1 功能介紹 默認情況下,當我在主機上安裝agent,然后要在server上手動添加主機并連接到模板,加入一個主機組。 如果有很多主機,并且經常變動,手動操作就很麻煩。 網絡發現就是主機上安裝了agent,然后server自…

python股市_如何使用python和破折號創建儀表板來主導股市

python股市始終關注大局 (Keep Your Eyes on the Big Picture) I’ve been fascinated with the stock market since I was a little kid. There is certainly no shortage of data to analyze, and if you find an edge you can make some easy money. To stay on top of the …

阿里巴巴開源 Sentinel,進一步完善 Dubbo 生態

為什么80%的碼農都做不了架構師?>>> 阿里巴巴開源 Sentinel,進一步完善 Dubbo 生態 Sentinel 開源地址:https://github.com/alibaba/Sentinel 轉載于:https://my.oschina.net/dyyweb/blog/1925839

數據結構與算法 —— 鏈表linked list(01)

鏈表(維基百科) 鏈表(Linked list)是一種常見的基礎數據結構,是一種線性表,但是并不會按線性的順序存儲數據,而是在每一個節點里存到下一個節點的指針(Pointer)。由于不必須按順序存儲,鏈表在插入的時候可以…

離群值如何處理_有理處理離群值的局限性

離群值如何處理ARIMA models can be quite adept when it comes to modelling the overall trend of a series along with seasonal patterns.ARIMA模型可以很好地建模一系列總體趨勢以及季節性模式。 In a previous article titled SARIMA: Forecasting Seasonal Data with P…

網絡爬蟲基礎練習

0.可以新建一個用于練習的html文件,在瀏覽器中打開。 1.利用requests.get(url)獲取網頁頁面的html文件 import requests newsurlhttp://news.gzcc.cn/html/xiaoyuanxinwen/ res requests.get(newsurl) #返回response對象 res.encodingutf-8 2.利用BeautifulSoup的H…

10生活便捷:購物、美食、看病時這樣搜,至少能省一半心

本次課程介紹實實在在能夠救命、省錢的網站,解決了眼前這些需求后,還有“詩和遠方”——不花錢也能點亮自己的生活,獲得美的享受! 1、健康醫療這么搜,安全又便捷 現在的醫療市場確實有些混亂,由于醫療的專業…

ppt圖表圖表類型起始_梅科圖表

ppt圖表圖表類型起始There are different types of variable width bar charts but two are the most popular: 1) Bar Mekko chart; 2) Marimekko chart.可變寬度條形圖有不同類型,但最受歡迎的有兩種:1)Mekko條形圖; 2)Marimekko圖表。 Th…

Tomcat日志亂碼了怎么處理?

【前言】 tomacat日志有三個地方,分別是Output(控制臺)、Tomcat Localhost Log(tomcat本地日志)、Tomcat Catalina Log。 啟動日志和大部分報錯日志、普通日志都在output打印;有些錯誤日志,在Tomcat Localhost Log。 三個日志顯示區,都可能…

python 編碼規范

縮進 用4個空格來縮進代碼 分號 不要在行尾加分號, 也不要用分號將兩條命令放在同一行。 行長度 每行不超過80個字符 以下情況除外: l 長的導入模塊語句 l 注釋里的URL 不要使用反斜杠連接行。 Python會將 圓括號, 中括號和花括號中的行隱式的連接起來 , 你可以利用…