This library has 3 functions with which you can manage lists or columns of dataframes. You can impute, operate and filter.
Project description
pylistmanagement
This library has 3 functions with which you can manage lists or columns of dataframes.
You can impute, operate and filter.
Installation
Use the package manager pip to install pyimage.
pip install pylistmanagement
from pylistmanagement import pylistmanagement
Usage
1. impute (list1,method="zero")
With this function all null values are found and imputed by the selected method.
Parameters:
-
list1 : list-like
A list or a column of a dataframe
-
method : {"zero", "mean", "median"}, default "zero"
-
"zero"
- All null values are imputed by 0
-
"mean"
- All null values will be imputed by the average of the list
-
"median"
- All null values will be imputed by the median of the list.
-
Returns:
Returns the original imputed list
Example:
plm=pylistmanagement()
plm.impute(list1,method= "zero")
2. column_operation(listas,method="concat")
This function generates a new list with the selected method from all existing lists in the list of lists.
Parameters:
-
listas : list-of-lists
A list of lists with 2 or more lists
-
method : {"add", "subtract", "concat"}, default "concat"
-
"add"
- Add all lists
-
"subtract"
- Subtracts all lists
-
"concat"
- Concatenates all lists
-
Returns:
Returns the new created list
Example:
plm=pylistmanagement()
plm.column_operation(listas,method = "concat")
3. filtering(dataf,list1,filter,method=="equal")
This function filters a dataframe according to the selected method and filter.
Parameters:
-
dataf : dataframe
-
list1 : str
The name of a column of the dataframe
-
filter : { str or int/float }
Depending on the method, str inputs would not work on other method that's not "equal"
-
method : {"equal", "higher", "equal_higher", "lower", "equal_lower"}, default "equal"
-
"equal" : {str / int / float}
- Dataframe will be filtered by the previous selected filter
-
"higher" : {int / float}
- Dataframe will be filtered by the previous selected filter.
-
"equal_higher" : {int / float}
- Dataframe will be filtered by the previous selected filter.
-
"lower" : {int / float}
- Dataframe will be filtered by the previous selected filter.
-
"equal_lower" : {int / float}
- Dataframe will be filtered by the previous selected filter.
-
Returns:
Returns the new filtered dataframe
Example:
plm=pylistmanagement()
plm.filtering(dataf,list1,filter,method = "equal")
License
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
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
File details
Details for the file pylistmanagement-0.6.tar.gz.
File metadata
- Download URL: pylistmanagement-0.6.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24057eb6c0b0bf194c47ea663d5b09d53dc95d1d15132f7aa1378cfb61720d2e
|
|
| MD5 |
19d9d4228b139572e38f47ba817987e8
|
|
| BLAKE2b-256 |
f53fe9eb070daf86aa83feec05b5b2cdf49d990ccb0754bf7f323cfef2bf06db
|