Skip to main content

Classes for data manipulation

Project description

Python Classes for Data Manipulation

Build Status PyPI

dataiter currently includes classes DataFrame and ListOfDicts.

DataFrame is a class for tabular data similar to R's data.frame or pandas.DataFrame. It is under the hood a dictionary of NumPy arrays and thus capable of fast vectorized operations. You can consider this to be a very experimental, very light-weight alternative to Pandas with a simple and consistent API.

ListOfDicts is a class useful for manipulating data from JSON APIs. It provides functionality similar to libraries such as Underscore.js, with manipulation functions that iterate over the data and return a shallow modified copy of the original. attd.AttributeDict is used to provide convenient access to dictionary keys.

Installation

pip install dataiter

Documentation

dataiter is experimental, undocumented and the API subject to change. If you nevertheless want to try it, take a look at the below examples and see the source code for available functions, and the tests for more usage examples.

Quick Start Example: DataFrame

>>> import dataiter as di
>>> data = di.DataFrame.read_csv("data/vehicles.csv")
>>> data.filter(data.make == "Saab").sort(year=1).head(3)

     id make model  year        class           trans             drive
  int64 <U34  <U39 int64         <U34            <U32              <U26
  ----- ---- ----- ----- ------------ --------------- -----------------
0   380 Saab   900  1985 Compact Cars Automatic 3-spd Front-Wheel Drive
1   381 Saab   900  1985 Compact Cars Automatic 3-spd Front-Wheel Drive
2   382 Saab   900  1985 Compact Cars    Manual 5-spd Front-Wheel Drive

      cyl   displ    fuel   hwy   cty
  float64 float64    <U27 int64 int64
  ------- ------- ------- ----- -----
0      4.      2. Regular    19    16
1      4.      2. Regular    21    16
2      4.      2. Regular    23    17

Quick Start Example: ListOfDicts

>>> import dataiter as di
>>> data = di.ListOfDicts.read_json("data/vehicles.json")
>>> data.filter(make="Saab").sort(year=1).head(1)
[
  {
    "id": 380,
    "make": "Saab",
    "model": "900",
    "year": 1985,
    "class": "Compact Cars",
    "trans": "Automatic 3-spd",
    "drive": "Front-Wheel Drive",
    "cyl": 4,
    "displ": 2,
    "fuel": "Regular",
    "hwy": 19,
    "cty": 16
  }
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dataiter-0.8.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dataiter-0.8-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file dataiter-0.8.tar.gz.

File metadata

  • Download URL: dataiter-0.8.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.3rc1

File hashes

Hashes for dataiter-0.8.tar.gz
Algorithm Hash digest
SHA256 a83b3dd9ffffaaddfd24a6148dc12a53101a57087fe3224771d0bef08769f569
MD5 d74d8ed4673a6ebe9a879a157ed954f5
BLAKE2b-256 b28ecb83c3e927754432d3bfdda3b1c09659b949f5cd327bd1b6785c35411583

See more details on using hashes here.

File details

Details for the file dataiter-0.8-py3-none-any.whl.

File metadata

  • Download URL: dataiter-0.8-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.3rc1

File hashes

Hashes for dataiter-0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a48f5b8ecf33b6adb1387ed8fd2c81cfc18fe39a1adaf7ad9d456720266e481e
MD5 7e93525c2642cc24927df190dfe3c92f
BLAKE2b-256 b50ec34decb8c9ce6ff6c508d63b2aa38d8e6707275128bc341a7587eb9a45e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page