Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

create excel file python

#import openpyxl  # Must be as least installed, import is optional
import pandas as pd
import numpy as np
# Create dataframe with your data; 
df = pd.DataFrame(np.array([[23, 99, 78], [65, 95, 90], [90, 98, 96]]), columns=['Bob', 'Dilan', 'Live'])
df
   Bob  Dilan  Live
0   23     99    78
1   65     95    90
2   90     98    96
# Export the dataframe as Excel File
# sheet_name="Your Sheet Name" is optionnal
df.to_excel(r'C:UsersRonDesktopFile_Name.xlsx', sheet_name="Your Sheet Name" ,index = False)
 
PREVIOUS NEXT
Tagged: #create #excel #file #python
ADD COMMENT
Topic
Name
5+7 =