Skip to content

Commit f753fbc

Browse files
authored
Update data format in chart example to DataFrame
1 parent 5a2eb4c commit f753fbc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ uv install datawrapper
2222
Create beautiful charts with type-safe, object-oriented Python:
2323

2424
```python
25+
import pandas as pd
2526
from datawrapper import BarChart, NumberFormat
2627

2728
# Create a bar chart with type-safe configuration
2829
chart = BarChart(
2930
title="Top Programming Languages 2024",
30-
data={"Language": ["Python", "JavaScript", "Java"], "Users": [45.3, 38.2, 30.5]},
31+
data=pd.DataFrame({"Language": ["Python", "JavaScript", "Java"], "Users": [45.3, 38.2, 30.5]}),
3132
axis_label_format=NumberFormat.ONE_DECIMAL, # Type-safe enum
3233
value_label_format=NumberFormat.ABBREVIATED, # IDE autocomplete support
3334
)

0 commit comments

Comments
 (0)