を取得します。今、あなたはパンダDFに変換することができD:/download/sframe/
In [7]: import sframe
In [7]: sf = sframe.SFrame('D:/download/sframe/')
In [8]: sf
Out[8]:
Columns:
URI str
name str
text str
Rows: 59071
Data:
+-------------------------------+---------------------+
| URI | name |
+-------------------------------+---------------------+
| <http://dbpedia.org/resour... | Digby Morrell |
| <http://dbpedia.org/resour... | Alfred J. Lewy |
| <http://dbpedia.org/resour... | Harpdog Brown |
| <http://dbpedia.org/resour... | Franz Rottensteiner |
| <http://dbpedia.org/resour... | G-Enka |
| <http://dbpedia.org/resour... | Sam Henderson |
| <http://dbpedia.org/resour... | Aaron LaCrate |
| <http://dbpedia.org/resour... | Trevor Ferguson |
| <http://dbpedia.org/resour... | Grant Nelson |
| <http://dbpedia.org/resour... | Cathy Caruth |
+-------------------------------+---------------------+
+-------------------------------+
| text |
+-------------------------------+
| digby morrell born 10 octo... |
| alfred j lewy aka sandy le... |
| harpdog brown is a singer ... |
| franz rottensteiner born i... |
| henry krvits born 30 decem... |
| sam henderson born october... |
| aaron lacrate is an americ... |
| trevor ferguson aka john f... |
| grant nelson born 27 april... |
| cathy caruth born 1955 is ... |
+-------------------------------+
[59071 rows x 3 columns]
Note: Only the head of the SFrame is printed.
You can use print_rows(num_rows=m, num_columns=n) to print more rows and columns.
:私はpeople_wiki.glからすべてのファイルをダウンロードしたとの下に置く:
import sframe
sf = sframe.SFrame('/path/to/dir/')
デモ:
だから、彼らにこの方法をロードすることができます必要な場合:
In [17]: df = sf.to_dataframe()
In [18]: pd.options.display.max_colwidth = 40
In [19]: df.head()
Out[19]:
URI name text
0 <http://dbpedia.org/resource/Digby_M... Digby Morrell digby morrell born 10 october 1979 i...
1 <http://dbpedia.org/resource/Alfred_... Alfred J. Lewy alfred j lewy aka sandy lewy graduat...
2 <http://dbpedia.org/resource/Harpdog... Harpdog Brown harpdog brown is a singer and harmon...
3 <http://dbpedia.org/resource/Franz_R... Franz Rottensteiner franz rottensteiner born in waidmann...
4 <http://dbpedia.org/resource/G-Enka> G-Enka henry krvits born 30 december 1974 i...
In [20]: df.shape
Out[20]: (59071, 3)
あなたは[mcve]を提供できますか? –
ありがとうございます。コードを見てください。 –