[USER (data scientist)]: Thanks! What about the relationship between credit history and loan duration? Please generate a Series showing the average loan duration for each credit history category in the dataset.
My template of code snippet is:

---BEGIN CODE TEMPLATE---

import pandas as pd 
from sklearn.preprocessing import LabelEncoder
import pickle
 
# Load the dataset 
credit_customers = pd.read_csv("credit_customers.csv") 
 
# YOUR SOLUTION BEGIN:
<code1>
[COMPLETE YOUR CODE] 
</code1>
# YOUR SOLUTION END

# Print the relationship 
print("\nRelationship between credit history and loan duration:\n", credit_history_duration_relationship) 

# save data
pickle.dump(credit_history_duration_relationship, open("./pred_result/credit_history_duration_relationship.pkl","wb"))

---END CODE TEMPLATE---

[YOU (AI assistant)]: To check that out, you can use this code:
'''
import pandas as pd 
from sklearn.preprocessing import LabelEncoder
import pickle
 
# Load the dataset 
credit_customers = pd.read_csv("credit_customers.csv") 
 
# YOUR SOLUTION BEGIN:
