-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:sodascience/netCBS
- Loading branch information
Showing
1 changed file
with
2 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,20 +11,16 @@ pip install git+https://[email protected]/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) | ||
) | ||
|