From d8569e325483b186fc0ae1cd99dfce2d3d0c324e Mon Sep 17 00:00:00 2001 From: Ryan Sheftel Date: Tue, 29 Oct 2019 19:14:35 -0400 Subject: [PATCH] Updated docs and examples --- README.rst | 46 ++- docs/change_log.rst | 3 +- docs/convert_pandas.rst | 6 +- docs/index.rst | 54 +-- docs/raccoon.rst | 46 +-- docs/speed_test.rst | 486 ++++++++++++------------ docs/usage_dataframe.rst | 117 +----- docs/usage_dropin.rst | 146 ++++++++ docs/usage_series.rst | 83 +--- examples/speed_test.ipynb | 667 ++++++++++++++++----------------- examples/usage_dataframe.ipynb | 8 +- examples/usage_dropin.ipynb | 36 +- examples/usage_series.ipynb | 8 +- 13 files changed, 842 insertions(+), 864 deletions(-) create mode 100644 docs/usage_dropin.rst diff --git a/README.rst b/README.rst index 603e7a6..0c431eb 100644 --- a/README.rst +++ b/README.rst @@ -19,39 +19,61 @@ Documentation ------------- http://raccoon.readthedocs.io/en/latest/ +Source location +~~~~~~~~~~~~~~~ +Hosted on GitHub: https://github.com/rsheftel/raccoon + Overview -------- Raccoon is a lightweight DataFrame and Series implementation inspired by the phenomenal Pandas package for the one use -case where Pandas is known to be sub-optimal: DataFrames that grow in size by rows frequently in the code. Additionally -Raccoon DataFrames can be parametrized to be sorted so that additions to the DataFrame keep the index in sorted order -to speed inserts and retrievals. +case where Pandas is known to be sub-optimal: DataFrames and Series that grow in size by rows frequently in the code. +Additionally Raccoon DataFrames and Series can be parametrized to be sorted so that additions to the DataFrame keep the +index in sorted order to speed inserts and retrievals. + +A simple speed comparison of Raccoon vs Pandas for typical functionality is located in the documentation. Inspiration ------------ -Pandas DataFrames are excellent multi-purpose data structures for data management and analysis. One of the use cases -I had was to use DataFrames as a type of in-memory database table. The issue was that this required lots of growing -the rows of the DataFrame, something that is known to be slow in Pandas. The reason it is slow in Pandas is that the -underlying data structure is numpy which does a complete copy of the data when the size of the array grows. +~~~~~~~~~~~ +Pandas DataFrames and Series are excellent multi-purpose data structures for data management and analysis. One of the +use cases I had was to use DataFrames as a type of in-memory database table. The issue was that this required lots of +growing the rows of the DataFrame, something that is known to be slow in Pandas. The reason it is slow in Pandas is that +the underlying data structure is numpy which does a complete copy of the data when the size of the array grows. Functionality -------------- +~~~~~~~~~~~~~ Raccoon implements what is needed to use the DataFrame as an in memory store of index and column data structure supporting simple and tuple indexes to mimic the hierarchical indexes of Pandas. The methods included are primarily about setting values of the data frame, growing and appending the data frame and getting values from the data frame. The raccoon DataFrame is not intended for math operations like pandas and only limited basic math methods are included. +Underlying Data Structure +~~~~~~~~~~~~~~~~~~~~~~~~~ +Raccoon uses the standard built in lists as its default underlying data structure. There is an option on object +construction to use any other drop-in replacement for lists. For example the fast blist package +http://stutzbachenterprises.com/blist/ could be used as a list replacement for the underlying data structure. + Why Raccoon? ------------- +~~~~~~~~~~~~ According to wikipedia some scientists believe the panda is related to the raccoon Contributing ------------- +~~~~~~~~~~~~ Contribution in the form of pull requests are welcome. Use pytest to run the test suite. Be sure any new additions come with accompanying tests. Future ------- +~~~~~~ This package serves the needs it was originally created for. Any future additions by myself will be driven by my own needs, but it is completely open source to I encourage anyone to add on and expand. My hope is that one day Pandas solves the speed problem with growing DataFrames and this package becomes obsolete. + +Python Version +~~~~~~~~~~~~~~ +Raccoon requires Python 3.4 or greater. Python 2.7 support was eliminated as of version 3.0. If you need to use raccoon +with Python 2.7 use any version less than 3.0 + +Helper scripts +~~~~~~~~~~~~~~ +There is helper function to generate these docs from the source code. On windows cd into the docs directory and +execute make_docs.bat from the command line. To run the test coverage report run the coverage.sh script. diff --git a/docs/change_log.rst b/docs/change_log.rst index 98855e4..ccf5aa2 100644 --- a/docs/change_log.rst +++ b/docs/change_log.rst @@ -157,6 +157,7 @@ Series - Python 2.7 support is dropped. This and all future releases are Python3 only - .show() method has been renamed .print() to be consistent with Python standards - Major change to the API for using drop-in replacements like blist and removing blist as an installation requirement. + The refactoring was driven by two needs. The first was to consistently accommodate other drop-in list replacements. The second was that blist was no longer maintained and having it as a dependency for the entire raccoon package created difficulties with installation. Now the sole package dependency is tabulate and that is a pure python package. @@ -166,7 +167,7 @@ created difficulties with installation. Now the sole package dependency is tabul - blist does not have a published wheel on PyPi which makes it a difficult requirement for most people to install - the conda blist package does not support Python 3.7 on Windows - Because of the following error it will cease working in 3.8 if not resolved and there seems to be no active development: -+ Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working + + Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working *Can I still use blist?* diff --git a/docs/convert_pandas.rst b/docs/convert_pandas.rst index f87d3c4..51a8d17 100644 --- a/docs/convert_pandas.rst +++ b/docs/convert_pandas.rst @@ -1,10 +1,14 @@ - Convert to and from Pandas DataFrames ===================================== There are no built in methods for the conversions but these functions below should work in most basic instances. +.. code:: python + + # remove comment to use latest development version + import sys; sys.path.insert(0, '../') + .. code:: python import raccoon as rc diff --git a/docs/index.rst b/docs/index.rst index 06e09d1..3dbf337 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,59 +1,7 @@ .. Raccoon documentation master file, created by sphinx-quickstart on Fri Jul 29 08:26:04 2016. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. -Raccoon documentation -===================== -Overview --------- -Raccoon is a lightweight DataFrame and Series implementation inspired by the phenomenal Pandas package for the one use -case where Pandas is known to be sub-optimal: DataFrames and Series that grow in size by rows frequently in the code. -A simple speed comparison is below in the contents. - -Source location -~~~~~~~~~~~~~~~ -Hosted on GitHub: https://github.com/rsheftel/raccoon - -Inspiration -~~~~~~~~~~~ -Pandas DataFrames and Series are excellent multi-purpose data structures for data management and analysis. One of the -use cases I had was to use DataFrames as a type of in-memory database table. The issue was that this required lots of -growing the rows of the DataFrame, something that is known to be slow in Pandas. The reason it is slow in Pandas is -that the underlying data structure is numpy which does a complete copy of the data when the size of the array grows. - -Functionality -~~~~~~~~~~~~~ -Raccoon implements what is needed to use the DataFrame as an in memory store of index and column data structure -supporting simple and tuple indexes to mimic the hierarchical indexes of Pandas. The methods included are primarily -about setting values of the data frame, growing and appending the data frame and getting values from the data frame. -The raccoon DataFrame is not intended for math operations like pandas and only limited basic math methods are included. - -Underlying Data Structure -~~~~~~~~~~~~~~~~~~~~~~~~~ -Raccoon uses the standard built in lists. There is an option on object construction to use fast blist -http://stutzbachenterprises.com/blist/ list replacement for the underlying data structure. - -Why Raccoon? -~~~~~~~~~~~~ -According to wikipedia some scientists believe the panda is related to the raccoon - -Future -~~~~~~ -This package serves the needs it was originally created for. Any future additions by myself will be driven by my own -needs, but it is completely open source to I encourage anyone to add on and expand. - -My hope is that one day Pandas solves the speed problem with growing DataFrames and this package becomes obsolete. - -Python Version -~~~~~~~~~~~~~~ -Raccoon requires Python 3.4 or greater. Python 2.7 support was eliminated as of version 3.0. If you need to use raccoon -with Python 2.7 use any version less than 3.0 - -Helper scripts -~~~~~~~~~~~~~~ -There is helper function to generate these docs from the source code. On windows cd into the docs directory and -execute make_docs.bat from the command line. To run the test coverage report run the coverage.sh script. +.. include:: ../README.rst Updates ------- diff --git a/docs/raccoon.rst b/docs/raccoon.rst index 65beed8..9ee0b9f 100644 --- a/docs/raccoon.rst +++ b/docs/raccoon.rst @@ -4,43 +4,43 @@ raccoon package Submodules ---------- -raccoon\.dataframe module -------------------------- +raccoon.dataframe module +------------------------ .. automodule:: raccoon.dataframe - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -raccoon\.series module ----------------------- +raccoon.series module +--------------------- .. automodule:: raccoon.series - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -raccoon\.sort\_utils module ---------------------------- +raccoon.sort\_utils module +-------------------------- .. automodule:: raccoon.sort_utils - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -raccoon\.utils module ---------------------- +raccoon.utils module +-------------------- .. automodule:: raccoon.utils - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: Module contents --------------- .. automodule:: raccoon - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/speed_test.rst b/docs/speed_test.rst index 8fafad7..10f9ec5 100644 --- a/docs/speed_test.rst +++ b/docs/speed_test.rst @@ -1,5 +1,4 @@ - -Raccoon vs. Pandas speed test +Raccoon vs. Pandas speed test ============================= Setup pythonpath, import libraries and initialized DataFrame to store @@ -19,6 +18,29 @@ results import raccoon as rc import pandas as pd +Machine information +------------------- + +.. code:: python + + import platform + print(platform.machine()) + print(platform.processor()) + print(platform.platform()) + print("python ", platform.python_version()) + + +.. parsed-literal:: + + AMD64 + Intel64 Family 6 Model 142 Stepping 10, GenuineIntel + Windows-10-10.0.18362-SP0 + python 3.7.4 + + +Run the Speed Test +------------------ + .. code:: python results = rc.DataFrame(columns=['raccoon', 'pandas', 'ratio'], sort=False) @@ -41,7 +63,7 @@ results index raccoon pandas ratio ------- --------- -------- ------- - version 2.1.3 0.20.2 + version 3.0.0 0.25.2 Initialize 10,000 empty DataFrames @@ -64,7 +86,7 @@ Initialize 10,000 empty DataFrames .. parsed-literal:: - 92.4 ms ± 6.36 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) + 88.7 ms ± 6.1 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) .. code:: python @@ -74,7 +96,7 @@ Initialize 10,000 empty DataFrames .. parsed-literal:: - 2.74 s ± 234 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 4.49 s ± 155 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -90,8 +112,8 @@ Initialize 10,000 empty DataFrames index raccoon pandas ratio ---------------- ------------------- ----------------- --------- - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 Initialize 100 row X 100 col DataFrame() @@ -110,7 +132,7 @@ Initialize 100 row X 100 col DataFrame() .. parsed-literal:: - 87.8 µs ± 8.43 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) + 121 µs ± 7.92 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) .. code:: python @@ -120,7 +142,7 @@ Initialize 100 row X 100 col DataFrame() .. parsed-literal:: - 8.11 ms ± 779 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) + 15.3 ms ± 279 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) .. code:: python @@ -134,11 +156,11 @@ Initialize 100 row X 100 col DataFrame() .. parsed-literal:: - index raccoon pandas ratio - ---------------------- --------------------- -------------------- --------- - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 + index raccoon pandas ratio + ---------------------- --------------------- -------------------- ---------- + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 Add 10,000 items in 1 column to empty DataFrame @@ -163,7 +185,7 @@ Add 10,000 items in 1 column to empty DataFrame .. parsed-literal:: - 43.5 ms ± 402 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) + 53.7 ms ± 2.67 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) .. code:: python @@ -173,7 +195,7 @@ Add 10,000 items in 1 column to empty DataFrame .. parsed-literal:: - 16.2 s ± 1.53 s per loop (mean ± std. dev. of 7 runs, 1 loop each) + 17.1 s ± 193 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -189,10 +211,10 @@ Add 10,000 items in 1 column to empty DataFrame index raccoon pandas ratio ---------------------- --------------------- -------------------- ---------- - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 Add 100 rows of 100 columns to empty DataFrame @@ -220,7 +242,7 @@ Add 100 rows of 100 columns to empty DataFrame .. parsed-literal:: - 9.32 ms ± 808 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) + 10 ms ± 185 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) .. code:: python @@ -230,7 +252,7 @@ Add 100 rows of 100 columns to empty DataFrame .. parsed-literal:: - 184 ms ± 3.55 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 296 ms ± 4.94 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -246,11 +268,11 @@ Add 100 rows of 100 columns to empty DataFrame index raccoon pandas ratio ---------------------- --------------------- -------------------- ---------- - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 Append 10x10 DataFrame 1000 times @@ -283,7 +305,7 @@ Append 10x10 DataFrame 1000 times .. parsed-literal:: - 62.2 ms ± 7.32 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) + 77.5 ms ± 3.77 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) .. code:: python @@ -293,7 +315,7 @@ Append 10x10 DataFrame 1000 times .. parsed-literal:: - 164 ms ± 5.16 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 370 ms ± 19.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -309,12 +331,12 @@ Append 10x10 DataFrame 1000 times index raccoon pandas ratio ---------------------- --------------------- -------------------- ---------- - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 Get @@ -351,7 +373,7 @@ Get .. parsed-literal:: - 528 ms ± 64.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 718 ms ± 45.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -361,7 +383,7 @@ Get .. parsed-literal:: - 783 ms ± 74.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 1.02 s ± 71.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -377,13 +399,13 @@ Get index raccoon pandas ratio ---------------------- --------------------- -------------------- ---------- - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 - get cell 0.4936867081052583 0.7425185427150893 0.664881 + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 + get cell 0.6728431999999884 0.9376910000000862 0.717553 .. code:: python @@ -405,7 +427,7 @@ Get .. parsed-literal:: - 36.6 ms ± 5.38 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) + 42.8 ms ± 743 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) .. code:: python @@ -415,7 +437,7 @@ Get .. parsed-literal:: - 313 µs ± 2.39 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) + 402 µs ± 24.3 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) .. code:: python @@ -429,16 +451,16 @@ Get .. parsed-literal:: - index raccoon pandas ratio - ---------------------- --------------------- ---------------------- ------------ - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 - get cell 0.4936867081052583 0.7425185427150893 0.664881 - get column all index 0.032696135984224384 0.00030877898993577447 105.888 + index raccoon pandas ratio + ---------------------- --------------------- --------------------- ------------ + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 + get cell 0.6728431999999884 0.9376910000000862 0.717553 + get column all index 0.041298069999993456 0.0003524336000000403 117.18 .. code:: python @@ -464,7 +486,7 @@ Get .. parsed-literal:: - 465 ms ± 51.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 609 ms ± 62.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -474,7 +496,7 @@ Get .. parsed-literal:: - 6 s ± 425 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 7.1 s ± 40.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -488,17 +510,17 @@ Get .. parsed-literal:: - index raccoon pandas ratio - ----------------------- --------------------- ---------------------- ------------ - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 - get cell 0.4936867081052583 0.7425185427150893 0.664881 - get column all index 0.032696135984224384 0.00030877898993577447 105.888 - get column subset index 0.42664153398601457 5.714989510943553 0.0746531 + index raccoon pandas ratio + ----------------------- --------------------- --------------------- ------------ + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 + get cell 0.6728431999999884 0.9376910000000862 0.717553 + get column all index 0.041298069999993456 0.0003524336000000403 117.18 + get column subset index 0.5668462000003274 7.041264400000273 0.0805035 .. code:: python @@ -520,7 +542,7 @@ Get .. parsed-literal:: - 815 ms ± 73.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 1.07 s ± 27.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -530,7 +552,7 @@ Get .. parsed-literal:: - 118 ms ± 10.4 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) + 229 ms ± 9.34 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -544,18 +566,18 @@ Get .. parsed-literal:: - index raccoon pandas ratio - ----------------------- --------------------- ---------------------- ------------ - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 - get cell 0.4936867081052583 0.7425185427150893 0.664881 - get column all index 0.032696135984224384 0.00030877898993577447 105.888 - get column subset index 0.42664153398601457 5.714989510943553 0.0746531 - get index all columns 0.7787561018819247 0.10775676991503928 7.22698 + index raccoon pandas ratio + ----------------------- --------------------- --------------------- ------------ + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 + get cell 0.6728431999999884 0.9376910000000862 0.717553 + get column all index 0.041298069999993456 0.0003524336000000403 117.18 + get column subset index 0.5668462000003274 7.041264400000273 0.0805035 + get index all columns 1.0389918000000762 0.2065747999999985 5.02962 Set @@ -592,7 +614,7 @@ Set .. parsed-literal:: - 436 ms ± 59.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 578 ms ± 33.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -602,7 +624,7 @@ Set .. parsed-literal:: - 1 s ± 78.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 1.36 s ± 65.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -616,19 +638,19 @@ Set .. parsed-literal:: - index raccoon pandas ratio - ----------------------- --------------------- ---------------------- ------------ - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 - get cell 0.4936867081052583 0.7425185427150893 0.664881 - get column all index 0.032696135984224384 0.00030877898993577447 105.888 - get column subset index 0.42664153398601457 5.714989510943553 0.0746531 - get index all columns 0.7787561018819247 0.10775676991503928 7.22698 - set cell 0.3987260515496587 0.9623946910782024 0.414306 + index raccoon pandas ratio + ----------------------- --------------------- --------------------- ------------ + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 + get cell 0.6728431999999884 0.9376910000000862 0.717553 + get column all index 0.041298069999993456 0.0003524336000000403 117.18 + get column subset index 0.5668462000003274 7.041264400000273 0.0805035 + get index all columns 1.0389918000000762 0.2065747999999985 5.02962 + set cell 0.5282995000002302 1.26670009999998 0.417068 .. code:: python @@ -650,7 +672,7 @@ Set .. parsed-literal:: - 4.19 ms ± 748 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) + 5.84 ms ± 512 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) .. code:: python @@ -660,7 +682,7 @@ Set .. parsed-literal:: - 12.7 ms ± 1.02 ms per loop (mean ± std. dev. of 7 runs, 100 loops each) + 17.2 ms ± 516 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) .. code:: python @@ -674,20 +696,20 @@ Set .. parsed-literal:: - index raccoon pandas ratio - ----------------------- --------------------- ---------------------- ------------ - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 - get cell 0.4936867081052583 0.7425185427150893 0.664881 - get column all index 0.032696135984224384 0.00030877898993577447 105.888 - get column subset index 0.42664153398601457 5.714989510943553 0.0746531 - get index all columns 0.7787561018819247 0.10775676991503928 7.22698 - set cell 0.3987260515496587 0.9623946910782024 0.414306 - set column all index 0.00376809479375936 0.011686656340490344 0.322427 + index raccoon pandas ratio + ----------------------- --------------------- --------------------- ------------ + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 + get cell 0.6728431999999884 0.9376910000000862 0.717553 + get column all index 0.041298069999993456 0.0003524336000000403 117.18 + get column subset index 0.5668462000003274 7.041264400000273 0.0805035 + get index all columns 1.0389918000000762 0.2065747999999985 5.02962 + set cell 0.5282995000002302 1.26670009999998 0.417068 + set column all index 0.00548794899999848 0.01662835399999949 0.330036 .. code:: python @@ -713,7 +735,7 @@ Set .. parsed-literal:: - 269 ms ± 3.72 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 380 ms ± 7.21 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -723,7 +745,7 @@ Set .. parsed-literal:: - 22.7 s ± 244 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 59 s ± 732 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -737,21 +759,21 @@ Set .. parsed-literal:: - index raccoon pandas ratio - ----------------------- --------------------- ---------------------- ------------ - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 - get cell 0.4936867081052583 0.7425185427150893 0.664881 - get column all index 0.032696135984224384 0.00030877898993577447 105.888 - get column subset index 0.42664153398601457 5.714989510943553 0.0746531 - get index all columns 0.7787561018819247 0.10775676991503928 7.22698 - set cell 0.3987260515496587 0.9623946910782024 0.414306 - set column all index 0.00376809479375936 0.011686656340490344 0.322427 - set column subset index 0.26396186901109786 22.454482046778423 0.0117554 + index raccoon pandas ratio + ----------------------- --------------------- --------------------- ------------ + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 + get cell 0.6728431999999884 0.9376910000000862 0.717553 + get column all index 0.041298069999993456 0.0003524336000000403 117.18 + get column subset index 0.5668462000003274 7.041264400000273 0.0805035 + get index all columns 1.0389918000000762 0.2065747999999985 5.02962 + set cell 0.5282995000002302 1.26670009999998 0.417068 + set column all index 0.00548794899999848 0.01662835399999949 0.330036 + set column subset index 0.37289839999994 58.03955229999974 0.0064249 .. code:: python @@ -777,7 +799,7 @@ Set .. parsed-literal:: - 56.3 ms ± 8.04 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) + 64.4 ms ± 513 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) .. code:: python @@ -787,7 +809,7 @@ Set .. parsed-literal:: - 500 ms ± 80.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 1.41 s ± 15.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -801,22 +823,22 @@ Set .. parsed-literal:: - index raccoon pandas ratio - ----------------------- --------------------- ---------------------- ------------ - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 - get cell 0.4936867081052583 0.7425185427150893 0.664881 - get column all index 0.032696135984224384 0.00030877898993577447 105.888 - get column subset index 0.42664153398601457 5.714989510943553 0.0746531 - get index all columns 0.7787561018819247 0.10775676991503928 7.22698 - set cell 0.3987260515496587 0.9623946910782024 0.414306 - set column all index 0.00376809479375936 0.011686656340490344 0.322427 - set column subset index 0.26396186901109786 22.454482046778423 0.0117554 - set index all columns 0.05272717698682072 0.4621994576302768 0.114079 + index raccoon pandas ratio + ----------------------- --------------------- --------------------- ------------ + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 + get cell 0.6728431999999884 0.9376910000000862 0.717553 + get column all index 0.041298069999993456 0.0003524336000000403 117.18 + get column subset index 0.5668462000003274 7.041264400000273 0.0805035 + get index all columns 1.0389918000000762 0.2065747999999985 5.02962 + set cell 0.5282995000002302 1.26670009999998 0.417068 + set column all index 0.00548794899999848 0.01662835399999949 0.330036 + set column subset index 0.37289839999994 58.03955229999974 0.0064249 + set index all columns 0.06374265999997988 1.390037300000131 0.0458568 Sort @@ -838,7 +860,7 @@ Sort .. parsed-literal:: - 12.4 ms ± 807 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) + 16 ms ± 953 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) .. code:: python @@ -848,7 +870,7 @@ Sort .. parsed-literal:: - 539 µs ± 62.9 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) + 859 µs ± 12.6 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) .. code:: python @@ -862,23 +884,23 @@ Sort .. parsed-literal:: - index raccoon pandas ratio - ----------------------- --------------------- ---------------------- ------------ - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 - get cell 0.4936867081052583 0.7425185427150893 0.664881 - get column all index 0.032696135984224384 0.00030877898993577447 105.888 - get column subset index 0.42664153398601457 5.714989510943553 0.0746531 - get index all columns 0.7787561018819247 0.10775676991503928 7.22698 - set cell 0.3987260515496587 0.9623946910782024 0.414306 - set column all index 0.00376809479375936 0.011686656340490344 0.322427 - set column subset index 0.26396186901109786 22.454482046778423 0.0117554 - set index all columns 0.05272717698682072 0.4621994576302768 0.114079 - sort index 0.011655945561328736 0.0004977774624292124 23.416 + index raccoon pandas ratio + ----------------------- --------------------- --------------------- ------------ + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 + get cell 0.6728431999999884 0.9376910000000862 0.717553 + get column all index 0.041298069999993456 0.0003524336000000403 117.18 + get column subset index 0.5668462000003274 7.041264400000273 0.0805035 + get index all columns 1.0389918000000762 0.2065747999999985 5.02962 + set cell 0.5282995000002302 1.26670009999998 0.417068 + set column all index 0.00548794899999848 0.01662835399999949 0.330036 + set column subset index 0.37289839999994 58.03955229999974 0.0064249 + set index all columns 0.06374265999997988 1.390037300000131 0.0458568 + sort index 0.014900102999999944 0.0008343847000001006 17.8576 Iterators @@ -913,7 +935,7 @@ Iterators .. parsed-literal:: - 24.1 ms ± 532 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) + 27.2 ms ± 381 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) .. code:: python @@ -923,7 +945,7 @@ Iterators .. parsed-literal:: - 20.3 ms ± 599 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) + 34 ms ± 532 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) .. code:: python @@ -937,24 +959,24 @@ Iterators .. parsed-literal:: - index raccoon pandas ratio - ----------------------- --------------------- ---------------------- ------------ - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 - get cell 0.4936867081052583 0.7425185427150893 0.664881 - get column all index 0.032696135984224384 0.00030877898993577447 105.888 - get column subset index 0.42664153398601457 5.714989510943553 0.0746531 - get index all columns 0.7787561018819247 0.10775676991503928 7.22698 - set cell 0.3987260515496587 0.9623946910782024 0.414306 - set column all index 0.00376809479375936 0.011686656340490344 0.322427 - set column subset index 0.26396186901109786 22.454482046778423 0.0117554 - set index all columns 0.05272717698682072 0.4621994576302768 0.114079 - sort index 0.011655945561328736 0.0004977774624292124 23.416 - iterate rows 0.02340574597695877 0.01948813583071569 1.20103 + index raccoon pandas ratio + ----------------------- --------------------- --------------------- ------------ + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 + get cell 0.6728431999999884 0.9376910000000862 0.717553 + get column all index 0.041298069999993456 0.0003524336000000403 117.18 + get column subset index 0.5668462000003274 7.041264400000273 0.0805035 + get index all columns 1.0389918000000762 0.2065747999999985 5.02962 + set cell 0.5282995000002302 1.26670009999998 0.417068 + set column all index 0.00548794899999848 0.01662835399999949 0.330036 + set column subset index 0.37289839999994 58.03955229999974 0.0064249 + set index all columns 0.06374265999997988 1.390037300000131 0.0458568 + sort index 0.014900102999999944 0.0008343847000001006 17.8576 + iterate rows 0.026519559999997 0.03318497000000207 0.799144 Insert in the middle @@ -993,7 +1015,7 @@ Insert in the middle .. parsed-literal:: - 26.4 ms ± 381 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) + 33 ms ± 3.08 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) .. code:: python @@ -1003,7 +1025,7 @@ Insert in the middle .. parsed-literal:: - 239 ms ± 2.81 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) + 723 ms ± 30.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -1017,25 +1039,25 @@ Insert in the middle .. parsed-literal:: - index raccoon pandas ratio - ----------------------- --------------------- ---------------------- ------------ - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 - get cell 0.4936867081052583 0.7425185427150893 0.664881 - get column all index 0.032696135984224384 0.00030877898993577447 105.888 - get column subset index 0.42664153398601457 5.714989510943553 0.0746531 - get index all columns 0.7787561018819247 0.10775676991503928 7.22698 - set cell 0.3987260515496587 0.9623946910782024 0.414306 - set column all index 0.00376809479375936 0.011686656340490344 0.322427 - set column subset index 0.26396186901109786 22.454482046778423 0.0117554 - set index all columns 0.05272717698682072 0.4621994576302768 0.114079 - sort index 0.011655945561328736 0.0004977774624292124 23.416 - iterate rows 0.02340574597695877 0.01948813583071569 1.20103 - insert rows 0.025894068785544278 0.2348415172963314 0.110262 + index raccoon pandas ratio + ----------------------- --------------------- --------------------- ------------ + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 + get cell 0.6728431999999884 0.9376910000000862 0.717553 + get column all index 0.041298069999993456 0.0003524336000000403 117.18 + get column subset index 0.5668462000003274 7.041264400000273 0.0805035 + get index all columns 1.0389918000000762 0.2065747999999985 5.02962 + set cell 0.5282995000002302 1.26670009999998 0.417068 + set column all index 0.00548794899999848 0.01662835399999949 0.330036 + set column subset index 0.37289839999994 58.03955229999974 0.0064249 + set index all columns 0.06374265999997988 1.390037300000131 0.0458568 + sort index 0.014900102999999944 0.0008343847000001006 17.8576 + iterate rows 0.026519559999997 0.03318497000000207 0.799144 + insert rows 0.030685470000025816 0.6862636999999268 0.0447138 Time Series Append @@ -1051,7 +1073,7 @@ the DataFrame dates = pd.date_range('2010-01-01 09:30:00', periods=10000, freq='1min') def time_series_rc(): - ts = rc.DataFrame(columns=['open', 'high', 'low', 'close', 'volume'], index_name='datetime', sort=True, use_blist=False) + ts = rc.DataFrame(columns=['open', 'high', 'low', 'close', 'volume'], index_name='datetime', sort=True) for date in dates: ts.set_row(date, data_row) @@ -1067,7 +1089,7 @@ the DataFrame .. parsed-literal:: - 114 ms ± 9.01 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) + 134 ms ± 4.28 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) .. code:: python @@ -1077,7 +1099,7 @@ the DataFrame .. parsed-literal:: - 27.2 s ± 4 s per loop (mean ± std. dev. of 7 runs, 1 loop each) + 29.4 s ± 124 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) .. code:: python @@ -1091,25 +1113,25 @@ the DataFrame .. parsed-literal:: - index raccoon pandas ratio - ----------------------- --------------------- ---------------------- ------------ - version 2.1.3 0.20.2 - initialize empty 0.08496840788127305 2.486505687206119 0.0341718 - initialize with matrix 8.295801655311905e-05 0.007671599044494002 0.0108137 - add rows one column 0.04288183311489533 14.87375424325954 0.00288305 - add matrix 0.008299982997955908 0.1785839394495099 0.0464766 - append 0.05763429718412851 0.15777540076405216 0.365293 - get cell 0.4936867081052583 0.7425185427150893 0.664881 - get column all index 0.032696135984224384 0.00030877898993577447 105.888 - get column subset index 0.42664153398601457 5.714989510943553 0.0746531 - get index all columns 0.7787561018819247 0.10775676991503928 7.22698 - set cell 0.3987260515496587 0.9623946910782024 0.414306 - set column all index 0.00376809479375936 0.011686656340490344 0.322427 - set column subset index 0.26396186901109786 22.454482046778423 0.0117554 - set index all columns 0.05272717698682072 0.4621994576302768 0.114079 - sort index 0.011655945561328736 0.0004977774624292124 23.416 - iterate rows 0.02340574597695877 0.01948813583071569 1.20103 - insert rows 0.025894068785544278 0.2348415172963314 0.110262 - time series 0.10705897210370949 23.24008671488832 0.00460665 + index raccoon pandas ratio + ----------------------- --------------------- --------------------- ------------ + version 3.0.0 0.25.2 + initialize empty 0.08248082999998588 4.237655099999756 0.0194638 + initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611 + add rows one column 0.050407570000015764 16.86793469999975 0.00298837 + add matrix 0.009786346000000777 0.28846930000008797 0.0339251 + append 0.07348676999999952 0.346767699999873 0.211919 + get cell 0.6728431999999884 0.9376910000000862 0.717553 + get column all index 0.041298069999993456 0.0003524336000000403 117.18 + get column subset index 0.5668462000003274 7.041264400000273 0.0805035 + get index all columns 1.0389918000000762 0.2065747999999985 5.02962 + set cell 0.5282995000002302 1.26670009999998 0.417068 + set column all index 0.00548794899999848 0.01662835399999949 0.330036 + set column subset index 0.37289839999994 58.03955229999974 0.0064249 + set index all columns 0.06374265999997988 1.390037300000131 0.0458568 + sort index 0.014900102999999944 0.0008343847000001006 17.8576 + iterate rows 0.026519559999997 0.03318497000000207 0.799144 + insert rows 0.030685470000025816 0.6862636999999268 0.0447138 + time series 0.13054121000000124 29.182044600000154 0.00447334 diff --git a/docs/usage_dataframe.rst b/docs/usage_dataframe.rst index e54cd27..4a3cad1 100644 --- a/docs/usage_dataframe.rst +++ b/docs/usage_dataframe.rst @@ -1,4 +1,3 @@ - Example Usage for DataFrame =========================== @@ -26,7 +25,7 @@ Initialize .. parsed-literal:: - object id: 1265613381480 + object id: 2305959579080 columns: [] data: @@ -47,7 +46,7 @@ Initialize .. parsed-literal:: - object id: 1265613381568 + object id: 2305959578792 columns: ['a', 'b', 'c'] data: @@ -68,7 +67,7 @@ Initialize .. parsed-literal:: - object id: 1265613380600 + object id: 2305959818248 columns: ['a', 'b'] data: @@ -549,7 +548,7 @@ Set and Get by Location ----------------------- Locations are the index of the index, in other words the index locations -from 0...len(index) +from 0…len(index) .. code:: python @@ -711,10 +710,10 @@ Convert .. parsed-literal:: - {'a': [2, -9, 44, 55, 56], + {'index': [11, 12, 14, 15, 16], + 'a': [2, -9, 44, 55, 56], 'c': [2, 3, 100, None, None], - 'd': [None, None, 99, 100, 101], - 'index': [11, 12, 14, 15, 16]} + 'd': [None, None, 99, 100, 101]} @@ -774,7 +773,7 @@ Convert .. parsed-literal:: - {"data": {"a": [2, -9, 44, 55, 56], "c": [2, 3, 100, null, null], "d": [null, null, 99, 100, 101]}, "index": [11, 12, 14, 15, 16], "meta_data": {"index_name": "index", "columns": ["a", "c", "d"], "sort": false, "use_blist": false}} + {"data": {"a": [2, -9, 44, 55, 56], "c": [2, 3, 100, null, null], "d": [null, null, 99, 100, 101]}, "index": [11, 12, 14, 15, 16], "meta_data": {"index_name": "index", "columns": ["a", "c", "d"], "sort": false, "dropin": null}} .. code:: python @@ -1034,8 +1033,8 @@ the indexes are all the same length or any other integrity checking. ('b', 3, 3) 6 -The select\_index method works with tuples by allowing the \* to act as -a wild card for matching. +The select_index method works with tuples by allowing the \* to act as a +wild card for matching. .. code:: python @@ -1135,7 +1134,7 @@ Reset Index .. parsed-literal:: - object id: 1265615259432 + object id: 2305960012584 columns: ['a', 'b', 'index_0'] data: @@ -1329,97 +1328,3 @@ start 15 5 8 16 9 - -List or BList -------------- - -The underlying data structure can be either blist (default) or list - -.. code:: python - - # Construct with blist=True, the default - df_blist = rc.DataFrame({'a': [1, 2, 3]}, index=[5, 6, 7], use_blist=True) - -.. code:: python - - # see that the data structures are all blists - df_blist.data - - - - -.. parsed-literal:: - - blist([blist([1, 2, 3])]) - - - -.. code:: python - - df_blist.index - - - - -.. parsed-literal:: - - blist([5, 6, 7]) - - - -.. code:: python - - df_blist.columns - - - - -.. parsed-literal:: - - blist(['a']) - - - -.. code:: python - - # now construct as blist = False and they are all lists - df_list = rc.DataFrame({'a': [1, 2, 3]}, index=[5, 6, 7], use_blist=False) - -.. code:: python - - df_list.data - - - - -.. parsed-literal:: - - [[1, 2, 3]] - - - -.. code:: python - - df_list.index - - - - -.. parsed-literal:: - - [5, 6, 7] - - - -.. code:: python - - df_list.columns - - - - -.. parsed-literal:: - - ['a'] - - diff --git a/docs/usage_dropin.rst b/docs/usage_dropin.rst new file mode 100644 index 0000000..26ed866 --- /dev/null +++ b/docs/usage_dropin.rst @@ -0,0 +1,146 @@ +Example Usage for Drop-in List Replacements +=========================================== + +.. code:: python + + # remove comment to use latest development version + import sys; sys.path.insert(0, '../') + +.. code:: python + + # import libraries + import raccoon as rc + +BList +----- + +The underlying data structure can be any drop-in replacement for list, +in this example blist is used. + +.. code:: python + + from blist import blist + +.. code:: python + + # Construct with blist + df_blist = rc.DataFrame({'a': [1, 2, 3]}, index=[5, 6, 7], dropin=blist) + +.. code:: python + + # see that the data structures are all blists + df_blist.data + + + + +.. parsed-literal:: + + blist([blist([1, 2, 3])]) + + + +.. code:: python + + df_blist.index + + + + +.. parsed-literal:: + + blist([5, 6, 7]) + + + +.. code:: python + + df_blist.columns + + + + +.. parsed-literal:: + + blist(['a']) + + + +.. code:: python + + # the dropin class + df_blist.dropin + + + + +.. parsed-literal:: + + blist.blist + + + +All the standard functionality works exactly the same + +.. code:: python + + df_blist[6, 'a'] + + + + +.. parsed-literal:: + + 2 + + + +.. code:: python + + df_blist[8, 'b'] = 44 + print(df_blist) + + +.. parsed-literal:: + + index a b + ------- --- --- + 5 1 + 6 2 + 7 3 + 8 44 + + +Works for Series as well + +.. code:: python + + # Construct with blist=True, the default + srs_blist = rc.Series([1, 2, 3], index=[5, 6, 7], dropin=blist) + +.. code:: python + + # see that the data structures are all blists + srs_blist.data + + + + +.. parsed-literal:: + + blist([1, 2, 3]) + + + +.. code:: python + + srs_blist.index + + + + +.. parsed-literal:: + + blist([5, 6, 7]) + + diff --git a/docs/usage_series.rst b/docs/usage_series.rst index 3357691..0dba983 100644 --- a/docs/usage_series.rst +++ b/docs/usage_series.rst @@ -1,4 +1,3 @@ - Example Usage for Series ======================== @@ -26,7 +25,7 @@ Initialize .. parsed-literal:: - object id: 1891392163736 + object id: 1924106416536 data: [] index: @@ -45,7 +44,7 @@ Initialize .. parsed-literal:: - object id: 1891392163568 + object id: 1924104590056 data: [None, None, None] index: @@ -64,7 +63,7 @@ Initialize .. parsed-literal:: - object id: 1891392217440 + object id: 1924106418216 data: [4, 5, 6] index: @@ -479,7 +478,7 @@ Set and Get by Location ----------------------- Locations are the index of the index, in other words the index locations -from 0...len(index) +from 0…len(index) .. code:: python @@ -742,8 +741,8 @@ the indexes are all the same length or any other integrity checking. ('b', 3, 3) 6 -The select\_index method works with tuples by allowing the \* to act as -a wild card for matching. +The select_index method works with tuples by allowing the \* to act as a +wild card for matching. .. code:: python @@ -843,7 +842,7 @@ Reset Index .. parsed-literal:: - object id: 1891392288752 + object id: 1924106640744 data: [1, 2, 3] index: @@ -941,71 +940,3 @@ start 15 5 16 9 - -List or BList -------------- - -The underlying data structure can be either blist (default) or list - -.. code:: python - - # Construct with blist=True, the default - srs_blist = rc.Series([1, 2, 3], index=[5, 6, 7], use_blist=True) - -.. code:: python - - # see that the data structures are all blists - srs_blist.data - - - - -.. parsed-literal:: - - blist([1, 2, 3]) - - - -.. code:: python - - srs_blist.index - - - - -.. parsed-literal:: - - blist([5, 6, 7]) - - - -.. code:: python - - # now construct as blist = False and they are all lists - srs_list = rc.Series([1, 2, 3], index=[5, 6, 7], use_blist=False) - -.. code:: python - - srs_list.data - - - - -.. parsed-literal:: - - [1, 2, 3] - - - -.. code:: python - - srs_list.index - - - - -.. parsed-literal:: - - [5, 6, 7] - - diff --git a/examples/speed_test.ipynb b/examples/speed_test.ipynb index 3a55f3b..7218b87 100644 --- a/examples/speed_test.ipynb +++ b/examples/speed_test.ipynb @@ -17,7 +17,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 99, "metadata": {}, "outputs": [], "source": [ @@ -27,7 +27,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 100, "metadata": {}, "outputs": [], "source": [ @@ -36,7 +36,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 101, "metadata": {}, "outputs": [], "source": [ @@ -54,7 +54,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 102, "metadata": {}, "outputs": [ { @@ -86,7 +86,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 103, "metadata": {}, "outputs": [], "source": [ @@ -95,7 +95,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 104, "metadata": {}, "outputs": [], "source": [ @@ -107,7 +107,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 105, "metadata": {}, "outputs": [ { @@ -136,7 +136,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 106, "metadata": {}, "outputs": [], "source": [ @@ -151,14 +151,14 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 107, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "89.5 ms ± 6.59 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" + "88.7 ms ± 6.1 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" ] } ], @@ -168,14 +168,14 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 108, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "4.34 s ± 87.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "4.49 s ± 155 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -185,7 +185,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 109, "metadata": {}, "outputs": [], "source": [ @@ -194,7 +194,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 110, "metadata": {}, "outputs": [ { @@ -204,7 +204,7 @@ "index raccoon pandas ratio\n", "---------------- ------------------- ----------------- ---------\n", "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n" + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n" ] } ], @@ -222,7 +222,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 111, "metadata": {}, "outputs": [], "source": [ @@ -233,14 +233,14 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 112, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "117 µs ± 6.99 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)\n" + "121 µs ± 7.92 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)\n" ] } ], @@ -250,14 +250,14 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 113, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "16 ms ± 704 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" + "15.3 ms ± 279 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" ] } ], @@ -267,7 +267,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 114, "metadata": {}, "outputs": [], "source": [ @@ -276,18 +276,18 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 115, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "---------------------- ---------------------- -------------------- ----------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n" + "index raccoon pandas ratio\n", + "---------------------- --------------------- -------------------- ----------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n" ] } ], @@ -305,7 +305,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 116, "metadata": {}, "outputs": [], "source": [ @@ -322,14 +322,14 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 117, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "53.3 ms ± 877 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" + "53.7 ms ± 2.67 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" ] } ], @@ -339,14 +339,14 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 118, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "17 s ± 221 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "17.1 s ± 193 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -356,7 +356,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 119, "metadata": {}, "outputs": [], "source": [ @@ -365,19 +365,19 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 120, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "---------------------- ---------------------- -------------------- ----------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n" + "index raccoon pandas ratio\n", + "---------------------- --------------------- -------------------- ----------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n" ] } ], @@ -395,7 +395,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 121, "metadata": {}, "outputs": [], "source": [ @@ -415,14 +415,14 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 122, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "10.1 ms ± 1.03 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" + "10 ms ± 185 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" ] } ], @@ -432,14 +432,14 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 123, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "315 ms ± 22 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "296 ms ± 4.94 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -449,7 +449,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 124, "metadata": {}, "outputs": [], "source": [ @@ -458,20 +458,20 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 125, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "---------------------- ---------------------- -------------------- ----------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n" + "index raccoon pandas ratio\n", + "---------------------- --------------------- -------------------- ----------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n" ] } ], @@ -489,7 +489,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 126, "metadata": {}, "outputs": [], "source": [ @@ -514,14 +514,14 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 127, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "77.4 ms ± 1.59 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" + "77.5 ms ± 3.77 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" ] } ], @@ -531,14 +531,14 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 128, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "368 ms ± 12.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "370 ms ± 19.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -548,7 +548,7 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 129, "metadata": {}, "outputs": [], "source": [ @@ -557,21 +557,21 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 130, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "---------------------- ---------------------- -------------------- ----------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n" + "index raccoon pandas ratio\n", + "---------------------- --------------------- -------------------- ----------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n" ] } ], @@ -589,7 +589,7 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 131, "metadata": {}, "outputs": [], "source": [ @@ -604,7 +604,7 @@ }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 132, "metadata": {}, "outputs": [], "source": [ @@ -623,14 +623,14 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 133, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "746 ms ± 45.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "718 ms ± 45.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -640,14 +640,14 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 134, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "1.03 s ± 32.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "1.02 s ± 71.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -657,7 +657,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 135, "metadata": {}, "outputs": [], "source": [ @@ -666,22 +666,22 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 136, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "---------------------- ---------------------- -------------------- ----------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n", - "get cell 0.6899712000000591 0.9961774999999307 0.692619\n" + "index raccoon pandas ratio\n", + "---------------------- --------------------- -------------------- ----------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n", + "get cell 0.6728431999999884 0.9376910000000862 0.717553\n" ] } ], @@ -691,7 +691,7 @@ }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 137, "metadata": {}, "outputs": [], "source": [ @@ -708,14 +708,14 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 138, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "46.8 ms ± 3.97 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" + "42.8 ms ± 743 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" ] } ], @@ -725,14 +725,14 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 139, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "423 µs ± 24.1 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n" + "402 µs ± 24.3 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n" ] } ], @@ -742,7 +742,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 140, "metadata": {}, "outputs": [], "source": [ @@ -751,23 +751,23 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 141, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "---------------------- ---------------------- ---------------------- ------------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n", - "get cell 0.6899712000000591 0.9961774999999307 0.692619\n", - "get column all index 0.04172945999999911 0.00037849979999998593 110.25\n" + "index raccoon pandas ratio\n", + "---------------------- --------------------- --------------------- ------------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n", + "get cell 0.6728431999999884 0.9376910000000862 0.717553\n", + "get column all index 0.041298069999993456 0.0003524336000000403 117.18\n" ] } ], @@ -777,7 +777,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 142, "metadata": {}, "outputs": [], "source": [ @@ -798,14 +798,14 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 143, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "637 ms ± 51.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "609 ms ± 62.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -815,14 +815,14 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 144, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "6.91 s ± 158 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "7.1 s ± 40.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -832,7 +832,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 145, "metadata": {}, "outputs": [], "source": [ @@ -841,24 +841,24 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 146, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "----------------------- ---------------------- ---------------------- ------------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n", - "get cell 0.6899712000000591 0.9961774999999307 0.692619\n", - "get column all index 0.04172945999999911 0.00037849979999998593 110.25\n", - "get column subset index 0.5775211000000127 6.717084499999942 0.0859779\n" + "index raccoon pandas ratio\n", + "----------------------- --------------------- --------------------- ------------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n", + "get cell 0.6728431999999884 0.9376910000000862 0.717553\n", + "get column all index 0.041298069999993456 0.0003524336000000403 117.18\n", + "get column subset index 0.5668462000003274 7.041264400000273 0.0805035\n" ] } ], @@ -868,7 +868,7 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 147, "metadata": {}, "outputs": [], "source": [ @@ -885,14 +885,14 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 148, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "1.09 s ± 28.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "1.07 s ± 27.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -902,14 +902,14 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 149, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "240 ms ± 18.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "229 ms ± 9.34 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -919,7 +919,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 150, "metadata": {}, "outputs": [], "source": [ @@ -928,25 +928,25 @@ }, { "cell_type": "code", - "execution_count": 70, + "execution_count": 151, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "----------------------- ---------------------- ---------------------- ------------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n", - "get cell 0.6899712000000591 0.9961774999999307 0.692619\n", - "get column all index 0.04172945999999911 0.00037849979999998593 110.25\n", - "get column subset index 0.5775211000000127 6.717084499999942 0.0859779\n", - "get index all columns 1.0432272999998986 0.21270430000004126 4.90459\n" + "index raccoon pandas ratio\n", + "----------------------- --------------------- --------------------- ------------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n", + "get cell 0.6728431999999884 0.9376910000000862 0.717553\n", + "get column all index 0.041298069999993456 0.0003524336000000403 117.18\n", + "get column subset index 0.5668462000003274 7.041264400000273 0.0805035\n", + "get index all columns 1.0389918000000762 0.2065747999999985 5.02962\n" ] } ], @@ -964,7 +964,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 152, "metadata": {}, "outputs": [], "source": [ @@ -979,7 +979,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 153, "metadata": {}, "outputs": [], "source": [ @@ -998,14 +998,14 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 154, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "593 ms ± 64.4 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "578 ms ± 33.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -1015,14 +1015,14 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": 155, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "1.35 s ± 62.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "1.36 s ± 65.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -1032,7 +1032,7 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": 156, "metadata": {}, "outputs": [], "source": [ @@ -1041,26 +1041,26 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 157, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "----------------------- ---------------------- ---------------------- ------------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n", - "get cell 0.6899712000000591 0.9961774999999307 0.692619\n", - "get column all index 0.04172945999999911 0.00037849979999998593 110.25\n", - "get column subset index 0.5775211000000127 6.717084499999942 0.0859779\n", - "get index all columns 1.0432272999998986 0.21270430000004126 4.90459\n", - "set cell 0.5252357000000529 1.2596571000000267 0.416967\n" + "index raccoon pandas ratio\n", + "----------------------- --------------------- --------------------- ------------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n", + "get cell 0.6728431999999884 0.9376910000000862 0.717553\n", + "get column all index 0.041298069999993456 0.0003524336000000403 117.18\n", + "get column subset index 0.5668462000003274 7.041264400000273 0.0805035\n", + "get index all columns 1.0389918000000762 0.2065747999999985 5.02962\n", + "set cell 0.5282995000002302 1.26670009999998 0.417068\n" ] } ], @@ -1070,7 +1070,7 @@ }, { "cell_type": "code", - "execution_count": 77, + "execution_count": 158, "metadata": {}, "outputs": [], "source": [ @@ -1087,14 +1087,14 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 159, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "6.03 ms ± 761 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" + "5.84 ms ± 512 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" ] } ], @@ -1104,14 +1104,14 @@ }, { "cell_type": "code", - "execution_count": 79, + "execution_count": 160, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "16.6 ms ± 521 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" + "17.2 ms ± 516 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" ] } ], @@ -1121,7 +1121,7 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": 161, "metadata": {}, "outputs": [], "source": [ @@ -1130,27 +1130,27 @@ }, { "cell_type": "code", - "execution_count": 81, + "execution_count": 162, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "----------------------- ---------------------- ---------------------- ------------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n", - "get cell 0.6899712000000591 0.9961774999999307 0.692619\n", - "get column all index 0.04172945999999911 0.00037849979999998593 110.25\n", - "get column subset index 0.5775211000000127 6.717084499999942 0.0859779\n", - "get index all columns 1.0432272999998986 0.21270430000004126 4.90459\n", - "set cell 0.5252357000000529 1.2596571000000267 0.416967\n", - "set column all index 0.005190033000000085 0.015970144000000346 0.324983\n" + "index raccoon pandas ratio\n", + "----------------------- --------------------- --------------------- ------------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n", + "get cell 0.6728431999999884 0.9376910000000862 0.717553\n", + "get column all index 0.041298069999993456 0.0003524336000000403 117.18\n", + "get column subset index 0.5668462000003274 7.041264400000273 0.0805035\n", + "get index all columns 1.0389918000000762 0.2065747999999985 5.02962\n", + "set cell 0.5282995000002302 1.26670009999998 0.417068\n", + "set column all index 0.00548794899999848 0.01662835399999949 0.330036\n" ] } ], @@ -1160,7 +1160,7 @@ }, { "cell_type": "code", - "execution_count": 82, + "execution_count": 163, "metadata": {}, "outputs": [], "source": [ @@ -1181,14 +1181,14 @@ }, { "cell_type": "code", - "execution_count": 83, + "execution_count": 164, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "413 ms ± 60.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "380 ms ± 7.21 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -1198,14 +1198,14 @@ }, { "cell_type": "code", - "execution_count": 84, + "execution_count": 165, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "1min ± 660 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "59 s ± 732 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -1215,7 +1215,7 @@ }, { "cell_type": "code", - "execution_count": 85, + "execution_count": 166, "metadata": {}, "outputs": [], "source": [ @@ -1224,28 +1224,28 @@ }, { "cell_type": "code", - "execution_count": 86, + "execution_count": 167, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "----------------------- ---------------------- ---------------------- ------------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n", - "get cell 0.6899712000000591 0.9961774999999307 0.692619\n", - "get column all index 0.04172945999999911 0.00037849979999998593 110.25\n", - "get column subset index 0.5775211000000127 6.717084499999942 0.0859779\n", - "get index all columns 1.0432272999998986 0.21270430000004126 4.90459\n", - "set cell 0.5252357000000529 1.2596571000000267 0.416967\n", - "set column all index 0.005190033000000085 0.015970144000000346 0.324983\n", - "set column subset index 0.33617850000007365 60.102627299999995 0.00559341\n" + "index raccoon pandas ratio\n", + "----------------------- --------------------- --------------------- ------------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n", + "get cell 0.6728431999999884 0.9376910000000862 0.717553\n", + "get column all index 0.041298069999993456 0.0003524336000000403 117.18\n", + "get column subset index 0.5668462000003274 7.041264400000273 0.0805035\n", + "get index all columns 1.0389918000000762 0.2065747999999985 5.02962\n", + "set cell 0.5282995000002302 1.26670009999998 0.417068\n", + "set column all index 0.00548794899999848 0.01662835399999949 0.330036\n", + "set column subset index 0.37289839999994 58.03955229999974 0.0064249\n" ] } ], @@ -1255,7 +1255,7 @@ }, { "cell_type": "code", - "execution_count": 87, + "execution_count": 168, "metadata": {}, "outputs": [], "source": [ @@ -1264,7 +1264,7 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 169, "metadata": {}, "outputs": [], "source": [ @@ -1281,14 +1281,14 @@ }, { "cell_type": "code", - "execution_count": 89, + "execution_count": 170, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "65.5 ms ± 7.62 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" + "64.4 ms ± 513 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" ] } ], @@ -1298,14 +1298,14 @@ }, { "cell_type": "code", - "execution_count": 90, + "execution_count": 171, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "1.36 s ± 63.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "1.41 s ± 15.8 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -1315,7 +1315,7 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 172, "metadata": {}, "outputs": [], "source": [ @@ -1324,29 +1324,29 @@ }, { "cell_type": "code", - "execution_count": 92, + "execution_count": 173, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "----------------------- ---------------------- ---------------------- ------------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n", - "get cell 0.6899712000000591 0.9961774999999307 0.692619\n", - "get column all index 0.04172945999999911 0.00037849979999998593 110.25\n", - "get column subset index 0.5775211000000127 6.717084499999942 0.0859779\n", - "get index all columns 1.0432272999998986 0.21270430000004126 4.90459\n", - "set cell 0.5252357000000529 1.2596571000000267 0.416967\n", - "set column all index 0.005190033000000085 0.015970144000000346 0.324983\n", - "set column subset index 0.33617850000007365 60.102627299999995 0.00559341\n", - "set index all columns 0.059601720000000566 1.2854537000000619 0.0463663\n" + "index raccoon pandas ratio\n", + "----------------------- --------------------- --------------------- ------------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n", + "get cell 0.6728431999999884 0.9376910000000862 0.717553\n", + "get column all index 0.041298069999993456 0.0003524336000000403 117.18\n", + "get column subset index 0.5668462000003274 7.041264400000273 0.0805035\n", + "get index all columns 1.0389918000000762 0.2065747999999985 5.02962\n", + "set cell 0.5282995000002302 1.26670009999998 0.417068\n", + "set column all index 0.00548794899999848 0.01662835399999949 0.330036\n", + "set column subset index 0.37289839999994 58.03955229999974 0.0064249\n", + "set index all columns 0.06374265999997988 1.390037300000131 0.0458568\n" ] } ], @@ -1364,7 +1364,7 @@ }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 174, "metadata": {}, "outputs": [], "source": [ @@ -1378,14 +1378,14 @@ }, { "cell_type": "code", - "execution_count": 94, + "execution_count": 175, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "12.1 ms ± 5.09 ms per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" + "16 ms ± 953 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" ] } ], @@ -1395,14 +1395,14 @@ }, { "cell_type": "code", - "execution_count": 95, + "execution_count": 176, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "369 µs ± 16.2 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n" + "859 µs ± 12.6 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n" ] } ], @@ -1412,7 +1412,7 @@ }, { "cell_type": "code", - "execution_count": 96, + "execution_count": 177, "metadata": {}, "outputs": [], "source": [ @@ -1421,30 +1421,30 @@ }, { "cell_type": "code", - "execution_count": 97, + "execution_count": 178, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "----------------------- ---------------------- ---------------------- ------------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n", - "get cell 0.6899712000000591 0.9961774999999307 0.692619\n", - "get column all index 0.04172945999999911 0.00037849979999998593 110.25\n", - "get column subset index 0.5775211000000127 6.717084499999942 0.0859779\n", - "get index all columns 1.0432272999998986 0.21270430000004126 4.90459\n", - "set cell 0.5252357000000529 1.2596571000000267 0.416967\n", - "set column all index 0.005190033000000085 0.015970144000000346 0.324983\n", - "set column subset index 0.33617850000007365 60.102627299999995 0.00559341\n", - "set index all columns 0.059601720000000566 1.2854537000000619 0.0463663\n", - "sort index 0.006333351999999195 0.00035244710000006306 17.9697\n" + "index raccoon pandas ratio\n", + "----------------------- --------------------- --------------------- ------------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n", + "get cell 0.6728431999999884 0.9376910000000862 0.717553\n", + "get column all index 0.041298069999993456 0.0003524336000000403 117.18\n", + "get column subset index 0.5668462000003274 7.041264400000273 0.0805035\n", + "get index all columns 1.0389918000000762 0.2065747999999985 5.02962\n", + "set cell 0.5282995000002302 1.26670009999998 0.417068\n", + "set column all index 0.00548794899999848 0.01662835399999949 0.330036\n", + "set column subset index 0.37289839999994 58.03955229999974 0.0064249\n", + "set index all columns 0.06374265999997988 1.390037300000131 0.0458568\n", + "sort index 0.014900102999999944 0.0008343847000001006 17.8576\n" ] } ], @@ -1462,7 +1462,7 @@ }, { "cell_type": "code", - "execution_count": 98, + "execution_count": 179, "metadata": {}, "outputs": [], "source": [ @@ -1477,7 +1477,7 @@ }, { "cell_type": "code", - "execution_count": 99, + "execution_count": 180, "metadata": {}, "outputs": [], "source": [ @@ -1494,15 +1494,14 @@ }, { "cell_type": "code", - "execution_count": 100, + "execution_count": 181, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "The slowest run took 1823.08 times longer than the fastest. This could mean that an intermediate result is being cached.\n", - "3.06 s ± 7.45 s per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" + "27.2 ms ± 381 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" ] } ], @@ -1512,14 +1511,14 @@ }, { "cell_type": "code", - "execution_count": 101, + "execution_count": 182, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "27.3 ms ± 4.13 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" + "34 ms ± 532 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" ] } ], @@ -1529,7 +1528,7 @@ }, { "cell_type": "code", - "execution_count": 102, + "execution_count": 183, "metadata": {}, "outputs": [], "source": [ @@ -1538,31 +1537,31 @@ }, { "cell_type": "code", - "execution_count": 103, + "execution_count": 184, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "----------------------- ---------------------- ---------------------- ------------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n", - "get cell 0.6899712000000591 0.9961774999999307 0.692619\n", - "get column all index 0.04172945999999911 0.00037849979999998593 110.25\n", - "get column subset index 0.5775211000000127 6.717084499999942 0.0859779\n", - "get index all columns 1.0432272999998986 0.21270430000004126 4.90459\n", - "set cell 0.5252357000000529 1.2596571000000267 0.416967\n", - "set column all index 0.005190033000000085 0.015970144000000346 0.324983\n", - "set column subset index 0.33617850000007365 60.102627299999995 0.00559341\n", - "set index all columns 0.059601720000000566 1.2854537000000619 0.0463663\n", - "sort index 0.006333351999999195 0.00035244710000006306 17.9697\n", - "iterate rows 0.011689108999999007 0.02018434999999954 0.579117\n" + "index raccoon pandas ratio\n", + "----------------------- --------------------- --------------------- ------------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n", + "get cell 0.6728431999999884 0.9376910000000862 0.717553\n", + "get column all index 0.041298069999993456 0.0003524336000000403 117.18\n", + "get column subset index 0.5668462000003274 7.041264400000273 0.0805035\n", + "get index all columns 1.0389918000000762 0.2065747999999985 5.02962\n", + "set cell 0.5282995000002302 1.26670009999998 0.417068\n", + "set column all index 0.00548794899999848 0.01662835399999949 0.330036\n", + "set column subset index 0.37289839999994 58.03955229999974 0.0064249\n", + "set index all columns 0.06374265999997988 1.390037300000131 0.0458568\n", + "sort index 0.014900102999999944 0.0008343847000001006 17.8576\n", + "iterate rows 0.026519559999997 0.03318497000000207 0.799144\n" ] } ], @@ -1580,7 +1579,7 @@ }, { "cell_type": "code", - "execution_count": 104, + "execution_count": 185, "metadata": {}, "outputs": [], "source": [ @@ -1595,7 +1594,7 @@ }, { "cell_type": "code", - "execution_count": 105, + "execution_count": 186, "metadata": {}, "outputs": [], "source": [ @@ -1604,7 +1603,7 @@ }, { "cell_type": "code", - "execution_count": 106, + "execution_count": 187, "metadata": {}, "outputs": [], "source": [ @@ -1621,14 +1620,14 @@ }, { "cell_type": "code", - "execution_count": 107, + "execution_count": 188, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "19.3 ms ± 1.1 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" + "33 ms ± 3.08 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" ] } ], @@ -1638,14 +1637,14 @@ }, { "cell_type": "code", - "execution_count": 108, + "execution_count": 189, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "300 ms ± 20.2 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "723 ms ± 30.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -1655,7 +1654,7 @@ }, { "cell_type": "code", - "execution_count": 109, + "execution_count": 190, "metadata": {}, "outputs": [], "source": [ @@ -1664,32 +1663,32 @@ }, { "cell_type": "code", - "execution_count": 110, + "execution_count": 191, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "----------------------- ---------------------- ---------------------- ------------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n", - "get cell 0.6899712000000591 0.9961774999999307 0.692619\n", - "get column all index 0.04172945999999911 0.00037849979999998593 110.25\n", - "get column subset index 0.5775211000000127 6.717084499999942 0.0859779\n", - "get index all columns 1.0432272999998986 0.21270430000004126 4.90459\n", - "set cell 0.5252357000000529 1.2596571000000267 0.416967\n", - "set column all index 0.005190033000000085 0.015970144000000346 0.324983\n", - "set column subset index 0.33617850000007365 60.102627299999995 0.00559341\n", - "set index all columns 0.059601720000000566 1.2854537000000619 0.0463663\n", - "sort index 0.006333351999999195 0.00035244710000006306 17.9697\n", - "iterate rows 0.011689108999999007 0.02018434999999954 0.579117\n", - "insert rows 0.017893760000015392 0.2766252000001259 0.0646859\n" + "index raccoon pandas ratio\n", + "----------------------- --------------------- --------------------- ------------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n", + "get cell 0.6728431999999884 0.9376910000000862 0.717553\n", + "get column all index 0.041298069999993456 0.0003524336000000403 117.18\n", + "get column subset index 0.5668462000003274 7.041264400000273 0.0805035\n", + "get index all columns 1.0389918000000762 0.2065747999999985 5.02962\n", + "set cell 0.5282995000002302 1.26670009999998 0.417068\n", + "set column all index 0.00548794899999848 0.01662835399999949 0.330036\n", + "set column subset index 0.37289839999994 58.03955229999974 0.0064249\n", + "set index all columns 0.06374265999997988 1.390037300000131 0.0458568\n", + "sort index 0.014900102999999944 0.0008343847000001006 17.8576\n", + "iterate rows 0.026519559999997 0.03318497000000207 0.799144\n", + "insert rows 0.030685470000025816 0.6862636999999268 0.0447138\n" ] } ], @@ -1708,7 +1707,7 @@ }, { "cell_type": "code", - "execution_count": 113, + "execution_count": 192, "metadata": {}, "outputs": [], "source": [ @@ -1729,14 +1728,14 @@ }, { "cell_type": "code", - "execution_count": 114, + "execution_count": 193, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "54.9 ms ± 1.24 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" + "134 ms ± 4.28 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" ] } ], @@ -1746,14 +1745,14 @@ }, { "cell_type": "code", - "execution_count": 115, + "execution_count": 194, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "12.9 s ± 707 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" + "29.4 s ± 124 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n" ] } ], @@ -1763,7 +1762,7 @@ }, { "cell_type": "code", - "execution_count": 116, + "execution_count": 195, "metadata": {}, "outputs": [], "source": [ @@ -1772,33 +1771,33 @@ }, { "cell_type": "code", - "execution_count": 117, + "execution_count": 196, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "index raccoon pandas ratio\n", - "----------------------- ---------------------- ---------------------- ------------\n", - "version 3.0.0 0.25.2\n", - "initialize empty 0.08051184000000262 4.216560099999981 0.0190942\n", - "initialize with matrix 0.00011038290999999845 0.015230743999999276 0.00724737\n", - "add rows one column 0.05175027999999884 16.65805690000002 0.00310662\n", - "add matrix 0.009487011999999595 0.29534590000002936 0.0321217\n", - "append 0.07532331999999542 0.35071719999996276 0.214769\n", - "get cell 0.6899712000000591 0.9961774999999307 0.692619\n", - "get column all index 0.04172945999999911 0.00037849979999998593 110.25\n", - "get column subset index 0.5775211000000127 6.717084499999942 0.0859779\n", - "get index all columns 1.0432272999998986 0.21270430000004126 4.90459\n", - "set cell 0.5252357000000529 1.2596571000000267 0.416967\n", - "set column all index 0.005190033000000085 0.015970144000000346 0.324983\n", - "set column subset index 0.33617850000007365 60.102627299999995 0.00559341\n", - "set index all columns 0.059601720000000566 1.2854537000000619 0.0463663\n", - "sort index 0.006333351999999195 0.00035244710000006306 17.9697\n", - "iterate rows 0.011689108999999007 0.02018434999999954 0.579117\n", - "insert rows 0.017893760000015392 0.2766252000001259 0.0646859\n", - "time series 0.0528872699999738 11.787703099999817 0.00448665\n" + "index raccoon pandas ratio\n", + "----------------------- --------------------- --------------------- ------------\n", + "version 3.0.0 0.25.2\n", + "initialize empty 0.08248082999998588 4.237655099999756 0.0194638\n", + "initialize with matrix 0.0001130529800000204 0.014922300999996878 0.00757611\n", + "add rows one column 0.050407570000015764 16.86793469999975 0.00298837\n", + "add matrix 0.009786346000000777 0.28846930000008797 0.0339251\n", + "append 0.07348676999999952 0.346767699999873 0.211919\n", + "get cell 0.6728431999999884 0.9376910000000862 0.717553\n", + "get column all index 0.041298069999993456 0.0003524336000000403 117.18\n", + "get column subset index 0.5668462000003274 7.041264400000273 0.0805035\n", + "get index all columns 1.0389918000000762 0.2065747999999985 5.02962\n", + "set cell 0.5282995000002302 1.26670009999998 0.417068\n", + "set column all index 0.00548794899999848 0.01662835399999949 0.330036\n", + "set column subset index 0.37289839999994 58.03955229999974 0.0064249\n", + "set index all columns 0.06374265999997988 1.390037300000131 0.0458568\n", + "sort index 0.014900102999999944 0.0008343847000001006 17.8576\n", + "iterate rows 0.026519559999997 0.03318497000000207 0.799144\n", + "insert rows 0.030685470000025816 0.6862636999999268 0.0447138\n", + "time series 0.13054121000000124 29.182044600000154 0.00447334\n" ] } ], diff --git a/examples/usage_dataframe.ipynb b/examples/usage_dataframe.ipynb index 680a3f3..06984ba 100644 --- a/examples/usage_dataframe.ipynb +++ b/examples/usage_dataframe.ipynb @@ -56,7 +56,7 @@ { "data": { "text/plain": [ - "object id: 2825568275624\n", + "object id: 2305959579080\n", "columns:\n", "[]\n", "data:\n", @@ -88,7 +88,7 @@ { "data": { "text/plain": [ - "object id: 2825566445192\n", + "object id: 2305959578792\n", "columns:\n", "['a', 'b', 'c']\n", "data:\n", @@ -120,7 +120,7 @@ { "data": { "text/plain": [ - "object id: 2825586678184\n", + "object id: 2305959818248\n", "columns:\n", "['a', 'b']\n", "data:\n", @@ -1733,7 +1733,7 @@ { "data": { "text/plain": [ - "object id: 2825586963560\n", + "object id: 2305960012584\n", "columns:\n", "['a', 'b', 'index_0']\n", "data:\n", diff --git a/examples/usage_dropin.ipynb b/examples/usage_dropin.ipynb index bd0e498..06322ae 100644 --- a/examples/usage_dropin.ipynb +++ b/examples/usage_dropin.ipynb @@ -47,7 +47,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -56,7 +56,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": { "pycharm": { "is_executing": false @@ -70,7 +70,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -79,7 +79,7 @@ "blist([blist([1, 2, 3])])" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -91,7 +91,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -100,7 +100,7 @@ "blist([5, 6, 7])" ] }, - "execution_count": 5, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -111,7 +111,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -120,7 +120,7 @@ "blist(['a'])" ] }, - "execution_count": 6, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -131,7 +131,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -140,7 +140,7 @@ "blist.blist" ] }, - "execution_count": 9, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -159,7 +159,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -168,7 +168,7 @@ "2" ] }, - "execution_count": 11, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -179,7 +179,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -211,7 +211,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 11, "metadata": { "editable": true }, @@ -223,7 +223,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 12, "metadata": { "collapsed": false, "editable": true, @@ -238,7 +238,7 @@ "blist([1, 2, 3])" ] }, - "execution_count": 22, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -250,7 +250,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 13, "metadata": { "collapsed": false, "editable": true, @@ -265,7 +265,7 @@ "blist([5, 6, 7])" ] }, - "execution_count": 23, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } diff --git a/examples/usage_series.ipynb b/examples/usage_series.ipynb index f924823..b4e5b2c 100644 --- a/examples/usage_series.ipynb +++ b/examples/usage_series.ipynb @@ -69,7 +69,7 @@ { "data": { "text/plain": [ - "object id: 2654281297144\n", + "object id: 1924106416536\n", "data:\n", "[]\n", "index:\n", @@ -102,7 +102,7 @@ { "data": { "text/plain": [ - "object id: 2654281296584\n", + "object id: 1924104590056\n", "data:\n", "[None, None, None]\n", "index:\n", @@ -135,7 +135,7 @@ { "data": { "text/plain": [ - "object id: 2654281511656\n", + "object id: 1924106418216\n", "data:\n", "[4, 5, 6]\n", "index:\n", @@ -1691,7 +1691,7 @@ { "data": { "text/plain": [ - "object id: 2654281717912\n", + "object id: 1924106640744\n", "data:\n", "[1, 2, 3]\n", "index:\n",