nesticot commited on
Commit
d92588e
·
verified ·
1 Parent(s): 6c545b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +88 -86
app.py CHANGED
@@ -21,19 +21,20 @@ from configure import base_url
21
  import shinyswatch
22
 
23
  ### Import Datasets
24
- dataset = load_dataset('nesticot/mlb_data', data_files=['mlb_pitch_data_2023.csv' ])
25
  dataset_train = dataset['train']
26
  df_2023_mlb = dataset_train.to_pandas().set_index(list(dataset_train.features.keys())[0]).reset_index(drop=True)
27
 
28
- ### Import Datasets
29
- dataset = load_dataset('nesticot/mlb_data', data_files=['aaa_pitch_data_2023.csv' ])
30
- dataset_train = dataset['train']
31
- df_2023_aaa = dataset_train.to_pandas().set_index(list(dataset_train.features.keys())[0]).reset_index(drop=True)
32
 
33
  df_2023_mlb['level'] = 'MLB'
34
- df_2023_aaa['level'] = 'AAA'
35
 
36
- df_2023 = pd.concat([df_2023_mlb,df_2023_aaa])
 
37
 
38
  #print(df_2023)
39
  ### Normalize Hit Locations
@@ -561,7 +562,64 @@ app = App(ui.page_fluid(
561
  shinyswatch.theme.simplex(),
562
  ui.tags.h4("TJStats"),
563
  ui.tags.i("Baseball Analytics and Visualizations"),
564
- ui.markdown("""<a href='https://www.patreon.com/tj_stats'>Support me on Patreon for Access to 2024 Apps</a><sup>1</sup>"""),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
565
  # ui.navset_tab(
566
  # ui.nav_control(
567
  # ui.a(
@@ -574,31 +632,35 @@ app = App(ui.page_fluid(
574
  # ui.nav_control(
575
  # ui.a(
576
  # "Batting Rolling",
577
- # href="rolling_batter/"
578
  # ),
579
  # ui.a(
580
- # "Spray & Damage",
581
  # href="https://nesticot-tjstats-site-spray.hf.space/"
582
  # ),
583
  # ui.a(
584
  # "Decision Value",
585
- # href="decision_value/"
 
 
 
 
586
  # ),
587
- # # ui.a(
588
- # # "Damage Model",
589
- # # href="damage_model/"
590
- # # ),
591
  # ui.a(
592
  # "Batter Scatter",
593
- # href="batter_scatter/"
 
 
 
 
594
  # ),
595
- # # ui.a(
596
- # # "EV vs LA Plot",
597
- # # href="ev_angle/"
598
- # # ),
599
  # ui.a(
600
  # "Statcast Compare",
601
- # href="statcast_compare/"
 
 
 
 
602
  # )
603
  # ),
604
  # ),
@@ -607,79 +669,19 @@ app = App(ui.page_fluid(
607
  # ui.nav_control(
608
  # ui.a(
609
  # "Pitcher Rolling",
610
- # href="rolling_pitcher/"
611
  # ),
612
  # ui.a(
613
  # "Pitcher Summary",
614
- # href="pitching_summary_graphic_new/"
615
  # ),
616
  # ui.a(
617
  # "Pitcher Scatter",
618
- # href="pitcher_scatter/"
619
  # )
620
  # ),
621
- # )),
622
- ui.navset_tab(
623
- ui.nav_control(
624
- ui.a(
625
- "Home",
626
- href="home/"
627
- ),
628
- ),
629
- ui.nav_menu(
630
- "Batter Charts",
631
- ui.nav_control(
632
- ui.a(
633
- "Batting Rolling",
634
- href="https://nesticot-tjstats-site-rolling-batter.hf.space/"
635
- ),
636
- ui.a(
637
- "Spray",
638
- href="https://nesticot-tjstats-site-spray.hf.space/"
639
- ),
640
- ui.a(
641
- "Decision Value",
642
- href="https://nesticot-tjstats-site-decision-value.hf.space/"
643
- ),
644
- ui.a(
645
- "Damage Model",
646
- href="https://nesticot-tjstats-site-damage.hf.space/"
647
- ),
648
- ui.a(
649
- "Batter Scatter",
650
- href="https://nesticot-tjstats-site-batter-scatter.hf.space/"
651
- ),
652
- ui.a(
653
- "EV vs LA Plot",
654
- href="https://nesticot-tjstats-site-ev-angle.hf.space/"
655
- ),
656
- ui.a(
657
- "Statcast Compare",
658
- href="https://nesticot-tjstats-site-statcast-compare.hf.space/"
659
- ),
660
- ui.a(
661
- "MLB/MiLB Cards",
662
- href="https://nesticot-tjstats-site-mlb-cards.hf.space/"
663
- )
664
- ),
665
- ),
666
- ui.nav_menu(
667
- "Pitcher Charts",
668
- ui.nav_control(
669
- ui.a(
670
- "Pitcher Rolling",
671
- href="https://nesticot-tjstats-site-rolling-pitcher.hf.space/"
672
- ),
673
- ui.a(
674
- "Pitcher Summary",
675
- href="https://nesticot-tjstats-site-pitching-summary-graphic-new.hf.space/"
676
- ),
677
- ui.a(
678
- "Pitcher Scatter",
679
- href="https://nesticot-tjstats-site-pitcher-scatter.hf.space"
680
- )
681
- ),
682
- )), ui.row(
683
  ui.layout_sidebar(
684
 
685
  ui.panel_sidebar(
 
21
  import shinyswatch
22
 
23
  ### Import Datasets
24
+ dataset = load_dataset('nesticot/mlb_data', data_files=['mlb_pitch_data_2024.csv' ])
25
  dataset_train = dataset['train']
26
  df_2023_mlb = dataset_train.to_pandas().set_index(list(dataset_train.features.keys())[0]).reset_index(drop=True)
27
 
28
+ # ### Import Datasets
29
+ # dataset = load_dataset('nesticot/mlb_data', data_files=['aaa_pitch_data_2023.csv' ])
30
+ # dataset_train = dataset['train']
31
+ # df_2023_aaa = dataset_train.to_pandas().set_index(list(dataset_train.features.keys())[0]).reset_index(drop=True)
32
 
33
  df_2023_mlb['level'] = 'MLB'
34
+ # df_2023_aaa['level'] = 'AAA'
35
 
36
+ # df_2023 = pd.concat([df_2023_mlb,df_2023_aaa])
37
+ df_2023 = pd.concat([df_2023_mlb])
38
 
39
  #print(df_2023)
40
  ### Normalize Hit Locations
 
562
  shinyswatch.theme.simplex(),
563
  ui.tags.h4("TJStats"),
564
  ui.tags.i("Baseball Analytics and Visualizations"),
565
+ # ui.markdown("""<a href='https://www.patreon.com/tj_stats'>Support me on Patreon for Access to 2024 Apps</a><sup>1</sup>"""),
566
+ # # ui.navset_tab(
567
+ # # ui.nav_control(
568
+ # # ui.a(
569
+ # # "Home",
570
+ # # href="home/"
571
+ # # ),
572
+ # # ),
573
+ # # ui.nav_menu(
574
+ # # "Batter Charts",
575
+ # # ui.nav_control(
576
+ # # ui.a(
577
+ # # "Batting Rolling",
578
+ # # href="rolling_batter/"
579
+ # # ),
580
+ # # ui.a(
581
+ # # "Spray & Damage",
582
+ # # href="https://nesticot-tjstats-site-spray.hf.space/"
583
+ # # ),
584
+ # # ui.a(
585
+ # # "Decision Value",
586
+ # # href="decision_value/"
587
+ # # ),
588
+ # # # ui.a(
589
+ # # # "Damage Model",
590
+ # # # href="damage_model/"
591
+ # # # ),
592
+ # # ui.a(
593
+ # # "Batter Scatter",
594
+ # # href="batter_scatter/"
595
+ # # ),
596
+ # # # ui.a(
597
+ # # # "EV vs LA Plot",
598
+ # # # href="ev_angle/"
599
+ # # # ),
600
+ # # ui.a(
601
+ # # "Statcast Compare",
602
+ # # href="statcast_compare/"
603
+ # # )
604
+ # # ),
605
+ # # ),
606
+ # # ui.nav_menu(
607
+ # # "Pitcher Charts",
608
+ # # ui.nav_control(
609
+ # # ui.a(
610
+ # # "Pitcher Rolling",
611
+ # # href="rolling_pitcher/"
612
+ # # ),
613
+ # # ui.a(
614
+ # # "Pitcher Summary",
615
+ # # href="pitching_summary_graphic_new/"
616
+ # # ),
617
+ # # ui.a(
618
+ # # "Pitcher Scatter",
619
+ # # href="pitcher_scatter/"
620
+ # # )
621
+ # # ),
622
+ # # )),
623
  # ui.navset_tab(
624
  # ui.nav_control(
625
  # ui.a(
 
632
  # ui.nav_control(
633
  # ui.a(
634
  # "Batting Rolling",
635
+ # href="https://nesticot-tjstats-site-rolling-batter.hf.space/"
636
  # ),
637
  # ui.a(
638
+ # "Spray",
639
  # href="https://nesticot-tjstats-site-spray.hf.space/"
640
  # ),
641
  # ui.a(
642
  # "Decision Value",
643
+ # href="https://nesticot-tjstats-site-decision-value.hf.space/"
644
+ # ),
645
+ # ui.a(
646
+ # "Damage Model",
647
+ # href="https://nesticot-tjstats-site-damage.hf.space/"
648
  # ),
 
 
 
 
649
  # ui.a(
650
  # "Batter Scatter",
651
+ # href="https://nesticot-tjstats-site-batter-scatter.hf.space/"
652
+ # ),
653
+ # ui.a(
654
+ # "EV vs LA Plot",
655
+ # href="https://nesticot-tjstats-site-ev-angle.hf.space/"
656
  # ),
 
 
 
 
657
  # ui.a(
658
  # "Statcast Compare",
659
+ # href="https://nesticot-tjstats-site-statcast-compare.hf.space/"
660
+ # ),
661
+ # ui.a(
662
+ # "MLB/MiLB Cards",
663
+ # href="https://nesticot-tjstats-site-mlb-cards.hf.space/"
664
  # )
665
  # ),
666
  # ),
 
669
  # ui.nav_control(
670
  # ui.a(
671
  # "Pitcher Rolling",
672
+ # href="https://nesticot-tjstats-site-rolling-pitcher.hf.space/"
673
  # ),
674
  # ui.a(
675
  # "Pitcher Summary",
676
+ # href="https://nesticot-tjstats-site-pitching-summary-graphic-new.hf.space/"
677
  # ),
678
  # ui.a(
679
  # "Pitcher Scatter",
680
+ # href="https://nesticot-tjstats-site-pitcher-scatter.hf.space"
681
  # )
682
  # ),
683
+ # )),
684
+ ui.row(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
685
  ui.layout_sidebar(
686
 
687
  ui.panel_sidebar(