Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: perform_update serializer django 
Python :: python line break inside string 
Python :: how to get the realpath with python 
Python :: if string in lost py 
Python :: créer fonction python 
Python :: duplicates in python list 
Python :: torch tensor to pandas dataframe 
Python :: pandas lambda applu 
Python :: pandas dataframe to excel hyperlink length limit 
Python :: how to set numerecal index in pandas 
Python :: delete variable python 
Python :: python .findall 
Python :: ubuntu 20.10 python 3.8 
Python :: discord py fetch message 
Python :: subscript in python 
Python :: df sort by column names 
Python :: how to install django 
Python :: python get third friday of the month 
Python :: convert pandas group to dict 
Python :: python for in for in 
Python :: python check if file is writable 
Python :: python compute cross product 
Python :: remove string from list in python 
Python :: matplotlib legend get handles 
Python :: raise 400 error python 
Python :: pandas read csv dtype list 
Python :: pygame check collision 
Python :: Get a list of categories of categorical variable (Python Pandas) 
Python :: django model example 
Python :: python dictionary pop key 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =