1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] pydeck r.show() outputs TypeError: vars() argument must have __dict__ attribute

Discussão em 'Python' iniciado por Stack, Setembro 24, 2024.

  1. Stack

    Stack Membro Participativo

    Until now, everything worked just fine. I've created a new file to create new heatmap. My dataframe is looks like this:

    time name lng lat
    2019-10-16 08:00:00 A 23.1113 34.123123
    2019-10-16 09:00:00 B 12.1113 11.123123
    2019-10-16 07:30:00 C 134.1113 12.123123
    2019-10-16 08:40:00 D 122.1113 12.123123
    2019-10-16 08:50:00 A 16.1113 12.123123


    which is always exact same as dataframe I've used before when creating heatmap exact name, and other columns.

    copy paste previous code for creating heatmap:

    layer = pdk.Layer(
    "HeatmapLayer",
    df,
    get_position="[lng, lat]"
    )
    center = [126.986, 37.565]
    view_state = pdk.ViewState(
    longitude=center[0],
    latitude=center[1],
    zoom=10
    )
    r = pdk.Deck(layers=[layer],
    initial_view_state=view_state,
    mapbox_key=MAPBOX_API_KEY)
    r.show()


    When I run w/o r.show() it doesn't show anything, when I run with r.show() it outputs TypeError: vars() argument must have __dict__ attribute

    I cannot figure out what is wrong...

    Continue reading...

Compartilhe esta Página