Saravanan666/pypi-org huggingface dataset:
Package: pandasbt
PandasBTSimples Framework to Backtest Strategies using pandasInstallationpip install pandasbtCalculation a factor zscoreimportpandasbtaspbtdf_test=pd.DataFrame([{"close":25},{"close":15},{"close":41},{"close":7},{"close":5},{"close":115},{"close":45},{"close":32},])pbt.zscore(df_test,period=20)or you can specify the columnpbt.zscore(df_test,20,"close")Calculation Buy and Sell signalsThat mean add a signal column into dataframe.0 - means nothing-1 - means sell1 - means buyimportpandasbtaspbtdf_test=pd.DataFrame([{"close":25},{"close":15},{"close":41},{"close":7},{"close":5},{"close":115},{"close":45},{"close":32},])pbt.calc_signal(df_test,buy_query="close > 20",sell_query="close < 10")
Package: pandas-cat
pandas-catThe pandas-cat is a Pandas's categorical profiling library.pandas-cat is abbreviation of PANDAS-CATegorical profiling. This package provides profile for categorical attributes as well as (optional) adjustments of data set, e.g. estimating whether variable is numeric and order categories with respect to numbers etc.The pandas-cat in more detailThe package creates (html) profile of the categorical dataset. It supports both ordinal (ordered) categories as well as nominal ones. Moreover, it overcomes typical issues with categorical, mainly ordered data that are typically available, like that categories are de facto numbers, or numbers with some enhancement and should be treated as ordered.For example, in datasetAccidentsattribute Hit Objects in can be used as:unordered: 0.0 10.0 7.0 11.0 4.0 2.0 8.0 1.0 9.0 6.0 5.0 12.0 nanordered: 0.0 1.0 10.0 11.0 12.0 2.0 4.0 5.0 6.0 7.0 8.0 9.0 nanas analyst wishes (package does): 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0 nanTypical issues are (numbers are nor numbers):categories are intervals (like 75-100, 101-200)have category with some additional information (e.g. Over 75, 60+, <18, Under 16)have n/a category explicitly coded sorted in dataTherefore this library provides profiling as well as somehow automatic data preparation.Currently, there are two methods in place:profile-- profiles a dataset, categories and their correlationsprepare-- prepares a dataset, tries to understand label names (if they are numbers) and sort themInstallationYou can install the package usingpip install pandas-catUsageThe usage of this package is simple. Sample code follows (it uses datasetAccidentsbased onKaggle dataset)import pandas as pd
from pandas_cat import pandas_cat

#read dataset. You can download it and setup path to local file.
df = pd.read_csv ('https://petrmasa.com/pandas-cat/data/accidents.zip', encoding='cp1250', sep='\t')

#use only selected columns
df=df[['Driver_Age_Band','Driver_IMD','Sex','Journey']]

#longer demo report uses this set of columns instead of the first one
#df=df[['Driver_Age_Band','Driver_IMD','Sex','Journey','Hit_Objects_in','Hit_Objects_off','Casualties','Severity','Area','Vehicle_Age','Road_Type','Speed_limit','Light','Vehicle_Location','Vehicle_Type']]


#for profiling, use following code
pandas_cat.profile(df=df,dataset_name="Accidents",opts={"auto_prepare":True})

#for just adjusting dataset, use following code

df = pandas_cat.prepare(df)Data and sample reportsSample reports are here -basicandlonger. Note that these reports have been generated with code above.The dataset is downloaded from the web (each time you run the code). If you want, you can download sample datasethereand store it locally.
Package: pandas-chat
pandas-chatpandas-chat is a python library that uses LLMs prompts to analyze and process pandas data in a conversational way.InstallationYou can install pandas-chat using pip:pip install pandas-chatLLMs supportedapi="openai"api="hugchat"Usage exampleCreationInputimport numpy as np
import pandas as pd
from pandas_chat.action import Action

action = Action(
    api="openai",
    api_key="API_KEY",
)

X1 = pd.DataFrame(np.random.rand(10, 3), columns=["col1", "col2", "col3"])
X2 = pd.DataFrame(np.random.rand(10, 3), columns=["col1", "col2", "col3"])
func = np.square
prompt = "apply function func to X1 and then subtract X2 from X1"

X = action.create_and_run(
    prompt=prompt,
    X1=X1,
    X2=X2,
    func=func,
)
print(action)OutputReply with a python module using pandas; this module will have one function with arguments X1, X2, func; this function will perform what is described by the following instructions delimited by <<< and >>>; <<<apply function func to X1 and then subtract X2 from X1>>>;
verify that the reply has all the necessary imports, that it contains only valid python code, and that the keywords used are present in the official documentation of the libraries from which they came;
don't include any explanations in your reply, returning only python code.

