load

bandicoot.io.load(name, records, antennas, attributes=None, recharges=None, antennas_path=None, attributes_path=None, recharges_path=None, describe=False, warnings=False, drop_duplicates=False)

Low-level function to create a new user. This function is used by read_csv, read_orange, and read_telenor.

load is a low-level function which:

  • assigns records, antennas, and attributes to a new User object,
  • outputs warnings on the standard output if records or antennas are missing fields or have wrong values,
  • filters records with wrong values and drop duplicates records if asked.
Parameters:
name : str

The name of the user. It is stored in User.name and is useful when exporting metrics about multiple users.

records : list

List of Record objects.

antennas : dict

Dictionary of the position for each antenna.

attributes : dict

A (key,value) dictionary of attributes for the current user

recharges : list

List of Recharge objects.

antennas_path : str

Path of the antenna file. It will be stored in User.antennas_path.

attributes_path : str

Path of the attributes file. It will be stored in User.attributes_path.

recharges_path : str

Path of the recharges file. It will be stored in User.recharges_path.

describe : boolean, default: False

Print a description of the loaded user to the standard output.

warnings : boolean, default: True

Output warnings on the standard output.

drop_duplicates : boolean, default False

Remove duplicate records, and issue a warning message with the number of removed records.

Examples

>>> records = [Record(...),...]
>>> antennas = {'A51': (37.245265, 115.803418),...}
>>> attributes = {'age': 60}
>>> load("Frodo", records, antennas, attributes)

will returns a new User object.