Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

279
Views
Ocultar columnas al usar to_excel

Tengo dos DataFrames, cada uno con varias columnas.

Los estoy guardando en Excel en diferentes hojas.

Para el marco de dir_tree_df , me gustaría ocultar las primeras 3 hojas. Para el marco de table_of_contents_df , me gustaría ocultar la primera columna.

es posible? He visto una posible solución aquí, pero no estoy seguro de cómo implementarla en mi código.

¿Es posible crear un archivo de Excel con columnas ocultas en Python usando pandas?

Mi código

 with pd.ExcelWriter(target_directory + 'output_test.xlsx') as writer: table_of_contents_df.to_excel(writer, sheet_name='Contents', index = False) dir_tree_df.to_excel(writer, sheet_name='Data', index = False)
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Creo que lo resolví. Los documentos ayudaron:
https://xlsxwriter.readthedocs.io/working_with_pandas.html https://xlsxwriter.readthedocs.io/worksheet.html#worksheet

 with pd.ExcelWriter(target_directory + 'output_test.xlsx', engine = 'xlsxwriter') as writer: table_of_contents_df.to_excel(writer, sheet_name='Contents', index = False) dir_tree_df.to_excel(writer, sheet_name='Data', index = False) worksheet = writer.sheets['Contents'] worksheet.set_column('A:A', None, None, {'hidden': 1}) worksheet = writer.sheets['Data'] worksheet.set_column('A:C', None, None, {'hidden': 1})
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!