xlwings

How to solve import error for pandas using iPython Notebook on Windows?

爷,独闯天下 提交于 2019-12-01 04:39:07
I'm trying to import pandas while using iPython. My overall purpose is to use XLwings. I'm on Windows 7 and have used Anaconda to install Python, pandas and all the dependencies. Here is my code: from pandas import DataFrame Which gives: ImportError Traceback (most recent call last) <ipython-input-7-26dfcabfb474> in <module>() ----> 1 from pandas import DataFrame C:\Users\Accounting\Anaconda\lib\site-packages\pandas\__init__.py in <module>() 11 "pandas from the source directory, you may need to run " 12 "'python setup.py build_ext --inplace' to build the C " ---> 13 "extensions first.".format

How to solve import error for pandas using iPython Notebook on Windows?

▼魔方 西西 提交于 2019-12-01 02:36:12
问题 I'm trying to import pandas while using iPython. My overall purpose is to use XLwings. I'm on Windows 7 and have used Anaconda to install Python, pandas and all the dependencies. Here is my code: from pandas import DataFrame Which gives: ImportError Traceback (most recent call last) <ipython-input-7-26dfcabfb474> in <module>() ----> 1 from pandas import DataFrame C:\Users\Accounting\Anaconda\lib\site-packages\pandas\__init__.py in <module>() 11 "pandas from the source directory, you may need

Read data in Excel column into Python list

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 20:34:17
I am using python xlwings to read a column of data in Excel 2013. Column A is populated with numbers. To import this column into a python list py_list , I have the following code; import xlwings as xw wb = xw.Book('BookName.xlsm') sht = xw.Book('SheetName') py_list = sht.range('A2:A40').value The above code works if the column data is populated at A2:A40 . However, the column data can keep growing. Data can grow and stretch to A2:A46 or A2:A80 . The last row is empty. It is not known at compile time how many rows of data is in this column. How can I modify the code to detect the empty cell at

Read data in Excel column into Python list

99封情书 提交于 2019-11-30 03:58:28
问题 I am using python xlwings to read a column of data in Excel 2013. Column A is populated with numbers. To import this column into a python list py_list , I have the following code; import xlwings as xw wb = xw.Book('BookName.xlsm') sht = xw.Book('SheetName') py_list = sht.range('A2:A40').value The above code works if the column data is populated at A2:A40 . However, the column data can keep growing. Data can grow and stretch to A2:A46 or A2:A80 . The last row is empty. It is not known at

Writing and modifying an existing workbook using Python

泪湿孤枕 提交于 2019-11-29 15:52:30
I am new to Python and working on a project that I could use some help on. So I am trying to modify an existing excel workbook in order to compare stock data. Luckily, there was a program online that retrieved all the data I need and I have successful been able to pull the data and write the data into a new excel file. However, the goal is to pull the data and put it into an existing excel file. Furthermore, I need to overwrite the cell values in the existing file. I believe xlwings is able to do this and I think my code is on the right track, but I ran into an unexpected error. The error I

Writing and modifying an existing workbook using Python

懵懂的女人 提交于 2019-11-28 10:34:19
问题 I am new to Python and working on a project that I could use some help on. So I am trying to modify an existing excel workbook in order to compare stock data. Luckily, there was a program online that retrieved all the data I need and I have successful been able to pull the data and write the data into a new excel file. However, the goal is to pull the data and put it into an existing excel file. Furthermore, I need to overwrite the cell values in the existing file. I believe xlwings is able

How do I call an Excel macro from Python using xlwings?

China☆狼群 提交于 2019-11-27 02:01:40
I've read the API docs for xlwings, and played around with Workbook and Sheet objects in the interpreter, but I can't figure out how to call a macro from Python. How do I use xlwings to call an Excel macro from Python? This is not implemented yet, but there's an open issue for it, see here . In the meantime, you can work around it like so (this is for Windows, but the Mac version works accordingly, see again in the issue ): from xlwings import Workbook wb = Workbook(...) wb.application.xl_app.Run("your_macro") update : for more recent versions, you have to do: from xlwings import Workbook,

How do I call an Excel macro from Python using xlwings?

可紊 提交于 2019-11-26 12:29:44
问题 I\'ve read the API docs for xlwings, and played around with Workbook and Sheet objects in the interpreter, but I can\'t figure out how to call a macro from Python. How do I use xlwings to call an Excel macro from Python? 回答1: This is not implemented yet, but there's an open issue for it, see here. In the meantime, you can work around it like so (this is for Windows, but the Mac version works accordingly, see again in the issue): from xlwings import Workbook wb = Workbook(...) wb.application