<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: plotly express choropleth map not rendering in jupyter notebook in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/plotly-express-choropleth-map-not-rendering-in-jupyter-notebook/m-p/6713#M2738</link>
    <description>&lt;P&gt;@Keval Shah​&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There could be several reasons why the choropleth map is not rendering in your Jupyter notebook. Here are a few things you could try:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Check that the GeoJSON file is loaded correctly: Make sure that the GeoDataFrame has been loaded correctly by checking the output of gpd.read_file(geojson_file)&lt;/LI&gt;&lt;LI&gt;Check the GeoDataFrame index: The locations argument in px.choropleth_mapbox expects a list of strings or numbers representing the index of the GeoDataFrame. Make sure that the index is set and that it is of the correct type.&lt;/LI&gt;&lt;LI&gt;Check that the color column exists: Make sure that the column specified in the color argument exists in the GeoDataFrame.&lt;/LI&gt;&lt;LI&gt;Check that Mapbox API token is set: In order to display the map, you need to have a valid Mapbox API token. Make sure that you have set this token using mapbox_token environment variable, or by passing it directly to px.choropleth_mapbox&lt;/LI&gt;&lt;LI&gt;Check that your internet connection is working: If you are using Mapbox as a basemap, you need an internet connection to load the map tiles. Make sure that you have a stable internet connection and that there are no issues with your firewall or network settings.&lt;/LI&gt;&lt;LI&gt;You can also try adding fig.show() at the end of the code to display the map in a separate window, rather than inline in the Jupyter notebook.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt; If none of these solutions work, you could try using a different library to render the choropleth map, such as Folium or Bokeh.&lt;/P&gt;</description>
    <pubDate>Sun, 02 Apr 2023 16:00:21 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-04-02T16:00:21Z</dc:date>
    <item>
      <title>plotly express choropleth map not rendering in jupyter notebook</title>
      <link>https://community.databricks.com/t5/data-engineering/plotly-express-choropleth-map-not-rendering-in-jupyter-notebook/m-p/6712#M2737</link>
      <description>&lt;P&gt;I have the following code which should render a choropleth map. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import plotly.express as px
import geopandas as gpd
&amp;nbsp;
# Example GeoJSON file with polygon geometries
geojson_file = 'example.geojson'
&amp;nbsp;
# Read GeoJSON file into GeoDataFrame
*** = gpd.read_file(geojson_file)
&amp;nbsp;
# Create Mapbox GL plot
fig = px.choropleth_mapbox(
    ***, 
    geojson=***.geometry, 
    locations=***.index, 
    color='property',
    center=dict(lat=0, lon=0), 
    zoom=1,
    mapbox_style="carto-positron"
)
&amp;nbsp;
fig.update_layout(margin=dict(l=0, r=0, t=0, b=0))
fig.show()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;however, when I run the code in jupyter notebook, I get a blank output. Map doesn't render. &lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 07:07:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/plotly-express-choropleth-map-not-rendering-in-jupyter-notebook/m-p/6712#M2737</guid>
      <dc:creator>kll</dc:creator>
      <dc:date>2023-03-31T07:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: plotly express choropleth map not rendering in jupyter notebook</title>
      <link>https://community.databricks.com/t5/data-engineering/plotly-express-choropleth-map-not-rendering-in-jupyter-notebook/m-p/6713#M2738</link>
      <description>&lt;P&gt;@Keval Shah​&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There could be several reasons why the choropleth map is not rendering in your Jupyter notebook. Here are a few things you could try:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Check that the GeoJSON file is loaded correctly: Make sure that the GeoDataFrame has been loaded correctly by checking the output of gpd.read_file(geojson_file)&lt;/LI&gt;&lt;LI&gt;Check the GeoDataFrame index: The locations argument in px.choropleth_mapbox expects a list of strings or numbers representing the index of the GeoDataFrame. Make sure that the index is set and that it is of the correct type.&lt;/LI&gt;&lt;LI&gt;Check that the color column exists: Make sure that the column specified in the color argument exists in the GeoDataFrame.&lt;/LI&gt;&lt;LI&gt;Check that Mapbox API token is set: In order to display the map, you need to have a valid Mapbox API token. Make sure that you have set this token using mapbox_token environment variable, or by passing it directly to px.choropleth_mapbox&lt;/LI&gt;&lt;LI&gt;Check that your internet connection is working: If you are using Mapbox as a basemap, you need an internet connection to load the map tiles. Make sure that you have a stable internet connection and that there are no issues with your firewall or network settings.&lt;/LI&gt;&lt;LI&gt;You can also try adding fig.show() at the end of the code to display the map in a separate window, rather than inline in the Jupyter notebook.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt; If none of these solutions work, you could try using a different library to render the choropleth map, such as Folium or Bokeh.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Apr 2023 16:00:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/plotly-express-choropleth-map-not-rendering-in-jupyter-notebook/m-p/6713#M2738</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-02T16:00:21Z</dc:date>
    </item>
  </channel>
</rss>

