Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Error in Biogeme Notebook: TypeError when Running bio.BIOGEME()

22 views
Skip to first unread message

Henry Dao

unread,
Aug 20, 2024, 3:12:58 AM8/20/24
to Biogeme

Hello,

I am new to Biogeme and am currently exploring the package. I have been given a notebook that was used in previous semesters, so I believe it should work. However, when I run the code, I encountered an error. Specifically, when I run bio.BIOGEME(bgm_swissmetro, V), I receive the following error:

TypeError: object of type 'int' has no len()

In my code, V is a list, and bgm_swissmetro is a Biogeme database. See the screenshot for more detail.

Could you please help me resolve this issue?


Untitled.png

Michel Bierlaire

unread,
Aug 21, 2024, 3:14:36 AM8/21/24
to viethu...@gmail.com, Michel Bierlaire, Biogeme
V must be a dict associationg the id of the alternatives with their arithmetic expression.

Look at the online examples:
https://biogeme.epfl.ch/sphinx/examples.html


https://biogeme.epfl.ch/sphinx/auto_examples/swissmetro/plot_b01logit.html#sphx-glr-auto-examples-swissmetro-plot-b01logit-py
> --
> You received this message because you are subscribed to the Google Groups "Biogeme" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/biogeme/bc3752b1-98a8-4704-bb25-b25529385f00n%40googlegroups.com.
> <Untitled.png>

Michel Bierlaire
Transport and Mobility Laboratory
School of Architecture, Civil and Environmental Engineering
EPFL - Ecole Polytechnique Fédérale de Lausanne
http://transp-or.epfl.ch
http://people.epfl.ch/michel.bierlaire

Reply all
Reply to author
Forward
0 new messages