Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "dev", "master" ]
pull_request:
branches: [ "dev", "master" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.11", "3.12", "3.13" ]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest tabulate
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
run: |
pytest
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ My hope is that one day Pandas solves the speed problem with growing DataFrames

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
Raccoon requires Python 3.11 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
Expand Down
6 changes: 6 additions & 0 deletions docs/change_log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,9 @@ an installation requirement.
- Small fixes to pyproject.toml
- Remove travis-CI configs as it is no longer used
- Merge coveragerc file into pyproject.toml

3.2.0 (04/14/25)
~~~~~~~~~~~~~~~~
- Add type hints
- Add as_namedtuple option to DataFrame get_columns() and get_location()
- minimum python version now 3.11
11 changes: 5 additions & 6 deletions docs/raccoon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,37 @@ raccoon.dataframe module

.. automodule:: raccoon.dataframe
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

raccoon.series module
---------------------

.. automodule:: raccoon.series
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

raccoon.sort\_utils module
--------------------------

.. automodule:: raccoon.sort_utils
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

raccoon.utils module
--------------------

.. automodule:: raccoon.utils
:members:
:undoc-members:
:show-inheritance:

:undoc-members:

Module contents
---------------

.. automodule:: raccoon
:members:
:undoc-members:
:show-inheritance:
:undoc-members:
50 changes: 41 additions & 9 deletions docs/usage_dataframe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Example Usage for DataFrame
.. code:: python

# remove comment to use latest development version
import sys; sys.path.insert(0, '../')
import sys;

sys.path.insert(0, '../')

.. code:: python

Expand All @@ -25,7 +27,7 @@ Initialize

.. parsed-literal::

object id: 2305959579080
object id: 1602323641696
columns:
[]
data:
Expand All @@ -46,7 +48,7 @@ Initialize

.. parsed-literal::

object id: 2305959578792
object id: 1602323630096
columns:
['a', 'b', 'c']
data:
Expand All @@ -67,7 +69,7 @@ Initialize

.. parsed-literal::

object id: 2305959818248
object id: 1602323182784
columns:
['a', 'b']
data:
Expand Down Expand Up @@ -400,7 +402,7 @@ Set Values
.. code:: python

# append rows, again use caution
df.append_rows([15, 16], {'a': [55, 56], 'd': [100,101]})
df.append_rows([15, 16], {'a': [55, 56], 'd': [100, 101]})
print(df)


Expand Down Expand Up @@ -544,6 +546,20 @@ Get Values



.. code:: python

# get a row and return as a namedtuple, excluding the index
df.get_columns(index=13, columns=['a', 'b'], as_namedtuple=True, name="tuplename", include_index=False)




.. parsed-literal::

tuplename(a=33, b=55)



Set and Get by Location
-----------------------

Expand Down Expand Up @@ -579,13 +595,29 @@ from 0…len(index)

.. code:: python

print(df.get_location(0, ['b', 'c'], as_dict=True))
df.get_location(0, ['b', 'c'], as_dict=True)




.. parsed-literal::

{'b': 88, 'c': 1, 'index': 10}




.. code:: python

df.get_location(1, as_namedtuple=True, name="tuplename", index=False)




.. parsed-literal::

tuplename(a=2, b=55, c=2, d=None)



.. code:: python

Expand Down Expand Up @@ -1134,7 +1166,7 @@ Reset Index

.. parsed-literal::

object id: 2305960012584
object id: 1602314513728
columns:
['a', 'b', 'index_0']
data:
Expand Down Expand Up @@ -1177,7 +1209,7 @@ Reset Index
.. code:: python

df = rc.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]}, columns=['a', 'b'],
index=[('a', 10, 'x'), ('b', 11, 'y'), ('c', 12, 'z')], index_name=('melo', 'helo', 'gelo'))
index=[('a', 10, 'x'), ('b', 11, 'y'), ('c', 12, 'z')], index_name=('melo', 'helo', 'gelo'))
print(df)


Expand Down
Loading