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.
Release files for morris-learning 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| morris-learning-0.0.4.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| morris_learning-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / morris-learning-0.0.4.tar.gz
| Download URL | morris-learning-0.0.4.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b791f8d099860ecf15e7711bef47cb40f0024ea93ca29b8b87e8d9fa11420b0
|
|
BLAKE2b-256 checksum How to use checksums |
62939d0523b410341e6a8faee28ffab02373e4a9dff818b84fb8f87eb05cf87a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.5
|
Release files / morris_learning-0.0.4-py3-none-any.whl
| Download URL | morris_learning-0.0.4-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4799520337a408692fdf1dceb1b61a856ef5031699ad21babf3963b76a1243b
|
|
BLAKE2b-256 checksum How to use checksums |
331037578f869b9f9445c427e056a6b89016ebef4d387dcf6b7c19705b1dc9b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.5
|