hmb HF staff commited on
Commit
6497a6d
·
verified ·
1 Parent(s): cffac23

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import pandas as pd
3
+
4
+ # Creating a sample dataframe
5
+ df = pd.DataFrame(
6
+ {
7
+ "A": [14, 4, 5, 4, 1],
8
+ "B": [5, 2, 54, 3, 2],
9
+ "C": [20, 20, 7, 3, 8],
10
+ "D": [14, 3, 6, 2, 6],
11
+ "E": [23, 45, 64, 32, 23],
12
+ }
13
+ )
14
+
15
+ # Applying style to highlight the maximum value in each row
16
+ styler = df.style.highlight_max(color="lightgreen", axis=0)
17
+
18
+ # Displaying the styled dataframe in Gradio
19
+ with gr.Blocks() as demo:
20
+ gr.DataFrame(styler)
21
+
22
+ demo.launch(share=True)