Giter VIP home page Giter VIP logo

pysony's Introduction

pysony

Pysony is a package written in the Python language for analysing datasets that include coordinate data.

Instalation

Install package

python3 -m pip install git+ssh://[email protected]/rojo1997/pysony.git

Update package

python3 -m pip install git+ssh://[email protected]/rojo1997/pysony.git --upgrade

Force update package

python3 -m pip install --upgrade --force-reinstall git+ssh://[email protected]/rojo1997/pysony.git

Quick start

import numpy as np
import pandas as pd

from pysony.feature_extraction import (
    ReverseGeocoder,
    OpenWeatherMap
)

from pysony.graph import GraphDistance

X = np.random.rand(10,2) / 2
X[:,0] += -0.1729636 # lon
X[:,1] += 51.5214588 # lat

myReverseGeocoder = ReverseGeocoder(mode = 1)
myOpenWeatherMap = OpenWeatherMap(
    appid = "apikey"
)

Y = myReverseGeocoder.transform(X)
df = pd.DataFrame(Y, columns = ReverseGeocoder.columns)
print(df)
"""
              name   admin1          admin2
0         East Ham  England  Greater London
1          Takeley  England           Essex
2  Watton at Stone  England   Hertfordshire
3           Harlow  England           Essex
4      Hadley Wood  England  Greater London
5     Great Dunmow  England           Essex
6          Cuffley  England   Hertfordshire
7         Elsenham  England           Essex
8          Takeley  England           Essex
9    Waltham Cross  England   Hertfordshire
"""


Y = myOpenWeatherMap.transform(X)
df = pd.DataFrame(Y, columns = OpenWeatherMap.columns)
print(df)
"""
     temp  feels_like  temp_min  ...  humidity  wind_deg  wind_speed
0  278.63      276.85    277.91  ...      83.0     190.0        2.24
1  279.40      278.73    278.38  ...      76.0     198.0        1.34
2  279.04      275.11    278.08  ...      75.0     220.0        6.17
3  279.15      276.77    278.18  ...      75.0     212.0        3.13
4  278.56      273.08    277.91  ...      81.0     200.0       10.80
5  279.22      278.53    278.29  ...      76.0     213.0        1.34
6  278.40      277.60    277.80  ...      82.0     182.0        1.34
7  279.15      277.09    278.16  ...      75.0     221.0        2.68
8  278.93      276.50    278.01  ...      75.0     212.0        3.13
9  279.10      276.71    278.14  ...      75.0     212.0        3.13
"""

myGraphDistance = GraphDistance(
    threshold = 20
)

node, edge = myGraphDistance.compute(X)
print(node)
"""
[
    {
        '_key': '4630749269486329968', 
        'lon': 0.1006591339173672, 
        'lat': 51.68475507121363
    }, 
    {
        '_key': '-5026963679244352995', 
        'lon': 0.012806647114927683,
        'lat': 51.56462585311571
    }, 
    ...
]
"""
print(edge)
"""
[
    {
        '_from': 'node/4630749269486329968', 
        '_to': 'node/-5026963679244352995', 
        'distance': 14.685114751012092
    }, 
    {
        '_from': 'node/4630749269486329968', 
        '_to': 'node/-6188015243388749057', 
        'distance': 14.304432606569964
    },
    ...
]
"""

Docker

docker build --pull --rm -t pysony:latest "."
docker tag pysony:latest rojo1997/pysony:latest
docker push rojo1997/pysony:latest

pysony's People

Contributors

rojo1997 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.