Skip to main content

A package with japanese-related functions

Project description

Wagano is a Multi-purpose package designed for japanese-related functions. An extension of its features goes to a calculation.py file, where different features associated with math overlay.

Logo

Table of Contents

Requirements

Installation

Help

Build Source Code

License

Features

Haversine

Mean

Median

Stdev

_sum

Summary

Requirements

There is one thing you must have installed (the basics) before installing this module:

  • Python 3.6.8

It may work on other versions, however, it has not been tested whether it'll work on them or not.

Installation

One of the recommended ways to install wagano is by PyPi's pip.

pip install wagano

Another way to get wagano is to git clone.

git clone https://github.com/ichirod-japan/waganolib.git

Then you can run the setup file from there.

python setup.py install

(or if you're on a Unix-Like OS (such as MacOS or Linux), use sudo python setup.py install)

Help

If you need help or have an issue, do not hesitate to open one at https://github.com/ichirod-japan/waganolib/issues Very soon, this module is going to have a documentation to answer some of the basic questions. Remember before submitting an issue, check other issues (closed as well) and see if your question has already been answered.

build-source-code

If you want to use features that are currently in development, or you want to contribute to wagano, you will need to build wagano locally from its source code, rather than pip installing it.

Installing from source is fairly automated. The most work will involve compiling and installing all the wagano dependencies (not much, really). Once that is done, run the setup.py script which will attempt to auto-configure, build, and install wagano.

License

This library is distributed under the MIT License which can be found in the waganolib/LICENSE file.

Features

The following is a content table for all the features and only features of this README.md file.

Haversine

Mean

Median

Stdev

_sum

Summary

Haversine

To use one of the basic functions on this module, also known as haversine you can copy the following code for testing:

print(calculation.haversine(52.370216, 4.895168, 52.520008,
    13.404954) == 945793.4375088713)

Harversine gets you the ability to Calculate the great circle distance between two points on the earth (specified in decimal degrees), returns the distance in meters. All arguments must be of equal length. :param lon1: longitude of first place :param lat1: latitude of first place :param lon2: longitude of second place :param lat2: latitude of second place :return: distance in meters between the two sets of coordinates So far, this is not japanese-related but is included in calculation.py so as to help you in the field of math and algebra. Other calculation functions will be listed in future updates on here.

mean([])

Mean is a default feature that would allow you to Calculate the arithmetic mean ("the average") of data:

>>> mean([-1.0, 2.5, 3.25, 5.75])
2.625

The calculation of the average is a known default, but has been tweaked a little to fit the purpose.

median([])

Median is a feature that is similar to the one previously shown, mean, and it calculates the standard median of discrete data:

>>> median([2, 3, 4, 5])
3.5

Median has an extension which calculates the median, or 50th percentile, of data grouped into class intervals centred on the data values provided. E.g. if your data points are rounded to the nearest whole number:

>>> median_grouped([2, 2, 3, 3, 3, 4])  #doctest: +ELLIPSIS
2.8333333333...

This should be interpreted in this way: you have two data points in the class interval 1.5-2.5, three data points in the class interval 2.5-3.5, and one in the class interval 3.5-4.5. The median of these data points is 2.8333... Calculating variability or spread

Table of 4 Following features

================== ============================================= Function Description ================== ============================================= pvariance Population variance of data. variance Sample variance of data. pstdev Population standard deviation of data. stdev Sample standard deviation of data. ================== =============================================

stdev

stdev is a feature that calculates the standard deviation of sample data:

>>> stdev([2.5, 3.25, 5.5, 11.25, 11.75])  #doctest: +ELLIPSIS
4.38961843444...

If you have previously calculated the mean, you can pass it as the optional second argument to the four "spread" functions to avoid recalculating it:

>>> data = [1, 2, 2, 4, 4, 4, 5, 6]
>>> mu = mean(data)
>>> pvariance(data, mu)
2.5

Exceptions

_sum

Yet another feature in calculation.py is the _sum. the _sum returns a high-precision sum of the given numeric data as a fraction, together with the type to be converted to and the count of items. If optional argument start is given, it is added to the total. If data is empty, start (defaulting to 0) is returned. Examples --------

    >>> _sum([3, 2.25, 4.5, -0.5, 1.0], 0.75)
    (<class 'float'>, Fraction(11, 1), 5)
Some sources of round-off error will be avoided:
    # Built-in sum returns zero.
    >>> _sum([1e50, 1, -1e50] * 1000)
    (<class 'float'>, Fraction(1000, 1), 3000)
Fractions and Decimals are also supported:
    >>> from fractions import Fraction as F
    >>> _sum([F(2, 3), F(7, 5), F(1, 4), F(5, 6)])
    (<class 'fractions.Fraction'>, Fraction(63, 20), 4)
    >>> from decimal import Decimal as D
    >>> data = [D("0.1375"), D("0.2108"), D("0.3061"), D("0.0419")]
    >>> _sum(data)
    (<class 'decimal.Decimal'>, Fraction(6963, 10000), 4)
Mixed types are currently treated as an error, except that int is
allowed.

Summary

I don't think you expected this, but I won't list all features over here, you can find most of the features of calculation.py at https://github.com/python/cpython/blob/master/Lib/statistics.py, where most features reside. There is only a calculation.py file for now, since the module is still on 0.5.2, but the japanese-related features will be added very soon, and it is frantically being worked on!

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

wagano-0.5.2.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

wagano-0.5.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file wagano-0.5.2.tar.gz.

File metadata

  • Download URL: wagano-0.5.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.6.8

File hashes

Hashes for wagano-0.5.2.tar.gz
Algorithm Hash digest
SHA256 6f71cba1e6a17d603ae39c31ebc3fb19926f4ae9a4463b48a421e6c83add6710
MD5 04c86b78e38e97a649cbf657aab47dd4
BLAKE2b-256 7682f9984f80afa2562872e9642b09a0ef98893fedc6415495e903bfef9b30c6

See more details on using hashes here.

File details

Details for the file wagano-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: wagano-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.6.8

File hashes

Hashes for wagano-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 832e945d724bcbb4fa857a0a30bf20625c3f309308e4c90f20e15971a38f9f03
MD5 e77fd2c414e19a7eeccbca763db31710
BLAKE2b-256 c65d9337cecf77f84508cf2a2c68a202685a8571ab39bd6c298214f8592f1dd4

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