kandi background
Explore Kits

COVID19 | web app to display the live graphical state | Dataset library

 by   vinitshahdeo CSS Version: Current License: MIT

 by   vinitshahdeo CSS Version: Current License: MIT

Download this library from

kandi X-RAY | COVID19 Summary

COVID19 is a CSS library typically used in Artificial Intelligence, Dataset applications. COVID19 has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.
A web app to display the live graphical state-wise reported corona cases in India so far. It also shows the latest news for COVID-19. Stay Home, Stay Safe!
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • COVID19 has a low active ecosystem.
  • It has 111 star(s) with 28 fork(s). There are 5 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 6 open issues and 2 have been closed. On average issues are closed in 125 days. There are 3 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of COVID19 is current.
COVID19 Support
Best in #Dataset
Average in #Dataset
COVID19 Support
Best in #Dataset
Average in #Dataset

quality kandi Quality

  • COVID19 has no bugs reported.
COVID19 Quality
Best in #Dataset
Average in #Dataset
COVID19 Quality
Best in #Dataset
Average in #Dataset

securitySecurity

  • COVID19 has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
COVID19 Security
Best in #Dataset
Average in #Dataset
COVID19 Security
Best in #Dataset
Average in #Dataset

license License

  • COVID19 is licensed under the MIT License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
COVID19 License
Best in #Dataset
Average in #Dataset
COVID19 License
Best in #Dataset
Average in #Dataset

buildReuse

  • COVID19 releases are not available. You will need to build from source code and install.
  • Installation instructions are not available. Examples and code snippets are available.
COVID19 Reuse
Best in #Dataset
Average in #Dataset
COVID19 Reuse
Best in #Dataset
Average in #Dataset
Top functions reviewed by kandi - BETA

kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample Here

Get all kandi verified functions for this library.

Get all kandi verified functions for this library.

COVID19 Key Features

A web app to display the live graphical state-wise reported corona cases in India so far. It also shows the latest news for COVID-19. Stay Home, Stay Safe!

Do checkout latest

copy iconCopydownload iconDownload
╔═╗╔╦╗╔═╗╦ ╦  ╦ ╦╔═╗╔╦╗╔═╗
╚═╗ ║ ╠═╣╚╦╝  ╠═╣║ ║║║║║╣ 
╚═╝ ╩ ╩ ╩ ╩   ╩ ╩╚═╝╩ ╩╚═╝
╔═╗╔╦╗╔═╗╦ ╦  ╔═╗╔═╗╔═╗╔═╗
╚═╗ ║ ╠═╣╚╦╝  ╚═╗╠═╣╠╣ ║╣ 
╚═╝ ╩ ╩ ╩ ╩   ╚═╝╩ ╩╚  ╚═╝

Featured on Newspaper

copy iconCopydownload iconDownload
/**
 * 
 * Let's fight for Corona together!
 */
function stayAtHome() {
  eat();
  sleep();
  code();
  repeat();
}

while(_.isAlive(new Virus('COVID-19'))) {
  // Stay home, Stay safe
  stayAtHome();
}

< /> with ♡ by

copy iconCopydownload iconDownload

if (_.isAwesome(thisRepo)) {
  thisRepo.star(); // thanks in advance :p
}

Train test split mysql records into views

copy iconCopydownload iconDownload
CREATE VIEW training_data
AS
WITH cte AS ( SELECT Posts.post_content as post_content,
                     CASE WHEN Posts.post_title like '%covid%corona%covid19%'
                          THEN 1
                          WHEN Posts.post_content like '%covid%corona%covid19%' 
                          THEN 1 
                          ELSE 0 END AS tag,
                     ROW_NUMBER() OVER (ORDER BY id) rn
              FROM Posts )
SELECT post_content, tag
FROM cte
WHERE rn MOD 10 IN (0,1,3,4,6,7,9);
CREATE VIEW test_data
AS
WITH cte AS ( SELECT Posts.post_content as post_content,
                     CASE WHEN Posts.post_title like '%covid%corona%covid19%'
                          THEN 1
                          WHEN Posts.post_content like '%covid%corona%covid19%' 
                          THEN 1 
                          ELSE 0 END AS tag,
                     ROW_NUMBER() OVER (ORDER BY id) rn
              FROM Posts )
