Try the distfit (or fitdist) library.
https://erdogant.github.io/distfit
pip install distfitimport numpy as np# Example dataX = np.random.normal(10, 3, 2000)y = [3,4,5,6,10,11,12,18,20]# From the distfit library import the class distfitfrom distfit import distfit# Initializedist = distfit()# Search for best theoretical fit on your emperical datadist.fit_transform(X)# Plotdist.plot()# summay plotdist.plot_summary()
So in your case it would be:
dist = distfit(distr='lognorm')dist.fit_transform(X)