I have a dataframe with 76 columns. 1st column contains date values and the other 75 columns are groundwater levels form 75 different boreholes. I want to cluster the boreholes based on the trend (boreholes that follow the same pattern are grouped together). How can I do this in python?
Here is a sample of my dataframe
df = pd.DataFrame({
'Date': [1980, 1985, 1990, 1995, 2000],
'borehole1': [53, 43, 33, 22, 18],
'borehole2': [50, 40, 30, 50, 40],
'borehole3': [22, 32, 42, 32, 13],
'borehole4': [60, 65, 82, 72, 60],
'borehole5': [80, 70, 60, 80, 70],
'borehole6': [43, 33, 22, 18, 13]
})
df.plot()
In this example I would therefore have 3 clusters:
- borehole1 & borehole 6 >> cluster 1
- borehole2 & borehole 5 >> cluster 2
- borehole 4 & borehole 3 >> cluster 3