import pandas as pd

def apply_func(X1, X2, func):
    result = X1.apply(func) - X2
    return resultRun stored functionfunc = np.sqrt
X = action.run(
    X1=X1,
    X2=X2,
    func=func,
)ContributingWe welcome contributions from the community. Please see our contributing guidelines for more information.LicenseThis project is licensed under the BSD 3-Clause License - see the LICENSE.md file for details.TODOuse logginguse env var for api keyreal testsadd CI/CDadd semantic releaseadd other LLMs
Package: pandas-cleaner
Pandas-cleanerPandas-cleaner is a Python package, built on top of pandas, that provides methods detect, analyze and clean errors in datasets with different types of data (numerical, categorical, text, datetimes...).FeaturesPandas-cleaner offers functionnalities to automatically :detectdifferent kind of potential errors in datasets such as outliers, inconsistencies, typos, wrong-typed ..., given predefined rules or statistiscal estimations,  via an easy-to-use API extending pandas,analyzethese errors, via reports and plots, to check the validity of the set and/or decide if any correction is needed,cleanthe datasets, either by dropping the lines with errors, emptying, correcting or replacing bad values,reapplythe same rules to any other incoming fresh data.UsageImport the packageimportpandasaspdimportpdcleanerCreate an example data seriesseries=pd.Series([1,5,-6,100,10])Detect the errors in the series with a given method (such asbounded,iqr,zscoreand many more depending the type of data...)detector=series.cleaner.detect('bounded',lower=0,upper=10)Inspect the result:detector.report()Detection report                               
==============================================================================
Method:                      bounded      Nb samples:                        5
Date:                January 24,2022      Nb errors:                         2
Time:                       16:06:08      Nb rows with NaN:                  0
------------------------------------------------------------------------------
lower                              0      upper                             10
inclusive                       both      sided                           both
==============================================================================Check the potential errors that have been detecteddetector.detected()2     -6
 3    100
 dtype: int64Clean the detected errors from the series using the chosen method amongdrop,to_na,clip,replace...series.cleaner.clean("drop",detector,inplace=True)series0      1
 1      5
 4     10
 dtype: int64Contributing to pandas-cleanerAll contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome.Issues and bugs can be reported athttps://github.com/eurodecision/pandas-cleaner/issues
