Pandas Excelfile

I managed to get, some data displayed before, but have gone wrong somewhere. "iloc" in pandas is used to select rows and columns by number, in the order that they appear in the data frame. Pandas Read data with Pandas Back in Python: >>> import pandas as pd >>> pima = pd. See Working with Python Pandas and XlsxWriter for more details. Practice Files Excel: Linear Regression Example File 1 CSV: heightWeight_w_headers Let. More than 1 year has passed since last update. read_excel (r'Path where the Excel file is stored\File name. csv") \pima" is now what Pandas call a DataFrame object. Load Excel Spreadsheet As pandas Dataframe. They are extracted from open source Python projects. Hi Pandas Experts, I used the pandas (pd) skiprow attribute to set the first 18 rows to be skipped. ExcelFile is built into the Pandas ecosystem, so you import directly from Pandas: from pandas import ExcelFile Working With the File Path. In this article we will show how to create an excel file using Python. ExcelFile('2017年01回東京01日. import pandas xl_file = pandas. To convert a dataframe into a worksheet highlighting the header and index:. The following are code examples for showing how to use pandas. ExcelFile('pandas-test. Load Excel Spreadsheet As pandas Dataframe. From the module we import ExcelWriter and ExcelFile. read_excel are used to export and import excel which are installed by default We can check that by running below statement in SSMS: EXECUTE sp_execute_external_script. 戻り値: DataFrameまたはDataFramesの辞書 渡されたExcelファイルのDataFrame。. xlsx = ExcelFile('filename. NET component that provides a simple and efficient way to read, write, convert, and print native Microsoft Excel (XLSX, XLS) and other spreadsheet (ODS, CSV) formats and various document formats (HTML, PDF, XPS) from. Assuming your input is properly formatted you probably have an empty line somewhere at the end which is causing this so I would just add t. import pandas as pd xl = pd. We use xlrd package to read the data from Excel spreadsheets. Instructions 100 XP. python write to existing excel file (1). ExcelFile() to read complex #Excel files. I am reading an Excel file using Pandas and I feel like there has to be a better way to handle the way I create column names. unique() 次に、Indexの値に対して実行していきます。 ここから先に使われているのは pandas. CSV file type (known as comma-separated values or comma delimited text files) is one reliable, conversion-friendly file format. One of the major benefits of using Python and pandas over Excel is that it helps you automate Excel file processing by writing scripts and integrating with your automated data workflow. import pandas as pd writer = pd. They are extracted from open source Python projects. python - How to write to an existing excel file without overwriting data (using pandas)? up vote 32 down vote favorite 13 I use pandas to write to excel file in the following fashion: import pandas writer = pandas. DataFrameの場合、[]の中に指定する値のタイプによって以下のようなデータが取得できる。. Example: Pandas Excel example. OKdevTV pandas. I think we should be raising if an engine is specified in read_excel when the target is a pd. Pandas supports these approaches using the cut and qcut functions. To prevent pandas from doing this, a good guess would be specifying the dtype directly so that it doesn’t need to be guessed, but unfortunately this is not supported: import pandas as pd df = pd. The idea is that this object has all of the information needed to then apply some operation to each of the groups. parse('sheet_name') JSON import json json_data = json. We will read and explore a real Excel dataset and explore some of the advanced options available for parsing Excel data. Similarly, we can load Microsoft Excel files just as easily. this is the code I use:. x 系でところどころ異なるため参考にされる際は各記事の対象バージョンにご注意ください。. parse("Sheet1") print(df)-----You should setup virtualenv virtualenv Project # creates a new Project dir cd Project/bin # could just. xlsx) is there any other way to do this using pandas?. Load Excel Spreadsheet As pandas Dataframe. While Pandas itself supports conversion to Excel, this gives client code additional flexibility including the ability to stream dataframes straight to files. At first, none of my graphics programs worked. More than 1 year has passed since last update. It looks like a change to the API for parsing Microsoft Excel files was the problem. Python - Processing XLS Data - Microsoft Excel is a very widely used spread sheet program. Read the data and plotting with multiple markers December 5, 2017 July 26, 2019 rischan Let's assume that we have an excel data and we want to plot it on a line chart with different markers. xlfile = pd. pythonに読ませるなら、文字形式はutf-8にして欲しいものですが、 データ出力側も色々な事情ありますから、受け側で変換して読み込まなければならないケースも多々あります。 Windows&Excel. Pandas support will say that it's an xlrd problem, not a pandas problem, and will close (this) thread. It can read, filter and re-arrange small and large data sets and output them in a range of formats including Excel. Excel is a popular and powerful spreadsheet application for Windows. DataFrameをExcelファイル(拡張子:. Python Pandas is a Python data analysis library. This saves you the time of converting the file. read_excel(io, sheet_name=0,. I'm trying to ready excel using pandas. Built on top of Numpy, Pandas makes high-level tasks easy, and you can write your results back to an Excel file, so you can continue to share the results of your analysis with non-programmers. This article will briefly describe why you may want to bin your data and how to use the pandas functions to convert continuous data to a set of discrete buckets. The key distinction in Python is that a DataFrame is itself a variable and you can work with any number of DataFrames at one time. This arrangement is useful whenever a column contains a limited set of values. DataFrame, pandas. ExcelFile("Experiment_results. Will remove the header rows from second to last files and finally combine them to create one single file. Pandas will try to call date_parser in three different ways, advancing to the next if an exception occurs: 1) Pass one or more arrays (as defined by parse_dates) as arguments; 2) concatenate (row-wise) the string values from the columns defined by parse_dates into a single array and pass that; and 3) call date_parser once for each row using one or more strings (corresponding to the columns defined by parse_dates) as arguments. ExcelFile( file_name ) df = xl_file. Used by Python Pandas for Data Analysis. Hi Pandas Experts, I used the pandas (pd) skiprow attribute to set the first 18 rows to be skipped. The method read_excel loads xls data into a Pandas dataframe:. Python Pandas read Excelの書き方をご教示ください。 内容としては、先物の価格データが入力されているエクセルファイルの(i,3) i=2 から列の最後尾までのデータを取得したいです。 ファイル形式はExcelが好ましいです。. Read Excel column names We import the pandas module, including ExcelFile. DATASET: pandas-test-xlsx, Sheet - Test-Sheet # Read the whole file $ file = pandas. We use cookies for various purposes including analytics. Introduction to Pandas¶. This function works perfectly in Jupyter notebook but fails in Pycharm with the following message:. parse( xl_file. read_fwf pandas. I'm open to suggestions on ways I can speed this up, even convertin. argsort pandas. I think we should be raising if an engine is specified in read_excel when the target is a pd. I'm open to suggestions on ways I can speed this up, even convertin. To convert files automatically without using Excel, through a desktop icon, scheduled tasks or from command prompt, use FileSculptor. 5 and higher. parse¶ ExcelFile. errors, pandas. messagebox is needed to pop up message boxes to give certain notifications to the user. Pandas development started in 2008 with main developer Wes McKinney and the library has become a standard for data analysis and management using Python. We first need to import Pandas and load excel file, and then parse excel file sheets as a Pandas dataframe. Retrieving Series/DataFrame Information Selecting, Boolean Indexing & Setting Basic Information Use the following import convention: By Position >>> df. To convert a dataframe into a worksheet highlighting the header and index:. ExcelFile(PATH\FileName. http://pandas. Maybe ExcelFile in Pandas could take path_or_buffer as argument, and pass along the correct one to xlrd. xls files and read the index value or column value accordingly. From the module we import ExcelWriter and ExcelFile. xlsb was implemented from the Excel 2007 version, solving the problem of managing spreadsheets containing a lot of information,. The method read_excel loads xls data into a Pandas dataframe: If you have a large excel file you may want to specify the sheet: Related course. In this post, focused on learning python programming, we’ll look at how to leverage tools like Pandas to explore and map out police activity in Montgomery County, Maryland. extensions. Here is a template that you may apply in Python to export your DataFrame: df. pandas is a NumFOCUS sponsored project. The extension or format. parse¶ ExcelFile. The … - Selection from Mastering Exploratory Analysis with pandas [Book]. Iterate over exchanges using a for loop with exchange as iterator variable. pyがあってそれを読み込んでしまっているように思います。 共有 | この回答を改善する 回答日時: 17年9月22日 5:23. Pandas DataCamp Learn Python for Data Science Interactively Series DataFrame 4 Index 7-5 3 d c b A one-dimensional labeled array a capable of holding any data type Index Columns A two-dimensional labeled data structure with columns of potentially different types The Pandas library is built on NumPy and provides easy-to-use. See matplotlib documentation online for more on this subject; If kind = 'bar' or 'barh', you can specify relative alignments for bar plot layout by position keyword. pyc in read_excel(path_or_buf, sheetname, kind, **kwds). Python Pandas read Excelの書き方をご教示ください。 内容としては、先物の価格データが入力されているエクセルファイルの(i,3) i=2 から列の最後尾までのデータを取得したいです。 ファイル形式はExcelが好ましいです。. This object keeps track of both data (numerical as well as text), and column and row headers. Now we have learned how to read Excel and CSV files to a Panda dataframe, how to add and remove columns, and subset the created dataframe. The method read_excel() reads the data into a Pandas Data Frame, where the first parameter is the filename and the second parameter is the sheet. Is there a package repo for this or do I have to install from source?. The entire file is read when using the function ExcelFile(). xlsx) is there any other way to do this using pandas?. Pandas Cheat Sheet for Data Science in Python A quick guide to the basics of the Python data analysis library Pandas, including code samples. parse('sheet_name') JSON import json json_data = json. csv") \pima" is now what Pandas call a DataFrame object. Some of the examples are somewhat trivial but I think it is important to show the simple as well as the more complex functions you can find elsewhere. pandasのデータフレーム の列の入れ替え(移動)について 解決済 簡略辞書フォーマットを追加して、janomeで形態素解析をしたいです。. parse¶ ExcelFile. iloc[:,1] [/code]'iloc' is used to slice the dataframe by column indices. com Pandas DataCamp Learn Python for Data Science Interactively Series DataFrame 4 Index 7-5 3 d c b A one-dimensional labeled array a capable of holding any data type Index Columns A two-dimensional labeled data structure with columns. Reading Excel Spreadsheets with Python, Flask, and Openpyxl Data stored in Excel spreadsheets can be hard to read with anything other than Excel and it’s especially tough to compare two specific datasets within all that data. parse (sheetname=0, header=0, skiprows=None, skip_footer=0, names=None, index_col=None, parse_cols=None, parse_dates=False, date. Excel extensions - Formats in excel. Today, more mature in the use of "the big Panda", I decided to bring a list of my favorite commands. I originally tried the PANDAS read_html option at first but received many NaN entries as well as the fact that it did not seem to import all of the data from the HTML table. You can vote up the examples you like or vote down the ones you don't like. parse( xl_file. Pythonモジュールのpandasには、その直下に181個という大量のメソッドがあります。さらにそれぞれのメソッドの下や、DataFrameオブジェクトもメソッドを持っており総数は非常に膨大なため、せっかくの便利機能に気付いていない、というケースが多いのではないでしょうか。. Pandas also has excellent methods for reading all kinds of data from Excel files. This document explains how to use the XlsxWriter module. read_excel — pandas 0. More specifically, I want a stacked bar graph, which is apparently not trivial. 7/site-packages/pandas/io/excel. Clone via HTTPS Clone with Git or checkout with SVN using the repository's web address. The method read_excel() reads the data into a Pandas Data Frame, where the first parameter is the filename and the second parameter is the sheet. Memory optimization mode for writing large files. read_excel(ExcelFile, index_col='Year'). This is a very powerful and flexible library and used frequently by (aspiring) data scientists to get their data into data structures that are highly expressive for their analyses. 4 worksheets per Excel file). Read xls with Pandas Pandas, a data analysis library, has native support for loading excel data (xls and xlsx). read_csv("pima. MS Excel 2007: Email the active worksheet. View Timezones # Show ten time zones. Pandas is a very powerful and scalable tool for data analysis. real # get the first row as a list you can loop through. Excel ファイルを読み込む pandas. Python has the os module, which provides us with many useful methods to work with directories (and files as well). Excelfile (): # Import pandas import pandas as pd # Assign spreadsheet filename to `file` file = 'example. sheet_names) #显示出读入excel文件中的表名字,一个列表. In this tutorial you're going to learn how to work with large Excel files in Pandas, focusing on reading and analyzing an xls file and then working with a subset of the original data. Python has no problem reading JSON. See Working with Python Pandas and XlsxWriter for more details. import pandas as pd from pandas import ExcelWriter from pandas import ExcelFile fileName = r "My Workbook. In this article we will show how to create an excel file using Python. The key distinction in Python is that a DataFrame is itself a variable and you can work with any number of DataFrames at one time. parse ExcelFile. Import the Excel sheets as DataFrame objects using the [code ]pandas. I can't make py2exe work with this simple Python script. Python excel relationship is flourishing with every day. DataFrame, pandas. Pandas is a very powerful and scalable tool for data analysis. csv") \pima" is now what Pandas call a DataFrame object. In this article we will read excel files using Pandas. Here, Pandas read_excel method read the data from the Excel file into a Pandas dataframe object. Active 1 year, 4 months ago. The method read_excel() reads the data into a Pandas Data Frame, where the first parameter is the filename and the second parameter is the sheet. ExcelFile( file_name ) df = xl_file. Excel is one of the most popular and widely-used data tools; it's hard to find an organization that doesn't work with it in some way. In this article you will learn how to read a csv file with Pandas. Load Excel File # Create URL to Excel file (alternatively this can be a. We can use functions provided by dictionary data type which will populate both keys and dictionaries in the same step of for loop. Using xlrd module, one can retrieve information from a spreadsheet. xls" df = pd. plotting, and pandas. This is a very powerful and flexible library and used frequently by (aspiring) data scientists to get their data into data structures that are highly expressive for their analyses. Preliminaries # Load library import pandas as pd. They are extracted from open source Python projects. read_excel('2017年01回中山01日. Joe Tatusko 10,544 views. Python For Data Science Cheat Sheet Pandas Basics Learn Python for Data Science Interactively at www. argsort pandas. It works perfectly. Pandas fluency is essential for any Python-based data professional, people interested in trying a Kaggle challenge, or anyone seeking to automate a data process. Related course: Data Analysis with Python Pandas. ExcelFile is built into the Pandas ecosystem, so you import directly from Pandas: from pandas import ExcelFile Working With the File Path. In this article we will show how to create an excel file using Python. For example, cells with "entered values" (non-formula cells) are formatted with a green fill color in the side-by-side grid, and with a green font in the pane results list. It provides you with high-performance, easy-to-use data structures and data analysis tools. Built on top of Numpy, Pandas makes high-level tasks easy, and you can write your results back to an Excel file, so you can continue to share the results of your analysis with non-programmers. xlsx) # get the first sheet as an object sheet1 = xlsx. python小白,不会用pandas导入数据,求大神解答 [问题点数:50分]. * namespace are public. Starting with the 0. Memory optimization mode for writing large files. Neste vídeo de Pandas eu demonstro como abrir arquivos em Excel usando o read_excel e o. I'm open to suggestions on ways I can speed this up, even convertin. read_excel(file, 'Test-Sheet') # Work with the dataframe now contained in the mysheet variable $ mysheet. xlsx file to a pandas dataframe and desire converting to a list of tuples. Reading and writingExcel files in Python pandas. I have just upgraded to Pandas 0. With Excel being so pervasive, data. ExcelFile("Example. DataFrame, pandas. The method read_excel() reads the data into a Pandas Data Frame, where the first parameter is the filename and the second parameter is the sheet. In this article we will show how to create an excel file using Python. As advertised, we only need one Python library to execute this task: Pandas! Our data is an Excel file with several tabs. ExcelFile( file_name ) df = xl_file. Excel extensions - Formats in excel. Click to convert your XLS file now. I originally tried the PANDAS read_html option at first but received many NaN entries as well as the fact that it did not seem to import all of the data from the HTML table. 이 때 open한 시트를 객체로 받습니다. Read xls with Pandas Pandas, a data analysis library, has native support for loading excel data (xls and xlsx). xls) Documents Using Python's xlrd; In this case, I've finally bookmarked it:). Assignment 3 - More Pandas: This assignment requires more individual learning then the last one did - you are encouraged to check out the pandas documentation to find functions or methods you might not have used yet, or ask questions on Stack Overflow and tag them as pandas and python related. but for some excel which put all content into one cell, the result from pandas will omit some word. Parsing Data 검색할 내용을 입력하세요 : 모니터 제품명. Pandas writes Excel files using the Xlwt module for xls files and the Openpyxl or XlsxWriter modules for xlsx files. If you are dealing with complicated or large datasets, seriously consider Pandas. One of it is importing textual data from CSV and Excel files that is automatically converted to numeric values when it only consists of digits. So while Excel isn't going away, Python is a great tool if you want clean data and perform higher-level data analysis. Here, Pandas read_excel method read the data from the Excel file into a Pandas dataframe object. import pandas as pd #各シートに分かれたデータを一つのDataFrameにする excel = pd. read_excel(fileName) Load this script into the Python data source in Power Query and you are ready to go!. Since pandas is such a core part of any data analysis in python, I frequently find myself using it to generate quick plots that help me determine if it is worth doing more complex plots later. import pandas as pd import glob from pandas import ExcelWriter from pandas import ExcelFile import time, sys. ExcelFile( file_name ) df = xl_file. WHO AM I? • Managing Director, Nerevu Development • Founder of Arusha Coders • Author of several popular Python packages • @reubano on Twitter and GitHub 3. The extension or format. _parse_excel. """ from __future__ import print_function, division from datetime import datetime, date, time import warnings import re import numpy as np import pandas. parse( xl_file. The method read_excel() reads the data into a Pandas Data Frame, where the first parameter is the filename and the second parameter is the sheet. Although subsets may come in handy there are no need for doing this when you want to look at specific groups in the data. NumPyのcorrcoefはデフォルトでは行間の相関係数を計算する。そのため、Rのcor関数と同じ出力を得るためには転置するか、rowvar=Falseをオプションとして指定する必要あり。 一方のpandasのデータフレームのcorr()メソッドは、列間の相関を計算するためRのco…. xls" df = pd. Python has no problem reading JSON. Description. They are extracted from open source Python projects. Lets use the rst columns and the index column: >>> import pandas as pd. Write Excel We start by importing the module pandas. It has not actually computed anything yet except for some intermediate data about the group key df['key1']. xlsx file using the Pandas Library of python and port the data to a postgreSQL table. import pandas as pd # open the file xlsx = pd. http://pandas. Those are just headings and descriptions. It is quite high level, so you don't have to muck about with low level details, unless you really want to. Iterate over exchanges using a for loop with exchange as iterator variable. This saves you the time of converting the file. 5 and higher. The problem I have is all the examples require the sy. Question: In Microsoft Excel 2007, I have a large workbook at is 97MB in size. shee… https://t. 20 Dec 2017. import pandas as pd from pandas import DataFrame, Series Note: these are the recommended import aliases The conceptual model DataFrame object: The pandas DataFrame is a two-dimensional table of data with column and row indexes. import pandas as pd from pandas import ExcelWriter from pandas import ExcelFile fileName = r "My Workbook. We first need to import Pandas and load excel file, and then parse excel file sheets as a Pandas dataframe. Nothing on this blog or the associated twitter account should be taken as financial advice. iloc[, ], which is sure to be a source of confusion for R users. parse (ExcelFile, …) See the read_excel docstring for more info on accepted parameters. The openpyxl module allows your Python programs to read and modify Excel spreadsheet files. ExcelFile() to read complex #Excel files. 本日は気分を変えて PandasにてXLSの読込 拡張子はxlsxを読み込む事にします。 データセットは横浜市のオープンデータを読込やすいように 英字に変換したもの←これはコツでカラムやINDEXは英字表記が良いと思う Pandasは先日Anacondaでインストール済みのものを使用する 実行環境はやはりAnacond…. More than 1 year has passed since last update. edu (full link in following script). Preliminaries # Load library import pandas as pd. Like many pandas functions, cut and qcut may seem simple but there is a lot of capability packed into those functions. I am reading from an Excel sheet and I want to read certain columns: column 0 because it is the row-index, and columns 22:37. Joe Tatusko 10,544 views. Python has no problem reading JSON. Gaining access to the DAT. It was a pain. DataFrameGroupBy. The entire file is read when using the function ExcelFile(). Instructions 100 XP. Related course Data Analysis with Python Pandas. pandas will fallback to the usual parsing if either the format cannot be guessed or the format that was guessed cannot properly parse the entire column of strings. 5 and higher. With Excel being so pervasive, data. In recent versions of pandas, read_excel ensures that it has an ExcelFile object (and creates one if it doesn't), and then calls the _parse_excel method directly:. To convert files automatically without using Excel, through a desktop icon, scheduled tasks or from command prompt, use FileSculptor. we will learn how to get the unique values (rows) of a dataframe in python pandas with an example using drop_duplicates() function in pandas. How to Convert CSV to Excel Manually or Automatically How to manually convert a CSV file to Excel in a few easy steps. When we convert a column to the category dtype, pandas uses the most space efficient int subtype that can represent all of the unique values in a column. Pandas with XlsxWriter Examples. You can read more about the Pandas package at the Pandas project website. Thanks in Advance Ravi. And ExcelFile. read_csv('filename. Will remove the header rows from second to last files and finally combine them to create one single file. Its user friendliness and appealing features makes it a very frequently used tool in Data Science. View Timezones # Show ten time zones. parse¶ ExcelFile. It is based on numpy/scipy, sort of a superset of it. ExcelFile is built into the Pandas ecosystem, so you import directly from Pandas: from pandas import ExcelFile Working With the File Path. Clone via HTTPS Clone with Git or checkout with SVN using the repository's web address. DAT files are files with an extension that isn't associated with a specific application or program and can be almost any type of file including video, media or text. Free Bonus: Click here to download an example Python project with source code that shows you how to read large. read_excel(file, 'Test-Sheet') # Work with the dataframe now contained in the mysheet variable $ mysheet. OK, I Understand. ExcelFile(PATH\FileName. It's a must-have for any data analyst programming in Python. Now we have learned how to read Excel and CSV files to a Panda dataframe, how to add and remove columns, and subset the created dataframe. If you ask users of R what the best way is to import data directly from Microsoft Excel, most of them will probably answer that your best option is to first export from Excel to a CSV file and then use read. 2010) when opening files like csv files (like you can in Open Office Calc)? I When I try to open a csv file encoded in Japan. i will write in german but also in englisch so excuse me if my school englisch is bad :D in this diary i will write my whole lifestory nad problems and thoughts and just everything thats going on in my life, because i have nobody i can talk to. ExcelFile( file_name ) df = xl_file. xlsx = ExcelFile('filename. Finding out sheet names To find out the name of a sheet, pass the Excel file to the ExcelFile class and call the sheet_names property on the resulting object. We use cookies for various purposes including analytics. All classes and functions exposed in pandas. It is a matrix where each column and each row has a name. To work with Excel using Pandas, you need an additional object named ExcelFile. parse ExcelFile. Python for Business: Identifying Duplicate Data Jan 17, 2016 | Blog , Digital Analytics , Programmatic Analysis Data Preparation is one of those critical tasks that most digital analysts take for granted as many of the analytics platforms we use take care of this task for us or at least we like to believe they do so. I'm starting to mess around with importing Excel sheets into gridviews. May I ask, does Pandas load the excel sheet in ExcelFile? Also, say I look up the list of sheets and decide to load N of them, should I at that point call read_excel (the new interface) for each sheet, or stick to x1. to_excel (writer, sheet_name = 'Sheet1') # Close the Pandas Excel writer and output the Excel file. sheet_names attribute of xls and assign to exchanges. 例えばcsvファイルをpandasで読み込んだとき、要素が空白だったりすると欠損値NaN(Not a Number)だと見なされる。欠損値を除外(削除)するにはdropna()メソッド、欠損値を他の値に置換(穴埋め)するにはfillna()メソッドを使う。. Python offers an easy way to read information from excel files like: pandas. Related course: Data Analysis with Python Pandas. Reading a. You can use matplotlib to customize pandas plots or use the basic insights to create something more complex in a tool like seaborn. ExcelFile(PATH\FileName. Read xls with Pandas Pandas, a data analysis library, has native support for loading excel data (xls and xlsx). The pandas package has already been loaded for you as pd to help you with this task. I have just upgraded to Pandas 0. parse didn't do much more than call ExcelFile. ExcelFile( file_name ) df = xl_file. I can't make py2exe work with this simple Python script. Pandas is a data analaysis module. In this video, we cover reading from a CSV as well as writing to a CSV file. sheet_names # see all sheet names xl. Python For Data Science Cheat Sheet Asking For Help Dropping. ExtensionArray. astype pandas. 0 documentation ここでは以下の内容について説明する。xlwt, openpyxlのインストール DataFrameをExcelファイルに書き込み(新規作成・上書き保存) 複数のDataFrameをExce. python write to existing excel file (1). 20 Dec 2017.