Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

problem when use to https://aws.amazon.com/blogs/mobile/predictive-maintenance-with-aws-iot-and-amazon-machine-learning/ #3

Open
kradanfi opened this issue Jul 25, 2017 · 1 comment

Comments

@kradanfi
Copy link

when i use command python emit_to_AWS_IoT.py sim_pred_maint_emit.csv from guild is have a miss take
Traceback (most recent call last):
File "mtrand.pyx", line 1111, in mtrand.RandomState.choice (numpy\random\mtrand\mtrand.c:16976)
TypeError: 'dict_keys' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "e:\4D\aws\emit_to_AWS_IoT.py", line 41, in
emit_to_iot(args.datafile)
File "e:\4D\aws\emit_to_AWS_IoT.py", line 23, in emit_to_iot
group = np.random.choice(list_of_groups.keys())
File "mtrand.pyx", line 1113, in mtrand.RandomState.choice (numpy\random\mtrand\mtrand.c:17060)
ValueError: a must be 1-dimensional or an integer

@jolo2000
Copy link

Are you using Python 3.x?

Then change the line:
group = random.choice(list_of_groups.keys())
to
group = random.choice(list(list_of_groups.keys()))

HTH
Johannes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants