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

Function test_int_col_names

tests/test_optional/test_px/test_px_input.py:468–476  ·  view source on GitHub ↗
(constructor)

Source from the content-addressed store, hash-verified

466
467
468def test_int_col_names(constructor):
469 # DataFrame with int column names
470 lengths = constructor({"0": np.random.random(100)})
471 fig = px.histogram(lengths, x="0")
472 assert np.all(nw.from_native(lengths).to_numpy().flatten() == fig.data[0].x)
473 # Numpy array
474 ar = np.arange(100).reshape((10, 10))
475 fig = px.scatter(ar, x=2, y=8)
476 assert np.all(fig.data[0].x == ar[:, 2])
477
478
479def test_data_frame_from_dict():

Callers

nothing calls this directly

Calls 3

constructorFunction · 0.85
histogramMethod · 0.80
scatterMethod · 0.80

Tested by

no test coverage detected