Il s'agit de dépiler un tableau qui est en 2 D vers un tableau en 1 D.
import pandas as pd
import numpy as np
df = pd.read_excel("excel_file.xlsx",
sheet_name="sheetname",
usecols="C:P",
skiprows=4,
nrows=35)
# adjust accordingly
# column header
df.columns = np.arange(1, 15, 1)
# line header
df.index = list(np.arange(0.25, 9, 0.25))[::-1]
# do the unstacking
df_unstack = df.unstack().reset_index()
# lines are the data that are in the line header of the 2 D table
# columns are the data that are in the column header of the 2 D
# var are the value of the data in each cell
df_unstack.columns = ["lines", "column", "var"]