Skip to content

Commit

Permalink
Merge branch 'main' of github.com:sodascience/netCBS
Browse files Browse the repository at this point in the history
  • Loading branch information
jgarciab committed Jul 20, 2024
2 parents f33007f + a653b5a commit d9d952f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,16 @@ pip install git+https://git@github.com/sodascience/netcbs.git@main

See [notebook](tutorial_netCBS.ipynb) for accessible information and examples.

For testing locally: run this script to create synthetic data (1M of random edges for year 2021). The files are saved to the folder "cbsdata/Bevolking"
```bash
python3 netcbs/create_synthetitcata.py
```

### Create network measures (e.g. the average income and age of the parents (link type 301) of the classmats of children in the sample)
### Create network measures (e.g. the average income and age of the parents (link type 301) of the classmates of children in the sample)
```python
query = "[Income, Age] -> Family[301] -> Schoolmates[all] -> Sample"
df = netcbs.transform(query,
df_sample = df_sample, # dataset with the sample to study
df_agg = df_agg, # dataset with the income variable
year=2021, # year to study
cbsdata_path='G:/Bevolking', # path to the CBS data
agg_func=pl.mean, # calculate the average
agg_funcs=[pl.mean, pl.sum, pl.count], # calculate the average
return_pandas=False, # returns a pandas dataframe instead of a polars dataframe
lazy=True # use polars lazy evaluation (faster/less memory usage)
)
Expand Down

0 comments on commit d9d952f

Please sign in to comment.