XLSX

How to use pandas to select certain columns in csv file

99封情书 提交于 2019-12-11 04:08:56
问题 I only just started my coding journey in order to and have watched a bunch of tutorials on youtube and am now trying to 'import' a dataset from SPSS into python using jupyter. So far I've managed to convert the .sav into a .csv file and read it using the code below. I want to select certain columns in my data and store them in a new csv file in order to do some analysis on them and try to build a script to predict certain things and characteristics. Problem is i have hundreds of data columns

Excel Date field value differs from c# dateTime by 1 day while reading excel file with EEPlus

一曲冷凌霜 提交于 2019-12-11 03:43:21
问题 I have a problem with getting correct date field value from excel (.xlsx) file with EEPlus library. The particular problem is that in excel i have e.g. 1900.01.04, but in C# I get 1900.01.03. I had an idea, that when I read date value from excel it (EEPlus) converts it to utc and I should convert it to local time zone, but as time values of date object are nil it's probably not the case. var date = (DateTime) Worksheet.Cells[row, column].Value; Thanks! 回答1: If the EEPlus date differs from the

Read data from read only xlsm file using Java Apache POI

霸气de小男生 提交于 2019-12-11 01:56:59
问题 I'm trying to read data from a read only xlsm using java apache poi, but when I use XSSF workbook it doesn't seem to be able to access the file and HSSF workbooks only work for xls files. My code looks like this: try { FileInputStream file = new FileInputStream(new File("file.xlsm")); System.out.println("found file"); XSSFWorkbook workbook = new XSSFWorkbook(file); System.out.println("in workbook"); XSSFSheet sheet = workbook.getSheet("Shipments"); System.out.println("got sheet"); The code

alasql requires xlsx which is already included

若如初见. 提交于 2019-12-11 01:09:26
问题 I am trying to export data to an excel sheet using alasql and xlsx . I have followed all the guidelines here: https://github.com/agershun/alasql/wiki/Xlsx This is my function: exportToExcel(data: any) { console.log(XLSX.version); alasql .promise('SELECT * INTO XLSX("test.csv",{headers:true}) FROM ?', [data]) .then(function (data) { console.log(data); }) .catch(function (err) { console.log('Error:', err); });; } which gives me this error in my console together with the XLSX version: VM9931

How can we create a color scales for excel using R?

隐身守侯 提交于 2019-12-10 23:59:03
问题 I want to create a color scale based on the input values from an excel spreadsheet.The required output is a color scaled cells in the excel sheet based on the values which is programmed in R.I tried through XLConnect but haven't yet found a suitable solution. thanks & Regards 回答1: The xlsx package allows using RGB-colors for Fill(). E.g. fg <- rgb(100, 50, 50, max = 100) bg <- "black" style <- CellStyle(wb) + Fill(foregroundColor = fg, backgroundColor = bg) setCellStyle(c, style) Setting the

XLSX File corrupted when sent from Node.js via Restify to Client

故事扮演 提交于 2019-12-10 23:56:48
问题 I am working on a project where I am creating an excel file using XLSX node.js library, sending it to a client via Restify where I then use the FileSaver.js library to save it on the local computer. When I write the xlsx workbook to file on the backend, it opens fine, however, when I open it on the client, it is corrupted. I get the error: "Excel cannot open this file. The file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension

How to read an .xls file that is encrypted with R?

扶醉桌前 提交于 2019-12-10 22:05:44
问题 Typically I use the readxl package (which is quite good) for reading excel files: read_excel(path = 'ihateexcel.xls', sheet = 1) However, the session will essentially freeze if I try and read an encrypted .xls file. Obviously don't want to save the file as .csv as I'll lose the encryption or have to use another encryption. Can't seem to find this functionality in other packages xlsx either. How do I read an .xls file that is encrypted in excel? 回答1: excel.link can help you in opening password

R语言

房东的猫 提交于 2019-12-10 21:00:07
安装xlsx包 #装之前先装jdk,配置环境变量 install.packages("xlsx") 代表安装成功 必须先加载包然后再使用包 library() $提取符号 当一个函数里需要返回多个值(比如有变量,有向量,有矩阵)时,我们要用list,而不是return,这时如果想提取某个变量的结果,就需要用到$,默认情况下,对于 `list`, `environment` 这两种对象,`$`可以提取(extract)出里面的元素。 必知必会的函数 x<-c(7,5,8,9,2) #最大值 max(x) #最小值 min(x) #同时获取最大值和最小值 range(x) #后一项减去前一项 diff(x) #极差 diff(range(x)) #累加和 cumsum(x) #累计乘积 cumprod(x) #累计求最大值 cummax(x) #累计求最小值 cummin(x) #基于矩阵和数据框的函数 #循环:显式循环、隐式循环 #显式:for、while、repeat #隐式:apply、lapply、sapply #apply #构造矩阵m m<-matrix(1:12,nrow = 3,byrow = T) #计算矩阵的每一行的和 # 1代表行,2代表列 apply(m,1,sum) #计算矩阵的每一列的均值 apply(m,2,mean) #lapply #构造一个列表 #

Can't load workbook with openpyxl: during handling of the above exception, another exception occurred

醉酒当歌 提交于 2019-12-10 19:39:09
问题 I want to edit a xlsx file with openpyxl 2.5.0. This is my code and it works with an empty file: from openpyxl import load_workbook wb = load_workbook(filename="Untitled.xlsx") ws = wb.active ws["B5"] = "test" wb.save("Export.xlsx") However if I try to load this file, I get the following obscure error. Traceback (most recent call last): File "C:\Matteo\PyCharm\CMakeR\venv\lib\site-packages\openpyxl\descriptors\base.py", line 57, in _convert value = expected_type(value) ValueError: invalid

Handling office open xml (xlsx) documents with PHP

别说谁变了你拦得住时间么 提交于 2019-12-10 18:48:56
问题 I need to create sort of a php based Excel (xslx) handling component. I figured that there are several open source projects around which are into this. Does anyone has particular experiences / advice on this for me? I.e. which one to go with, which one is to be avoided? I tend to go with PHP-Excel. thx in advance for your thoughts... K 回答1: I used PHP-Excel for many times. One of authors have some examples on blog, sorry only in czech. 回答2: It depends on what you want to accomplish. If you