You can use the xverse package in python for this.
First of all install the xverse package using Anaconda Prompt:
pip install xverse
Note: I'm also showing how to make bins.
Then import MonotonicBinning from the xverse package in your notebook and make bins.
from xverse.transformer import MonotonicBinning
clf = MonotonicBinning()
clf.fit(X, y)
output_bins = clf.bins
Where X is the set of features(of which you want to replace by woe values) as pandas Dataframe and y is the target variable in form of an array
Now store the bins in a separate dataset with the same column names:
X1 = clf.transform(X)
Now import WOE from the xverse package
from xverse.transformer import WOE
clf1 = WOE()
clf1.fit(X1, y)
X2 = clf1.transform(X1)
X2 is the required dataframe of features replaced by their respective woe values