code: def test_pandas_json_encoding(self):
      j1 = _json.dumps(df["col 1"], cls=utils.PlotlyJSONEncoder)
      print(j1)
      print("\n")
      assert j1 == '[1, 2, 3, "2014-01-05T00:00:00", null, null, null]'
  
      # Test that data wasn't mutated
      assert_series_equal(
          df["col 1"],
          pd.Series(
              [1, 2, 3, dt(2014, 1, 5), pd.NaT, np.NaN, np.Inf],
              name="col 1",
          ),
      )
  
      j2 = _json.dumps(df.index, cls=utils.PlotlyJSONEncoder)
      assert j2 == "[0, 1, 2, 3, 4, 5, 6]"
  
      nat = [pd.NaT]
      j3 = _json.dumps(nat, cls=utils.PlotlyJSONEncoder)
      assert j3 == "[null]"
      assert nat[0] is pd.NaT
  
      j4 = _json.dumps(rng, cls=utils.PlotlyJSONEncoder)
      assert j4 == '["2011-01-01T00:00:00", "2011-01-01T01:00:00"]'
  
      j5 = _json.dumps(ts, cls=utils.PlotlyJSONEncoder)
      assert j5 == "[1.5, 2.5]"
      assert_series_equal(ts, pd.Series([1.5, 2.5], index=rng))
  
      j6 = _json.dumps(ts.index, cls=utils.PlotlyJSONEncoder)
      assert j6 == '["2011-01-01T00:00:00", "2011-01-01T01:00:00"]'
  
imports: import datetime
  import math
  import decimal
  from datetime import datetime
  from unittest import TestCase
  from time import time
  import pytest
  import numpy
  import pandas
  import pytz
  from pandas.testing import assert_series_equal
  import json
  import os
  import base64
  from plotly import optional_imports, utils
  import plotly.graph_objects
  from plotly.graph_objs import Scatter, Scatter3d, Figure, Data
  from plotly.utils import get_by_path
  from PIL import Image
label_desc: Use image node_id 12 for calling the TestJSONEncoder obj's underlying member method code with example usage: obj.test_pandas_json_encoding() without return types