Skip to content

Commit

Permalink
Merge pull request #145 from ultima-ib/py-readme
Browse files Browse the repository at this point in the history
python readme
  • Loading branch information
AnatolyBuga authored Jun 10, 2023
2 parents a7f60d7 + 4798923 commit b41f1bd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pyultima/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,28 @@ In the mean time refer to FRTB [userguide](https://ultimabi.uk/ultibi-frtb-book/

## Python

### Quickstart
```python
import ultibi as ul
import polars as pl
import os
os.environ["RUST_LOG"] = "info" # enable logs
os.environ["ADDRESS"] = "0.0.0.0:8000" # host on this address

# Read Data
# for more details: https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.read_csv.html
df = pl.read_csv("titanic.csv")

# Convert it into an Ultibi DataSet
ds = ul.DataSet.from_frame(df, bespoke_measures=measures)

# By default (might change in the future)
# Fields are Utf8 (non numerics) and integers
# Measures are numeric columns.
ds.ui()
```

### More flexible - custom measures
```python
import ultibi as ul
import polars as pl
Expand Down

0 comments on commit b41f1bd

Please sign in to comment.