fdisk commited on
Commit
6c4fd2e
·
1 Parent(s): e2ef872

test for demo

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