From 67b001a5b931d11a0a44404f4c2735c28cd58eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 26 Jun 2020 20:31:36 +0200 Subject: [PATCH] Fixed Pandas diagram --- index.html | 6 +++--- parse.js | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index fb7e47b..c4cc36c 100644 --- a/index.html +++ b/index.html @@ -2718,7 +2718,7 @@ c 6 7 ┃ how/join │ 'outer''inner''left' │ description ┃ ┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨ ┃ l.merge(r, on='y', │ x y z │ x y z │ x y z │ Joins/merges on column. ┃ -┃ how=…) │ 0 1 2 . │ 3 4 51 2 . │ Also accepts left_on and ┃ +┃ how=…) │ 0 1 2 . │ 3 4 51 2 . │ Also accepts left_on and ┃ ┃ │ 1 3 4 5 │ │ 3 4 5 │ right_on parameters. ┃ ┃ │ 2 . 6 7 │ │ │ Uses 'inner' by default. ┃ ┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨ @@ -2730,7 +2730,7 @@ c 6 7 ┃ pd.concat([l, r], │ x y z │ y │ │ Adds rows at the bottom. ┃ ┃ axis=0, │ a 1 2 . │ 2 │ │ Uses 'outer' by default. ┃ ┃ join=…) │ b 3 4 . │ 4 │ │ By default works the ┃ -┃ │ b . 4 54 │ │ same as `l.append(r)`. ┃ +┃ │ b . 4 54 │ │ same as `l.append(r)`. ┃ ┃ │ c . 6 76 │ │ ┃ ┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨ ┃ pd.concat([l, r], │ x y y z │ │ │ Adds columns at the ┃ @@ -2738,7 +2738,7 @@ c 6 7 ┃ join=…) │ b 3 4 4 53 4 4 5 │ │ Uses 'outer' by default. ┃ ┃ │ c . . 6 7 │ │ │ ┃ ┠────────────────────────┼───────────────┼────────────┼────────────┼──────────────────────────┨ -┃ l.combine_first(r) │ x y z │ │ │ Adds missing rows and ┃ +┃ l.combine_first(r) │ x y z │ │ │ Adds missing rows and ┃ ┃ │ a 1 2 . │ │ │ columns. ┃ ┃ │ b 3 4 5 │ │ │ ┃ ┃ │ c . 6 7 │ │ │ ┃ diff --git a/parse.js b/parse.js index e0a0550..6eee291 100755 --- a/parse.js +++ b/parse.js @@ -408,6 +408,7 @@ function modifyPage() { unindentBanner(); updateDiagrams(); highlightCode(); + fixPandasDiagram(); removePlotImages(); } @@ -534,6 +535,13 @@ function insertPageBreakBefore(an_id) { $('
').insertBefore($(an_id).parent()) } +function fixPandasDiagram() { + const diagram_15 = '┏━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━┓'; + $(`code:contains(${diagram_15})`).find(".hljs-keyword:contains(and)").after("and"); + $(`code:contains(${diagram_15})`).find(".hljs-keyword:contains(as)").after("as"); + $(`code:contains(${diagram_15})`).find(".hljs-keyword").remove(); +} + function removePlotImages() { $('img[alt="Covid Deaths"]').remove(); $('img[alt="Covid Cases"]').remove();