Package: pandas-coder
📦 setup.py (for humans)This repo exists to providean example setup.pyfile, that can be used
to bootstrap your next Python project. It includes some advanced
patterns and best practices forsetup.py, as well as some
commented–out nice–to–haves.For example, thissetup.pyprovides a$ python setup.py uploadcommand, which creates auniversal wheel(andsdist) and uploads
your package toPyPiusingTwine, without the need for an annoyingsetup.cfgfile. It also creates/uploads a new git tag, automatically.In short,setup.pyfiles can be daunting to approach, when first
starting out — even Guido has been heard saying, "everyone cargo cults
thems". It's true — so, I want this repo to be the best place to
copy–paste from :)Check out the example!Installationcdyour_project# Download the setup.py file:#  download with wgetwgethttps://raw.githubusercontent.com/navdeep-G/setup.py/master/setup.py-Osetup.py#  download with curlcurl-Ohttps://raw.githubusercontent.com/navdeep-G/setup.py/master/setup.pyTo DoTests via$ setup.py test(if it's concise).Pull requests are encouraged!More ResourcesWhat is setup.py?on Stack OverflowOfficial Python Packaging User GuideThe Hitchhiker's Guide to PackagingCookiecutter template for a Python packageLicenseThis is free and unencumbered software released into the public domain.Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any means.
Package: pandas-compat
pandas-compatis a package providing an API compatibility across versions to downstream libraries that use pandas.This compatibility layer requirespandas>= 0.17.0.InstallationInstall latest release version via conda$condainstallpandas-compat--channelconda-forgeInstall latest release version via pip$pipinstallpandas-compatInstall latest development version$pipinstallgit+https://github.com/pandas-compat/pandas-compat.gitUsageIn your downstream library, you can use this pattern:importpandas_compataspdcpdc.is_datetime64tz_dtype(...)pdc.infer_dtype(...)
Package: pandas-context
pandas-contextProvides context to your data, allowing you to make complex slicing around a
specific index.Here's an example:>>>importpandasaspd...importnumpyasnp...importpandas_context...n=1000# long data...data=np.random.randn(n)...index=pd.date_range("19990101",periods=n)...df=pd.DataFrame(data=data,index=index)...date=index[50]>>>dateTimestamp('1999-02-20 00:00:00',freq='D')>>>df.context(date)01999-02-181.0861811999-02-190.1741561999-02-20-0.762305# <-----1999-02-21-0.1106771999-02-22-0.766751>>>df.context(date,around=1)01999-02-190.1741561999-02-20-0.762305# <-----1999-02-21-0.110677>>>df.context(date,pre=3,post=1)01999-02-17-0.8097911999-02-181.0861811999-02-190.1741561999-02-20-0.762305# <-----1999-02-21-0.110677Installationpipinstallgit+https://github.com/mmngreco/pandas-contextDevelopersgitclonehttps://github.com/mmngreco/pandas-context
pipinstall-e./pandas-context
Package: pandas-dash
Pandas DashTools for working with Pandas, Plotly, and Dash.See examplesAvailable extensions forDashdf.dash.to_dash_table()for getting thedataandcolumnsfordash_tablefrom a flat or multi-indexpd.DataFrame.df.dash.to_options("my_column")for creatingdcc.Dropdownoptions from the column of apd.DataFrame.df.dash.to_pivot_table()for creating the date necessary fordash_pivottable.PivotTable.Extensions forPlotlycoming soon.
Package: pandas-datadict
Data Dictionary for pandasThe data dictionary consists at least of the following columns:Data Set: Used when mapping in combination withFieldto rename to the column toName.Field: Column name of the data frame to map toName.Name: Column name that is unique throughout the data dictionary.Description: Description of the column name. This can be used to provide additional information when displaying the data frame.Type: Type the column should be cast to.Format: Format to use when values need to be converted to a string representation. The format string has to be a Python format string such as{:.0f}%The data dictionary can either be loaded from a CSV file (example data dictionary) or from a data frame.InstallationUsing pipYou can install using the pip package manager by running:pip install pandas-datadictAlternatively, you could install directly from Github:pip install https://github.com/177arc/pandas-datadict/archive/master.zipFrom sourceDownload the source code by cloning the repository or by pressingDownload ZIPon this page.
Install by navigating to the proper directory and runningpython setup.py installUsageFor usage guidance and testing the package interactively, hit theUsage Jupyter Notebook.DocumentationFor the code documentation, please visit the documentationGithub Pages.ContributingFork the repository on GitHub.Run the tests withpython -m pytest tests/to confirm they all pass on your system.
If the tests fail, then try and find out why this is happening. If you aren't
able to do this yourself, then don't hesitate to either create an issue on
GitHub, contact me on Discord or send an email topy@177arc.net.Either create your feature and then write tests for it, or do this the other
way around.Run all tests again with withpython -m pytest tests/to confirm that everything
still passes, including your newly added test(s).Create a pull request for the main repository'smasterbranch.
Package: pandas_dataframe_convert
OverviewPandas_dataframe_convert is a library with a command line tool to convert Pandas dataframes to other formats, including
csv, excel, json, md, latex, feather and parquet.   Useful if you have or write  a tool
to generate a Pandas dataframe and you want to use the data in some other language.Installpip install pandas_dataframe_convertUsageThe pip install step will put a command line program in your Python
scripts directory "dataframe_convert".usage: dataframe_convert [-h] [-i INFILE] [-o [OFILES [OFILES ...]]] [-x X]

Convert a Pandas dataframe in Pickle format to another format. Mainly useful if you want to use the dataframe in another environment, like R or Julia

optional arguments:
-h, --help            show this help message and exit
-i INFILE             pickle file containing a pandas dataframe. defaults to standard in if not specified
-o [OFILES [OFILES ...]]
                        pickle file containing a pandas dataframe. defaults to standard out if not specified. File extension determined the output type. choose an extension of ['pkl', 'ftr', 'json', 'xlsx',  
                        'csv', 'md', 'latex', 'parquet']. Seperate multiple files with spaces.
-x X                  specify type of output for standard output, one of ['pkl', 'ftr', 'json', 'xlsx', 'csv', 'md', 'latex', 'parquet']
Package: pandas-datapackage-reader
pandas-datapackage-readerEasy loading of tabular data fromData Packagesinto Pandas DataFrames.Installationpip install pandas-datapackage-readerUsagefrompandas_datapackage_readerimportread_datapackage# From GitHub repositorycountry_codes=read_datapackage("https://github.com/datasets/country-codes")# From local directorycountry_codes=read_datapackage("country-codes")# Data Package with GeoJSONgeo_countries=read_datapackage("https://github.com/datasets/geo-countries")Resource metadata from the Data Package is returned as a dictionary in the_metadataattribute.country_codes._metadatacontains{'format': 'csv',
  'name': 'country-codes',
  'path': 'data/country-codes.csv',
  'schema': {'fields': [{'description': 'Country or Area official Arabic short name from UN Statistics Divsion',
        'name': 'official_name_ar',
        'title': 'official name Arabic',
        'type': 'string'},
      {'description': 'Country or Area official Chinese short name from UN Statistics Divsion',
        'name': 'official_name_cn',
        'title': 'official name Chinese',
        'type': 'string'},
# ...LicenseBSD-2-Clause, seeLICENSE
Package: pandas-datareader
# pandas-datareaderUp to date remote data access for pandas, works for multiple versions of
pandas.[![image](https://img.shields.io/pypi/v/pandas-datareader.svg)](https://pypi.python.org/pypi/pandas-datareader/)
[![image](https://codecov.io/gh/pydata/pandas-datareader/branch/master/graph/badge.svg)](https://codecov.io/gh/pydata/pandas-datareader)
[![image](https://readthedocs.org/projects/pandas-datareader/badge/?version=latest)](https://pandas-datareader.readthedocs.io/en/latest/)
[![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![License](https://img.shields.io/pypi/l/pandas-datareader)](https://pypi.org/project/pandas-datareader/)## InstallationInstall usingpip` shell pip installpandas-datareader`## Usage` python import pandas_datareader as pdrpdr.get_data_fred('GS10')`## Documentation[Stable documentation](https://pydata.github.io/pandas-datareader/) is available on
[github.io](https://pydata.github.io/pandas-datareader/). A second copy of the stable
documentation is hosted on [read the docs](https://pandas-datareader.readthedocs.io/)
for more details.[Development documentation](https://pydata.github.io/pandas-datareader/devel/) is available
for the latest changes in master.### RequirementsUsing pandas datareader requires the following packages:pandas>=1.0lxmlrequests>=2.19.0Building the documentation additionally requires:matplotlibipythonrequests_cachesphinxpydata_sphinx_themeDevelopment and testing additionally requires:blackcoveragecodecovcoverallsflake8pytestpytest-covwrapt### Install latest development version` shell python-mpip installgit+https://github.com/pydata/pandas-datareader.git`or` shell git clonehttps://github.com/pydata/pandas-datareader.gitcdpandas-datareaderpython setup.py install `
Package: pandas-datareader-gdax
A library to retrieve GDAX historical data into a Pandas DataFrame, in a similar style to Pandas DataReader.Free software: BSD licenseInstallationpip install pandas-datareader-gdaxExampleimportpytzfromdatetimeimportdatetimefrompandas_datareader_gdaximportget_data_gdax# Retrieve the GDAX data into a dataframedf=get_data_gdax('BTC-USD',granularity=5*60,start=datetime(2016,6,1,7,0,0,tzinfo=pytz.timezone('UTC')),end=datetime(2017,9,1,6,59,59,tzinfo=pytz.timezone('UTC')))
Package: pandas-dev-flaker
pandas-dev-flakerPlugin forflake8used to contribute topandas.NOTE: this is not a linter meant for pandas usage, but for pandas development. If you want
a linter for pandas usage, please seepandas-vet.installationpip install pandas-dev-flakerflake8 codesCodeDescriptionPDF001found import from 'collections.abc' (use 'from collections import abc')PDF002builtin 'filter' function usedPDF003builtin 'exec' function usedPDF004'foo.__class__' used, (use 'type(foo)' instead)PDF005leading space in concatenated stringsPDF006Found '{foo!r}' formatted value (instead, use 'repr(foo)')PDF007line split in two unnecessarily by 'black' formatterPDF008found 'os.remove' (use 'tm.ensure_clean' instead)PDF009'pytest.raises' used without 'match='PDF010'pytest.raises' used outside of context managerPDF011found 'pytest.warns' (use 'pandas._testing.assert_produces_warning')PDF012found 'pytest.xfail' (use 'pytest.mark.xfail' instead)PDF013import from 'conftest' foundPDF014found import from 'pandas._testing' (use 'import pandas._testing as tm')PDF015from import from 'pandas.testing' (use 'import pandas._testing as tm')PDF016found 'unittest.mock' (use 'pytest.monkeypatch' instead)PDF017'pd.api.types' used (import from 'pandas.api.types' instead)PDF018'common' imported from 'pandas.core' without 'com' aliasPDF019found both 'pd.foo' and 'foo' in the same filePDF020found private import across modulesPDF021found 'np.bool' or 'np.object' (use 'np.bool_' or 'np.object_' instead)PDF022found import from 'numpy.random'PDF023found assignment to single-letter variablePDF024found string join() with generator expressionsPDF025found 'np.testing' or 'np.array_equal' (use 'pandas._testing' instead)PDF026found union between Series and AnyArrayLike in type hintcontributingSeecontributing.mdfor how to get started.Each new linting rule should be its own file insidepandas-dev-flaker/_plugins. Please linting rule should have two sets of tests inpandas-dev-flaker/tests- one for when the linting rule is expected to pass, and another for when it's expected to fail.creditSeveral methods are simplified versions of methods frompyupgrade. Some of the checks were taken from thepandasrepo. Please find both their licenses in theLICENSESfolder.as a pre-commit hookSeepre-commitfor instructionsSample.pre-commit-config.yaml:-repo:https://github.com/pycqa/flake8rev:3.9.0hooks:-id:flake8additional_dependencies:[pandas-dev-flaker==0.5.0]
Package: pandas-diff
InstallationInstall pandas_diff with pippipinstallpandas_diffUsage/Examplesimportpandas_diffaspd_diffimportpandasaspd# Create two example dataframesdf_infinity_war=pd.DataFrame([{"hero":"hulk","power":"strength"},{"hero":"black_widow","power":"spy"},{"hero":"thor","hammers":0},{"hero":"thor","hammers":1}])df_endgame=pd.DataFrame([{"hero":"hulk","power":"smart"},{"hero":"captain marvel","power":"strength"},{"hero":"thor","hammers":2}])# Get differences, using the key "hero"df=pd_diff.get_diffs(df_infinity_war,df_endgame,"hero")df#operation object_keys  object_values                     object_json                     attribute_changed old_value new_value#0   create     [hero]    captain marvel  {'hero': 'captain marvel', 'power': 'strength'...           NaN           NaN      NaN#1   delete     [hero]       black_widow  {'hero': 'black_widow', 'power': 'spy', 'hamme...           NaN           NaN      NaN#2   modify     [hero]              thor     {'hero': 'thor', 'power': nan, 'hammers': 2.0}       hammers             1        2#3   modify     [hero]              hulk  {'hero': 'hulk', 'power': 'smart', 'hammers': ...         power      strength    smartWhy pandas diff ? Cases of useMigrating from batch to an event driven architectureIn my work, we use a lot of data pipelines to get info from external
platforms, (active directory, github, jira). We load the new data
replacing the entire table.By using pandas_diff we detect how the infraestructure changes between
executions, and stream those change events into a kafka cluster, so
other teams could suscribe to their favourite events. Also, by defining
a pandas_diff step in the master pipeline, every item in our project has
ther life cycle events controlled.Events logFor every item in a table, by using pandas_diff you will have an event
log to audit of how the resources are being consumed.ConciliationTo conciliate one datasource against the source of truth. Eg: You have a CMDB controlling with info regarding virtual machines. As there are several methods for creating those VMs, you use pandas_diff to replicate state of the infraestructure against the CMDB.FeaturesFiltering of columnsRoadmapSupport for stand alone appDocumentationDocumentationHistory0.7.18 (2021-12-05)* Add codacy badge0.7.19 (2021-12-05)* Feat filter column0.7.20 (2021-12-05)* Feat filter column0.7.21 (2021-12-05)* Add filter fest0.7.22 (2021-12-06)* Add confition keys exist in df’s1.1.0 (2021-12-06)* Add confition keys exist in df’s
1.2.0 (2021-12-06)
——————* Improve doc1.2.0 (2021-12-06)* Improve doc1.3.0 (2021-12-06)* Remove workflows1.4.0 (2021-12-06)* Remove workflows1.4.0 (2023-09-01)* Improve doc1.4.1 (2023-09-01)* Improve doc1.4.2 (2023-09-17)* Bugfix version string1.4.3 (2023-09-17)* bugfix version tag1.4.4 (2023-09-17)* bugfix version tag1.4.5 (2023-09-17)* bugfixx history string1.4.6 (2023-09-17)* bugfix history string1.4.7 (2023-09-17)* bugfix release description
Package: pandas-diligent
# pandas-diligent`diligent` is a data proofing tool for pandas dataframes, best used in Jupyter notebooks.Run `diligent` on your dataframes.from diligent import diligentdiligent(df)Run only certain kinds of checks.diligent(df, include='basic')Run in verbose mode:diligent(df, verbose=True)Register your own checks.from diligent import registry@registry.register(name='My custom check', tags='custom')def custom_check(series):yield 'Warning 1'yield 'Warning 2'