SELECT post_content, tag
FROM cte
WHERE rn MOD 10 IN (2,5,8);
CREATE VIEW training_data
AS
WITH cte AS ( SELECT Posts.post_content as post_content,
                     CASE WHEN Posts.post_title like '%covid%corona%covid19%'
                          THEN 1
                          WHEN Posts.post_content like '%covid%corona%covid19%' 
                          THEN 1 
                          ELSE 0 END AS tag,
                     ROW_NUMBER() OVER (ORDER BY id) rn
              FROM Posts )
SELECT post_content, tag
FROM cte
WHERE rn MOD 10 IN (0,1,3,4,6,7,9);
CREATE VIEW test_data
AS
WITH cte AS ( SELECT Posts.post_content as post_content,
                     CASE WHEN Posts.post_title like '%covid%corona%covid19%'
                          THEN 1
                          WHEN Posts.post_content like '%covid%corona%covid19%' 
                          THEN 1 
                          ELSE 0 END AS tag,
                     ROW_NUMBER() OVER (ORDER BY id) rn
              FROM Posts )
SELECT post_content, tag
FROM cte
WHERE rn MOD 10 IN (2,5,8);

R - The cumulative number of cases by days since confirmed cases

copy iconCopydownload iconDownload
confirmed_COVID_data <- COVID_data %>% 
  filter(countriesAndTerritories %in% ten_countries) %>%
  filter(cases >0) %>% 
  mutate(dateRep = as.Date(dateRep, '%d/%m/%Y')) %>%
  group_by(countriesAndTerritories) %>%
  arrange(dateRep) %>%
  mutate(cum_cases = cumsum(cases)) %>%
  filter(cum_cases >= 100000) %>% 
  group_by(countriesAndTerritories) %>% 
  mutate(cumulative_days = row_number())
# Groups:   countriesAndTerritories [6]
  dateRep      day month  year   cases deaths countriesAndTerritor~ geoId countryterritoryC~ popData2020 continentExp cum_cases cumulative_days
  <date>     <int> <int> <int>   <int>  <int> <chr>                 <chr> <chr>                    <int> <chr>            <int>           <int>
1 2021-03-01     1     3  2021  456112   8414 Austria               AT    AUT                    8901064 Europe          456112               1
2 2021-03-01     1     3  2021  779096  22278 Belgium               BE    BEL                   11522440 Europe          779096               1
3 2021-03-01     1     3  2021  247038  10191 Bulgaria              BG    BGR                    6951482 Europe          247038               1
4 2021-03-01     1     3  2021  242973   5526 Croatia               HR    HRV                    4058165 Europe          242973               1
5 2021-03-01     1     3  2021 1240051  20469 Czechia               CZ    CZE                   10693939 Europe         1240051               1
6 2021-03-01     1     3  2021  211195   2361 Denmark               DK    DNK                    5822763 Europe          211195               1
confirmed_COVID_data <- COVID_data %>% 
  filter(countriesAndTerritories %in% ten_countries) %>%
  filter(cases >0) %>% 
  mutate(dateRep = as.Date(dateRep, '%d/%m/%Y')) %>%
  group_by(countriesAndTerritories) %>%
  arrange(dateRep) %>%
  mutate(cum_cases = cumsum(cases)) %>%
  filter(cum_cases >= 100000) %>% 
  group_by(countriesAndTerritories) %>% 
  mutate(cumulative_days = row_number())
# Groups:   countriesAndTerritories [6]
  dateRep      day month  year   cases deaths countriesAndTerritor~ geoId countryterritoryC~ popData2020 continentExp cum_cases cumulative_days
  <date>     <int> <int> <int>   <int>  <int> <chr>                 <chr> <chr>                    <int> <chr>            <int>           <int>
1 2021-03-01     1     3  2021  456112   8414 Austria               AT    AUT                    8901064 Europe          456112               1
2 2021-03-01     1     3  2021  779096  22278 Belgium               BE    BEL                   11522440 Europe          779096               1
3 2021-03-01     1     3  2021  247038  10191 Bulgaria              BG    BGR                    6951482 Europe          247038               1
4 2021-03-01     1     3  2021  242973   5526 Croatia               HR    HRV                    4058165 Europe          242973               1
5 2021-03-01     1     3  2021 1240051  20469 Czechia               CZ    CZE                   10693939 Europe         1240051               1
6 2021-03-01     1     3  2021  211195   2361 Denmark               DK    DNK                    5822763 Europe          211195               1

R - Draw cases per 100k population

copy iconCopydownload iconDownload
library(utils)
library(tidyverse)

