Skip to main content

A database with multiple data sets that support drawing, These data sets are: World population data set, World Carbon dioxide Concentration data set, World Number of Cities data set, China number of population data set, China number of space vehicles data set......

Project description

A database with multiple data sets that support drawing, These data sets are: World population data set, World Carbon dioxide Concentration data set, World Number of Cities data set, China number of population data set, China number of space vehicles data set......

Features

This project is a dataset with multiple functions, there are many datasets in it, and it has been uploaded to Pypi.

Download

This project uses Pypi, so it is recommended to use Pypi to download

Code: pip3 install Wdatabase

Use

The package name when we upload is not the same as the package name used in actual use When importing, use the following code

from Wdata import WdataMain as main

The main class has the following functions:

Functions Introduction Syntax Return Type
draw Draw Func() None
Save_file Save file Func(filename:str) bool

Import Data

Wdata has a lot of data sets, here we use 200 years of population growth data as an example

The syntax of Wdata_class is as follows: WdataMain(json_fname: str)

json_fname is the name of the dataset

from Wdata import WdataMain as main

test = main('Population_growth')  # import population growth over 200 years

Get data

We can use the dict() function to fetch the data

such as these codes

from Wdata import WdataMain as main

test = main('Population_growth')  # import population growth over 200 years
print(dict(test))

after running

~/python test.py
{
    '1800': 900000000,
    '1820': 1100000000,
    '1840': 1200000000,
    '1860': 1300000000,
    '1880': 1400000000,
    '1900': 1650000000,
    '1920': 1800000000,
    '1940': 2200000000,
    '1960': 3000000000,
    '1980': 4400000000,
    '2000': 5900000000,
    '2022': 7400000000
    }

Drawing

Drawing functions use the draw() function as the following code

from Wdata import WdataMain as main

test = main('Population_growth')  # import population growth over 200 years
test.draw()

The result is this

Data save

You can use the Save_file() function to save data

The syntax of Save_file is Save_file(filename:str, type=JSON) -> None

Parameter description: The filename 'parameter is used to describe saving a file The type 'parameter is used to describe the file type The file types are as follows:

File Type Usage Description
Csv Wdata. CSV Save File file.csv
Json Wdata. JSON Save the file 'file. json' as the default option
Such as the following code
from Wdata import WdataMain as main
from Wdata import CSV
test=main ('Population_growth ') # Import the Population growth in the past 200 years
test. Save_File ('Package_test ', CSV) # This function will automatically add the. csv suffix

Additional Features

Cosine similarity function

The cosine similarity function can calculate the cosine similarity of two coordinates in two-dimensional space according to the cosine similarity formula usage method:

from Wdata import mathfunc
Xy1=(2, 3) # First coordinate
Xy2=(3, 5) # Second coordinate
Result=mathfunc.similarity (xy1, xy2) # Cosine similarity
print(result)

Distance formula

Distance formula Use Euclid distance formula to calculate the distance between two coordinates in two-dimensional space usage method:

from Wdata import mathfunc
xy1 = (2, 3)
xy2 = (3, 5)
Result=mathfunc.distance (xy1, xy2) # Distance formula
print(result)

What data do we have

Currently we have the following data

name description unit of measure
Population_growth Population Growth 1800-2022 People
Chinese_spacecraft 2017-2020.06 Chinese spacecraft launches Spacecraft
World_spacecraft 2017-2020.06 World Spacecraft Launches Spacecraft

The above data comes from Bing and Baidu. The author cannot guarantee the accuracy of the data and should not be used for professional purposes

Donate

Due to special reasons, the author was unable to register a Paypal account and was forced to use Alipay

For details, please see Donation Instructions

About Pypi

The Wdataorg team has used twine to upload this library to Pypi

Wdataorg Pypi account

Wdatabase Pypi warehouse address

License

This open source project uses Apache License 2.0

In the process of using this open source project, please use it strictly in accordance with the license

The final interpretation right belongs to the development team Wdataorg

Project License Link

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

Wdatabase-2.2.0a1.tar.gz (18.7 kB view details)

Uploaded Source

Built Distributions

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

Wdatabase-2.2.0a1-py3.10.egg (19.6 kB view details)

Uploaded Egg

Wdatabase-2.2.0a1-py3.9.egg (19.5 kB view details)

Uploaded Egg

Wdatabase-2.2.0a1-py3.8.egg (19.4 kB view details)

Uploaded Egg

File details

Details for the file Wdatabase-2.2.0a1.tar.gz.

File metadata

  • Download URL: Wdatabase-2.2.0a1.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for Wdatabase-2.2.0a1.tar.gz
Algorithm Hash digest
SHA256 88311b89e9ec7fd572d19bb302b6e4d87038f63e2edc4f6ec48243f868217dc0
MD5 13e4888761a9266c211b6783a5743f9a
BLAKE2b-256 4835aeaee09638c34f274501a9a8af17dbf93c10148dc368b38f68cbbb0319ad

See more details on using hashes here.

File details

Details for the file Wdatabase-2.2.0a1-py3.10.egg.

File metadata

  • Download URL: Wdatabase-2.2.0a1-py3.10.egg
  • Upload date:
  • Size: 19.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for Wdatabase-2.2.0a1-py3.10.egg
Algorithm Hash digest
SHA256 3e45bfe40b88ec5bfbfb71b6a759ef2b8eafbad3d5a120e0a6e773fa9d966614
MD5 79e426e954975aee8dd79b41621abf9c
BLAKE2b-256 e8add885f44514f3fdf5ae0dacbec05ae8631627d512046a1920835840d84a9a

See more details on using hashes here.

File details

Details for the file Wdatabase-2.2.0a1-py3.9.egg.

File metadata

  • Download URL: Wdatabase-2.2.0a1-py3.9.egg
  • Upload date:
  • Size: 19.5 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for Wdatabase-2.2.0a1-py3.9.egg
Algorithm Hash digest
SHA256 92ae5205af85142947698e5f5b1b6798545d73491f3bf7c045ffbc193b59b2cb
MD5 2108c23cfd0ef883687ef623fc68008d
BLAKE2b-256 252f9a66fa00aca931336f7af4a1ee2084efd8ffb488f813bb872a96e53f1a51

See more details on using hashes here.

File details

Details for the file Wdatabase-2.2.0a1-py3.8.egg.

File metadata

  • Download URL: Wdatabase-2.2.0a1-py3.8.egg
  • Upload date:
  • Size: 19.4 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for Wdatabase-2.2.0a1-py3.8.egg
Algorithm Hash digest
SHA256 2b134d5ff626f69d808a0b621ab96710cc77200d72a42d331fbd789ae5a71d5a
MD5 d41b863b460f9564ee1717428f0215aa
BLAKE2b-256 37d6df4567ba4b3313d756191bf2ea2175140618ef40d9dd114d55404aa7417c

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