“python pd.dataframe.from_records eliminar encabezado” Código de respuesta

python pd.dataframe.from_records eliminar encabezado

df.rename(columns=df.iloc[0]).drop(df.index[0])
Ian Selley

python pd.dataframe.from_records eliminar encabezado

new_header = df.iloc[0] #grab the first row for the header
df = df[1:] #take the data less the header row
df.columns = new_header #set the header row as the df header
Ian Selley

Respuestas similares a “python pd.dataframe.from_records eliminar encabezado”

Preguntas similares a “python pd.dataframe.from_records eliminar encabezado”

Más respuestas relacionadas con “python pd.dataframe.from_records eliminar encabezado” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código