Skip to content

Very slow performance of create_annotated_heatmap for small dataset #2299

Closed
@haphaeu

Description

@haphaeu

This is taking over 4s to run, which seems excessively large for such small dataset:

import time
import numpy as np
import pandas as pd
import plotly.figure_factory as ff

dfi = pd.DataFrame(np.random.rand(3, 6))

t0 = time.time()

fig = ff.create_annotated_heatmap(
            z=dfi.values,
            x=dfi.columns.tolist(),
            y=dfi.index.tolist(),
            annotation_text=dfi.round(2).values,
        )

print(f'elapsed time {time.time()-t0:.3f} s')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions