Pandas with some cool additional features
Project description
pandit ☸️ pandas utils
Pandas with some cool additional features
Installation and usage
pip install pandit
import pandas as pd, import pandit
# or
import pandit as pd
df=pd.read_tsv(path)
df.sieve(x=3).show()
#Pandas behaves normally otherwise
If credentials are needed:
import credentials # you manage that part
assert credentials.gsheet # credential dict in https://docs.gspread.org/en/latest/oauth2.html
assert credentials.dropbox
pd.credentials = credentials
sieve
df.sieve(column1=value1, columns2=value2)
# returns df rows where column equals value - if value is not a list, otherwise:
df.sieve(column3=[value1,value2])
# returns df rows where column is value1 or value2; use [[value1,value2]] to match lists
# It's like pd.query but with a pythonic syntax instead of the sql string.
show
df.show() # shows multiple rows column by column (one line per column) with nice formatting, one line per column
# ideal for inspecting NLP datasets
df.rshow(n) # random sample of size n (default is 20)
Also:
df.bold_max()
bold max float values df.bold_max().to_latex()
pd.read_tsv
read_csv with sep='\t' for lazy persons
pd.read_jsonl
pd.read
df.read_{extension} where extension is extracted from the input path (.csv = read_csv)
pd.read_wandb(project_name)
df.drop_constant_column
drop columns that are constant
df.to_dropbox(path, format=None, token=None,**kwargs)
Save dataframe to dropbox
df.to_sheets(id,sheet_name,credential=None, include_index=False)
Save dataframe to sheets
df.undersample(column='label',sampling_strategy='auto',random_state=None,replacement=False)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pandit-0.0.10.tar.gz.
File metadata
- Download URL: pandit-0.0.10.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ac53de4503c47f9ddc67db8d328bafad87b3ba497f092da9be2e82a6bc49d92
|
|
| MD5 |
f498f7cf09b869b81cdaa3f934a38af1
|
|
| BLAKE2b-256 |
cb747c4da0e177a37e78e9237881687a73b0d1d82d4c728bb674f3d7ba3e996c
|
File details
Details for the file pandit-0.0.10-py3-none-any.whl.
File metadata
- Download URL: pandit-0.0.10-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
622f618cdf53620cd8d0acba74ededb0b65fccc5f9173c96a29972326a7743da
|
|
| MD5 |
e61f40518b8b8700954a5c40304c25f5
|
|
| BLAKE2b-256 |
30a4df3cecc47a7f1b66947eeec6a3521b17ee2ae69974c439ba11aa2b230961
|