COVID_data <-read.csv("https://opendata.ecdc.europa.eu/covid19/nationalcasedeath_eueea_daily_ei/csv", na.strings = "", fileEncoding = "UTF-8-BOM")

# For better printing
COVID_data <- as_tibble(COVID_data)

# Which countries have the higest absolute death toll? 
# [I get the same countries as you do.]
top10 <- COVID_data %>% 
  group_by(countriesAndTerritories) %>% 
  summarise(TotalDeaths=sum(deaths)) %>% 
  slice_max(TotalDeaths, n=10) %>% 
  distinct(countriesAndTerritories) %>% 
  pull(countriesAndTerritories)

COVID_data %>% 
  filter(countriesAndTerritories %in% top10) %>% 
  mutate(
    deathRate=100000 * deaths / popData2020,
    caseRate=100000 * cases /popData2020,
    Date=lubridate::dmy(dateRep)
  )  %>% 
  arrange(countriesAndTerritories, Date) %>% 
  group_by(countriesAndTerritories) %>% 
  filter(row_number() > 1) %>% 
  ggplot() + 
    geom_line(aes(x=Date, y=deathRate)) +
    facet_wrap(~countriesAndTerritories)
  arrange(countriesAndTerritories, Date) %>% 
  group_by(countriesAndTerritories) %>% 
  filter(row_number() > 1) %>% 
library(utils)
library(tidyverse)

COVID_data <-read.csv("https://opendata.ecdc.europa.eu/covid19/nationalcasedeath_eueea_daily_ei/csv", na.strings = "", fileEncoding = "UTF-8-BOM")

# For better printing
COVID_data <- as_tibble(COVID_data)

# Which countries have the higest absolute death toll? 
# [I get the same countries as you do.]
top10 <- COVID_data %>% 
  group_by(countriesAndTerritories) %>% 
  summarise(TotalDeaths=sum(deaths)) %>% 
  slice_max(TotalDeaths, n=10) %>% 
  distinct(countriesAndTerritories) %>% 
  pull(countriesAndTerritories)

COVID_data %>% 
  filter(countriesAndTerritories %in% top10) %>% 
  mutate(
    deathRate=100000 * deaths / popData2020,
    caseRate=100000 * cases /popData2020,
    Date=lubridate::dmy(dateRep)
  )  %>% 
  arrange(countriesAndTerritories, Date) %>% 
  group_by(countriesAndTerritories) %>% 
  filter(row_number() > 1) %>% 
  ggplot() + 
    geom_line(aes(x=Date, y=deathRate)) +
    facet_wrap(~countriesAndTerritories)
  arrange(countriesAndTerritories, Date) %>% 
  group_by(countriesAndTerritories) %>% 
  filter(row_number() > 1) %>% 

Incorrect yaml format

copy iconCopydownload iconDownload
Title: "Covid19 Digest"
Section1: "What's new in this issue?"
Heading 1:
         - "North America"
         - Content:
             - "abc"
             - "def"
         - "Asia-Pacific"
         - Content:
            - "jkl"
            - subcontent:
                - "apples"
                - "oranges"
                - "oranges"
            - "mnop"
Title: "Covid19 Digest"
Section1:
  Title: "What's new in this issue?"
  Heading 1:
         - "North America"
         - Content:
             - "abc"
             - "def"
         - "Asia-Pacific"
         - Content:
            - "jkl"
            - subcontent:
                - "apples"
                - "oranges"
                - "oranges"
            - "mnop"
Title: "Covid19 Digest"
Section1: "What's new in this issue?"
Heading 1:
         - "North America"
         - Content:
             - "abc"
             - "def"
         - "Asia-Pacific"
         - Content:
            - "jkl"
            - subcontent:
                - "apples"
                - "oranges"
                - "oranges"
            - "mnop"
Title: "Covid19 Digest"
Section1:
  Title: "What's new in this issue?"
  Heading 1:
         - "North America"
         - Content:
             - "abc"
             - "def"
         - "Asia-Pacific"
         - Content:
            - "jkl"
            - subcontent:
                - "apples"
                - "oranges"
                - "oranges"
            - "mnop"
Section1: "What's new in this issue?"
  Heading 1:
Section1:
  Title: "What's new in this issue?"
  Heading 1:
Section1: "What's new in this issue?"
  Heading 1:
Section1:
  Title: "What's new in this issue?"
  Heading 1:

R- Finding cumulative values

copy iconCopydownload iconDownload
library(utils)
COVID_data <-read.csv("https://opendata.ecdc.europa.eu/covid19/nationalcasedeath_eueea_daily_ei/csv", na.strings = "", fileEncoding = "UTF-8-BOM")


