code: def test_weighted_pandas_df(self):
      pd = pytest.importorskip("pandas")
      df = pd.DataFrame.from_records(
          [
              (longitude, latitude, weight)
              for ((longitude, latitude), weight) in zip(
                  self.locations, self.weights
              )
          ],
          columns=["latitude", "longitude", "weight"],
      )
      heatmap = heatmap_layer(
          df[["latitude", "longitude"]], weights=df["weight"]
      )
      state = heatmap.get_state()
      assert state["_view_name"] == "WeightedHeatmapLayerView"
      assert state["_model_name"] == "WeightedHeatmapLayerModel"
      assert state["weights"] == self.weights
      assert state["locations"] == self.locations
  
imports: import unittest
  import pytest
  import traitlets
  from ..heatmap import _HeatmapOptionsMixin, heatmap_layer, Heatmap, WeightedHeatmap
  from ..geotraitlets import InvalidPointException, InvalidWeightException
label_desc: Use image node_id 5 for calling the HeatmapLayer obj's underlying member method code with example usage: obj.test_weighted_pandas_df() without return types