Skip to content

Commit

Permalink
RLS: Feather 0.4 Python release
Browse files Browse the repository at this point in the history
  • Loading branch information
wesm committed May 24, 2017
1 parent d253ed6 commit 9da1fd3
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 3 deletions.
151 changes: 151 additions & 0 deletions bench/ArrowMigration.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"import pyarrow as pa\n",
"import feather as fth\n",
"\n",
"type_ = np.dtype('float64')\n",
"DATA_SIZE = (1 << 30)\n",
"NCOLS = 100\n",
"NROWS = DATA_SIZE / NCOLS / np.dtype(type_).itemsize\n",
"\n",
"data = {\n",
" 'c' + str(i): np.random.randn(int(NROWS))\n",
" for i in range(int(NCOLS))\n",
"}\n",
"df = pd.DataFrame(data)\n",
"df[::5] = np.nan"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"fth.write_dataframe?"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"NFILES = 20\n",
"for i in range(NFILES):\n",
" fth.write_dataframe(df, 'df{0}.feather'.format(i))"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"def read_all(nfiles=NFILES, nthreads=1):\n",
" for i in range(nfiles):\n",
" path = 'df{0}.feather'.format(i)\n",
" fth.read_dataframe(path, nthreads=nthreads)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Make sure to run before each command\n",
"## echo 3 > /proc/sys/vm/drop_caches"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 1.74 s, sys: 7.75 s, total: 9.49 s\n",
"Wall time: 16.5 s\n"
]
}
],
"source": [
"%time read_all(10)"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CPU times: user 2.08 s, sys: 8.56 s, total: 10.6 s\n",
"Wall time: 10.9 s\n"
]
}
],
"source": [
"%time read_all(10, nthreads=4)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"fth.read_dataframe??"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
6 changes: 3 additions & 3 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
MINOR = 4
MICRO = 0
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
ISRELEASED = False
ISRELEASED = True

setup_dir = os.path.abspath(os.path.dirname(__file__))

Expand Down Expand Up @@ -65,10 +65,10 @@ def write_version_py(filename=os.path.join(setup_dir, 'feather/version.py')):

setup(
name="feather-format",
packages=['feather', 'feather.tests'],
packages=['feather'],
version=VERSION,
package_data={'feather': ['*.pxd', '*.pyx']},
install_requires=['pyarrow>=0.3.0'],
install_requires=['pyarrow>=0.4.0'],
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
license='Apache License, Version 2.0',
Expand Down

0 comments on commit 9da1fd3

Please sign in to comment.