How can I make a double histogram and regulate the bins?

I have the following data

data = {
    'CU': [1.5, 2.3, 1.8, 3.2, 2.5, 2.0, 3.8, 3.0],
    'ER': [0.2, 0.5, np.nan, 0.7, 0.8, 0.4, 0.9, 0.6],

df = pd.DataFrame(data)

# Create a new column 'Valid_CU' where CU values are replaced with NaN if ER is NaN
df['Valid_CU'] = df['CU'].where(~df['ER'].isna())

I want to do this but with plotly

One key component that I want is that I want to customize the number of bins I want to show. So far I have been able to do some histograms with plotly but I can’t regulate the bins