library(tidyverse)
COVID_data %>% mutate(dateRep = as.Date(dateRep, '%d/%m/%Y')) %>%
  group_by(countriesAndTerritories) %>%
  arrange(dateRep) %>%
  mutate(cum_cases = cumsum(cases)) %>%
  filter(cum_cases >= 1000) %>%
  ungroup() %>%
  ggplot() +
  geom_line(aes(x = dateRep, y = cum_cases, color = countriesAndTerritories))
ten_countries <- c('Denmark', 'Croatia', 'Austria', 'Finland', 'France', 'Germany', 'Greece', 'Iceland', 'Italy', 'Spain')

COVID_data %>% filter(countriesAndTerritories %in% ten_countries) %>%
  mutate(dateRep = as.Date(dateRep, '%d/%m/%Y')) %>%
  group_by(countriesAndTerritories) %>%
  arrange(dateRep) %>%
  mutate(cum_cases = cumsum(cases)) %>%
  filter(cum_cases >= 1000) %>%
  ungroup() %>%
  ggplot() +
  geom_line(aes(x = dateRep, y = cum_cases, color = countriesAndTerritories))
library(utils)
COVID_data <-read.csv("https://opendata.ecdc.europa.eu/covid19/nationalcasedeath_eueea_daily_ei/csv", na.strings = "", fileEncoding = "UTF-8-BOM")


library(tidyverse)
COVID_data %>% mutate(dateRep = as.Date(dateRep, '%d/%m/%Y')) %>%
  group_by(countriesAndTerritories) %>%
  arrange(dateRep) %>%
  mutate(cum_cases = cumsum(cases)) %>%
  filter(cum_cases >= 1000) %>%
  ungroup() %>%
  ggplot() +
  geom_line(aes(x = dateRep, y = cum_cases, color = countriesAndTerritories))
ten_countries <- c('Denmark', 'Croatia', 'Austria', 'Finland', 'France', 'Germany', 'Greece', 'Iceland', 'Italy', 'Spain')

COVID_data %>% filter(countriesAndTerritories %in% ten_countries) %>%
  mutate(dateRep = as.Date(dateRep, '%d/%m/%Y')) %>%
  group_by(countriesAndTerritories) %>%
  arrange(dateRep) %>%
  mutate(cum_cases = cumsum(cases)) %>%
  filter(cum_cases >= 1000) %>%
  ungroup() %>%
  ggplot() +
  geom_line(aes(x = dateRep, y = cum_cases, color = countriesAndTerritories))

TypeError: slice indices must be integers or None or have an __index__ method (Albumentations/NumPy)

