在python或pandas中打开扩展名为.gl的文件夹 [英] Opening folder with .gl extension in python or pandas

查看:80
本文介绍了在python或pandas中打开扩展名为.gl的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从正在关注的在线课程中下载了一些数据.

I downloaded some data from an online course I'm following.

一旦解压缩,它将生成一个名为home.gl的文件夹(该文件夹带有gl扩展名),在该文件夹内,它们是这些奇怪的扩展名文件.在课程中,他们使用graphlab(付费程序),但他们说也可以使用Pandas.

Once unzipped it generates a folder called home.gl (the folder comes with that gl extension) and inside that folder they are these strange extension files. In the course they use graphlab (paid programm) but they say one can use Pandas too.

这是可以加载到DataFrame中的数据,实际上他们只是在执行以下操作来加载它:

This is data that can be loaded into a DataFrame and they actually just load it doing:

sales = graphlab.SFrame('home_data.gl/')

这是提取的图像.

如何将这些数据加载到Python(最好是熊猫)中?

How can I load this data into Python, preferably pandas?

这些是他们的指示.

推荐答案

您始终可以将SFrame保存到csv并从csv创建pandas DataFrame:

You can always save SFrame to csv and create pandas DataFrame from csv:

sf = sframe.SFrame('Downloads/home_data.gl/') 
sf.save('Downloads/home_data.csv', format='csv')
df = pandas.read_csv('Downloads/home_data.csv')

这篇关于在python或pandas中打开扩展名为.gl的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