How to read JMP *.jmp file with Python Pandas into Pandas dataframe

帅比萌擦擦* 提交于 2019-12-11 15:40:43

问题


I am struggling to read SAS JMP files with Pandas read_csv function into Pandas dataframe. Does anyone have experience with this type of data file? What is the most efficient way?


回答1:


This has worked for me. Its results are sometimes a bit unexpected (for example, sometimes I get CSVs without headers, even though in JMP they have them). Unfortunately, you need to have SAS JMP installed and this solution only works on Windows.

import pandas as pd
from win32com.client import Dispatch

jmp = Dispatch("JMP.Application")
doc = jmp.OpenDocument('sasjmpfile.jmp')
doc.SaveAs('sasjmpfile.csv')

df = pd.read_csv('sasjmpfile.csv')


来源:https://stackoverflow.com/questions/46476460/how-to-read-jmp-jmp-file-with-python-pandas-into-pandas-dataframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!