Skip to main content

A tool for predictive analytic

Project description

A package to make common data analysis easier

Objective: To make common analysis easier and more expressive.

To install the package

pip install morris-learning==0.0.2

Let me show you how the package works

Input [1]:

from morris_lee_package import morris_coding as m
df =m.get_df()
df

Output [1]:

+----+--------+--------+----------+--------+
|    |   col1 |   col2 | col3     |   col4 |
+====+========+========+==========+========+
|  0 |      1 |      3 | dog      |      9 |
+----+--------+--------+----------+--------+
|  1 |      2 |      4 |          |      8 |
+----+--------+--------+----------+--------+
|  2 |      3 |      5 | dog      |    nan |
+----+--------+--------+----------+--------+
|  3 |      4 |      6 | elephant |      6 |
+----+--------+--------+----------+--------+
|  4 |      5 |      7 | dragon   |      5 |
+----+--------+--------+----------+--------+

Input [2]:

# To identify whether there is any null values:
m.null(df,'df')

# To easy print dimension of a dataframe
m.shape(df, 'df')

Output [2]:

STATUS: There is null value in dataframe
STATUS: Nulls of df = {'col3': '1 (20.0%)', 'col4': '1 (20.0%)'} of total 5
STATUS: Dimension of "df" = (5, 4)

Input [3]:

# To identify whether there is any duplicate values in a column:
m.duplicate(df, 'col3')

Output [3]:

STATUS: There are 1 duplicate values in the column of "col3"

Input [4]:

# To easy print value counts of a column, including also percentage:
m.vc(df, 'col3')

Output [4]:

+----------+---------+------------------+
| col3     |   count |   percentage (%) |
+==========+=========+==================+
| dog      |       2 |               50 |
+----------+---------+------------------+
| dragon   |       1 |               25 |
+----------+---------+------------------+
| elephant |       1 |               25 |
+----------+---------+------------------+

Input [5]:

# To easy drop a column:
m.drop(df, 'col3')

Output [5]:

+----+--------+--------+--------+
|    |   col1 |   col2 |   col4 |
+====+========+========+========+
|  0 |      1 |      3 |      9 |
+----+--------+--------+--------+
|  1 |      2 |      4 |      8 |
+----+--------+--------+--------+
|  2 |      3 |      5 |    nan |
+----+--------+--------+--------+
|  3 |      4 |      6 |      6 |
+----+--------+--------+--------+
|  4 |      5 |      7 |      5 |
+----+--------+--------+--------+

Input [6]:

# To easy one_hot_encode a column:
m.one_hot_encode(df, 'col3')

Output [6]:

+----+--------+--------+--------+-------+----------+------------+
|    |   col1 |   col2 |   col4 |   dog |   dragon |   elephant |
+====+========+========+========+=======+==========+============+
|  0 |      1 |      3 |      9 |     1 |        0 |          0 |
+----+--------+--------+--------+-------+----------+------------+
|  1 |      2 |      4 |      8 |     0 |        0 |          0 |
+----+--------+--------+--------+-------+----------+------------+
|  2 |      3 |      5 |    nan |     1 |        0 |          0 |
+----+--------+--------+--------+-------+----------+------------+
|  3 |      4 |      6 |      6 |     0 |        0 |          1 |
+----+--------+--------+--------+-------+----------+------------+
|  4 |      5 |      7 |      5 |     0 |        1 |          0 |
+----+--------+--------+--------+-------+----------+------------+

Merging -A simplified and smarter way to merge your dataset

mergex(df1 ,df2, column1, column2, df1_name=None, df2_name=None)

This is contributed by Morris Lee.

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

predictive analytic-0.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

predictive_analytic-0.0.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file predictive analytic-0.0.1.tar.gz.

File metadata

  • Download URL: predictive analytic-0.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.5

File hashes

Hashes for predictive analytic-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f5ca794a9c3400c19af523c42f8654353b0ab7eea2a39d9a7c49b4a22565569f
MD5 d653438018895963795eae428f942c0f
BLAKE2b-256 504276d9471a0ecb7c9f975c3701e9a7c9de6164603ea62ca6d68e0e57026529

See more details on using hashes here.

File details

Details for the file predictive_analytic-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for predictive_analytic-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 842add022a8b239bf86ed8fa2396cb3ab0e6ed508417499a46c2bf4af6107691
MD5 5c232f4e4707947e28d796015fcf7ca3
BLAKE2b-256 9c7ecc17b84270583cf150869fb1089a98061f82391f4dc9f4d863f6bd1fe083

See more details on using hashes here.

Supported by

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