MCPcopy Create free account
hub / github.com/plotly/plotly.py / test_non_matching_index

Function test_non_matching_index

tests/test_optional/test_px/test_px_input.py:413–430  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

411
412
413def test_non_matching_index():
414 df = pd.DataFrame(dict(y=[1, 2, 3]), index=["a", "b", "c"])
415
416 expected = pd.DataFrame(dict(index=["a", "b", "c"], y=[1, 2, 3]))
417
418 args = dict(data_frame=df, x=df.index, y="y")
419 out = build_dataframe(args, go.Scatter)
420 assert_frame_equal(expected, out["data_frame"].to_pandas())
421
422 expected = pd.DataFrame(dict(x=["a", "b", "c"], y=[1, 2, 3]))
423
424 args = dict(data_frame=None, x=df.index, y=df.y)
425 out = build_dataframe(args, go.Scatter)
426 assert_frame_equal(expected, out["data_frame"].to_pandas())
427
428 args = dict(data_frame=None, x=["a", "b", "c"], y=df.y)
429 out = build_dataframe(args, go.Scatter)
430 assert_frame_equal(expected, out["data_frame"].to_pandas())
431
432
433def test_splom_case(backend):

Callers

nothing calls this directly

Calls 1

build_dataframeFunction · 0.90

Tested by

no test coverage detected