copy iconCopydownload iconDownload
A.RandomCrop(p=1.0, width=img.shape[0] / 2, height=img.shape[1] / 2)
A.RandomCrop(p=1.0, width=int(img.shape[0] / 2), height=int(img.shape[1] / 2))
A.RandomCrop(p=1.0, width=img.shape[0] // 2, height=img.shape[1] // 2)
A.RandomCrop(p=1.0, width=img.shape[0] / 2, height=img.shape[1] / 2)
A.RandomCrop(p=1.0, width=int(img.shape[0] / 2), height=int(img.shape[1] / 2))
A.RandomCrop(p=1.0, width=img.shape[0] // 2, height=img.shape[1] // 2)
A.RandomCrop(p=1.0, width=img.shape[0] / 2, height=img.shape[1] / 2)
A.RandomCrop(p=1.0, width=int(img.shape[0] / 2), height=int(img.shape[1] / 2))
A.RandomCrop(p=1.0, width=img.shape[0] // 2, height=img.shape[1] // 2)

How to convert HTML into dataframe by using json with either r or python?

copy iconCopydownload iconDownload
library(jsonlite)
library(tibble)
a <- fromJSON("path.txt")
as_tibble(a$features)
#> # A tibble: 37 x 4
#>    type   id       properties$`hc-g… $`hc-key`   $`hc-a2` $name   $`hc-middle-x`
#>    <chr>  <chr>    <chr>             <chr>       <chr>    <chr>            <dbl>
#>  1 Featu… Madhya … admin1            madhya pra… MP       Madhya…           0.5 
#>  2 Featu… Uttar P… admin1            uttar prad… UP       Uttar …           0.5 
#>  3 Featu… Karnata… admin1            karnataka   KA       Karnat…           0.35
#>  4 Featu… Nagaland admin1            nagaland    NA       Nagala…           0.5 
#>  5 Featu… Bihar    admin1            bihar       BI       Bihar             0.5 
#>  6 Featu… Lakshad… admin1            lakshadweep LA       Laksha…           0.5 
#>  7 Featu… Andaman… admin1            andaman an… AA       Andama…           0.5 
#>  8 Featu… Assam    admin1            assam       AS       Assam             0.5 
#>  9 Featu… West Be… admin1            west bengal WB       West B…           0.6 
#> 10 Featu… Puduche… admin1            puducherry  PY       Puduch…           0.62
#> # … with 27 more rows, and 1 more variable: geometry <df[,2]>

Selenium: &quot;ElementClickInterceptedException&quot;, Element is not clickable because another element obscures it

copy iconCopydownload iconDownload
national_references = WebDriverWait(browser, 20).until(EC.presence_of_element_located((By.CSS_SELECTOR, "#national-references")))
actions = ActionChains(driver)
actions.move_to_element(national_references).perform()
wait.until(EC.element_to_be_clickable((By.XPATH, VACCINES_XPATH))).click()

How to read nested json file and pull information from dataframe inside dataframe in r?

copy iconCopydownload iconDownload
library(magrittr)
library(tidyr)

jsonlite::fromJSON(file_url1) %>%
  .[[1]] %>% 
  unnest(sessions) %>%
  unnest(slots)

# A tibble: 280 x 20
#   center_id name    address   state_name district_name block_name pincode   lat  long from 
#       <int> <chr>   <chr>     <chr>      <chr>         <chr>        <int> <int> <int> <chr>
# 1      1273 CGHS W… CGHS Pat… Delhi      West Delhi    Not Appli…  110008    28    77 09:0…
# 2      1273 CGHS W… CGHS Pat… Delhi      West Delhi    Not Appli…  110008    28    77 09:0…
# 3      1273 CGHS W… CGHS Pat… Delhi      West Delhi    Not Appli…  110008    28    77 09:0…
# 4      1273 CGHS W… CGHS Pat… Delhi      West Delhi    Not Appli…  110008    28    77 09:0…
# 5    594035 Tihar … Tihar Ja… Delhi      West Delhi    Not Appli…  110064    28    77 09:0…
# 6    594035 Tihar … Tihar Ja… Delhi      West Delhi    Not Appli…  110064    28    77 09:0…
# 7    594035 Tihar … Tihar Ja… Delhi      West Delhi    Not Appli…  110064    28    77 09:0…
# 8    594035 Tihar … Tihar Ja… Delhi      West Delhi    Not Appli…  110064    28    77 09:0…
# 9    594035 Tihar … Tihar Ja… Delhi      West Delhi    Not Appli…  110064    28    77 09:0…
#10    594035 Tihar … Tihar Ja… Delhi      West Delhi    Not Appli…  110064    28    77 09:0…
# … with 270 more rows, and 10 more variables: to <chr>, fee_type <chr>, session_id <chr>,
#   date <chr>, available_capacity <int>, min_age_limit <int>, vaccine <chr>, slots <chr>,
#   available_capacity_dose1 <int>, available_capacity_dose2 <int>

Javascript need website URLS shortening down

copy iconCopydownload iconDownload
const links = Array.from(document.querySelectorAll(".a3s a")).map(link => {
  const url = new URL(link.href);
  return url.hostname;
})

//removes duplicate links
const uniq = [...new Set(links)];

document.write(uniq.join(', '))
<div class="a3s">
  <a href="https://mad-websites.ru/via/e?ob=RohpF3uuLGksOJfxJOwcgRL5vknYi4kC2aQRzvu2v3s%3D&h=04ce1caed8c7cf4b69d751230eaf7a2450660d67-o26qxr01_77963700909352&l=6ef96bea4775c44a5bc10cdaa661c5053819c0b8-7456283"></a>
  <a href="https://notifications.google.com/g/p/AD-FnEwlAH83isfsH0zLOoNuynSmz1pMuK9Y8guqew5CkdyaEu28Zu30iRcw-SI6y7LRO7v8Tqy6p_9LhGcQClO1e2P5WYSVNa9dWPVhmA"></a>
  <a href="https://finance.rambler.ru/?utm_source=head&utm_campaign=self_promo&utm_medium=topline&utm_content=finance_media"></a>
  <a href="https://www.google.com/covid19?utm_source=Google-Maps-timeline&utm_medium=email&utm_campaign=COVID-site-promo"></a>
</div>
const links = Array.from(document.querySelectorAll(".a3s a")).map(link => {
  const url = new URL(link.href);
  return url.hostname;
})

//removes duplicate links
const uniq = [...new Set(links)];

document.write(uniq.join(', '))
<div class="a3s">
  <a href="https://mad-websites.ru/via/e?ob=RohpF3uuLGksOJfxJOwcgRL5vknYi4kC2aQRzvu2v3s%3D&h=04ce1caed8c7cf4b69d751230eaf7a2450660d67-o26qxr01_77963700909352&l=6ef96bea4775c44a5bc10cdaa661c5053819c0b8-7456283"></a>
  <a href="https://notifications.google.com/g/p/AD-FnEwlAH83isfsH0zLOoNuynSmz1pMuK9Y8guqew5CkdyaEu28Zu30iRcw-SI6y7LRO7v8Tqy6p_9LhGcQClO1e2P5WYSVNa9dWPVhmA"></a>
  <a href="https://finance.rambler.ru/?utm_source=head&utm_campaign=self_promo&utm_medium=topline&utm_content=finance_media"></a>
  <a href="https://www.google.com/covid19?utm_source=Google-Maps-timeline&utm_medium=email&utm_campaign=COVID-site-promo"></a>
</div>

Community Discussions

Trending Discussions on COVID19
  • Train test split mysql records into views
  • R - The cumulative number of cases by days since confirmed cases
  • R - Draw cases per 100k population
  • Incorrect yaml format
  • R- Finding cumulative values
  • TypeError: slice indices must be integers or None or have an __index__ method (Albumentations/NumPy)
  • How to convert HTML into dataframe by using json with either r or python?
  • Selenium: &quot;ElementClickInterceptedException&quot;, Element is not clickable because another element obscures it
  • How to read nested json file and pull information from dataframe inside dataframe in r?
  • Javascript need website URLS shortening down
Trending Discussions on COVID19

QUESTION

Train test split mysql records into views

Asked 2021-Jun-11 at 09:30

how do i create two views, one for training data and the other for test data 70:30 split in mySql.

CREATE VIEW training_data
AS
SELECT Posts.post_content as post_content,
    CASE 
        WHEN (Posts.post_title like '%covid%corona%covid19%' or Posts.post_content like '%covid%corona%covid19%') THEN 1 
        ELSE 0
    END AS tag 
FROM Posts;

CREATE VIEW test_data
AS
SELECT Posts.post_content as post_content,
    CASE 
        WHEN (Posts.post_title like '%covid%corona%covid19%' or Posts.post_content like '%covid%corona%covid19%') THEN 1 
        ELSE 0
    END AS tag 
FROM Posts;

ANSWER

Answered 2021-Jun-11 at 09:30
CREATE VIEW training_data
AS
WITH cte AS ( SELECT Posts.post_content as post_content,
                     CASE WHEN Posts.post_title like '%covid%corona%covid19%'
                          THEN 1
                          WHEN Posts.post_content like '%covid%corona%covid19%' 
                          THEN 1 
                          ELSE 0 END AS tag,
                     ROW_NUMBER() OVER (ORDER BY id) rn
              FROM Posts )
SELECT post_content, tag
FROM cte
WHERE rn MOD 10 IN (0,1,3,4,6,7,9);

and

CREATE VIEW test_data
AS
WITH cte AS ( SELECT Posts.post_content as post_content,
                     CASE WHEN Posts.post_title like '%covid%corona%covid19%'
                          THEN 1
                          WHEN Posts.post_content like '%covid%corona%covid19%' 
                          THEN 1 
                          ELSE 0 END AS tag,
                     ROW_NUMBER() OVER (ORDER BY id) rn
              FROM Posts )
SELECT post_content, tag
FROM cte
WHERE rn MOD 10 IN (2,5,8);

Take into account - both queries are slow due to fullscan. I'd recommend you to add generated column with tag expression into the table structure for to improve.

Source https://stackoverflow.com/questions/67934057

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install COVID19

You can download it from GitHub.

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases
Explore Kits

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Reuse Pre-built Kits with COVID19
Consider Popular Dataset Libraries
Try Top Libraries by vinitshahdeo
Compare Dataset Libraries with Highest Support
Compare Dataset Libraries with Highest Quality
Compare Dataset Libraries with Highest Security
Compare Dataset Libraries with Permissive License
Compare Dataset Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases
Explore Kits

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.