read_csv()
is the standard way to load users. bandicoot can also load users though
load()
, a low-level function, called by read_csv()
, or other CSV formats such as
read_orange()
or read_telenor()
(deprecated).
read_csv (user_id, records_path[, …]) |
Load user records from a CSV file. |
read_orange (user_id, records_path[, …]) |
Load user records from a CSV file in orange format: |
read_telenor (incoming_cdr, outgoing_cdr, …) |
Load user records from a CSV file in telenor format, which is only applicable for call records. |
to_csv (objects, filename[, digits, warnings]) |
Export the flatten indicators of one or several users to CSV. |
to_json (objects, filename[, warnings]) |
Export the indicators of one or several users to JSON. |
load (name, records, antennas[, attributes, …]) |
Low-level function to create a new user. |
filter_record (records) |
Filter records and remove items with missing or inconsistent fields |
The attribute file is an optional file that contains information about the individual.
This information can, for example, be used to compute the ego-network assortativity_attributes()
.
Any attribute can be loaded and values can be string
, int
, or float
.
bandicoot predefines a few keys such as individual_id, or gender.
key | value |
---|---|
individual_id | 7atr8f53fg41 |
gender | male |
age | 42 |
It can be loaded as a CSV, with the following header
key,value
individual_id,7atr8f53fg41
gender,male
age,42
Attributes are optional and can be loaded at the same time as the records using
read_csv()
.
>>> B = bc.read_csv('my_user', 'records/', 'antennas.csv', attributes_path='attributes/')