Hi
I have a csv about 300 MB with shape of (3000,20000), I used below code to plot heatmap. It takes forever like 4+ hours, I tested if I use small dataframe like shape of (300,5000), it only take 15second to plot the heatmap. so the code is valid. So for big dataframe, why it takes such long time to plot the heatmap, such as 4+hours . It is ridiculous. Is it related to dataframe quality? How to check where is the problem? I know it will take longer time for a big dataframe, but 4+ hours or even longer is unreasonable. there must be something wrong with dataframe itself.
By the way, I am using jupyter notebook inside VS code. Thanks for your help.
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from plotly.colors import qualitative
from plotly.offline import download_plotlyjs, init_notebook_mode, plot
timer_start=timeit.default_timer()
fig=go.Figure()
zmin_colorbar=150
zmax_colorbar=250
title_colorbar='Heatmap'
hover_text='data'
z_masked = df.values
trace0 = go.Heatmap(
z = z_masked.T, #df.values,
y = df_parquet_pyarrow.columns,
x = df_parquet_pyarrow.index,
colorscale= [
[0, 'rgb(0,0,139)'],
[0.25, 'rgb(0,0,255)'],
[0.45, 'rgb(0,255,255)'],
[0.65, 'rgb(0,128,0)'],
[0.85, 'rgb(255,255,0)'],
[1, 'rgb(255,0,0)']
],
colorbar=dict(
#thicknessmode:'fraction',
x=0.96, #1.01, #1.04, # starting location of colorbar in x, 1.02 means 2% of heatmap gap
y=0.45, #0.37, # from bottom of last subplot
len=0.55, #0.63, #1.06, 1-y
tickformat='.0f',
exponentformat='E',
tickwidth=1,
#tickformat:'6f',
ticks='outside',
thickness= 16, #8, # colorbar width
tick0=zmin_colorbar,
dtick=round((zmax_colorbar-zmin_colorbar)/10,0),
xanchor= 'left',
yanchor= 'bottom',
# tickmode='auto', #'array',
# nticks=10,
#ticktext=[-45,-30,-15,0,15],
#tickvals=[-45,-30,-15,0,15],
xpad= 0,
ypad= 0,
title=title_colorbar,
titleside='right',
titlefont=dict(size=16)
),
zmin=zmin_colorbar,
zmax=zmax_colorbar,
# hovertemplate='WellDepth: %{y} m<br>Time: %{x}<br>'+ \
# hover_text+': %{z} degC<extra></extra>', # extra to remove grey col;or trace0 default text
)
fig.add_trace(trace0) #,layout=layout_heatmap,
fig.show()