Saravanan666/pypi-org huggingface dataset:
Package: edatk
edatk: Python Exploratory Data Analysis Toolkitedatk is a open source project for exploratory data analysis in Python. This is a new project and while features are simple now, the goal is to automate and organize as much of the traditional eda workflow as possible.Installationpip install edatkExamples and Getting Started# Import libraryimportedatkaseda# Load in your dataframe (using seaborn below as an example)importseabornassnsdf=sns.load_dataset('iris')# Run auto eda, optionally pass in path for saving html report and target columneda.auto_eda(df,save_path='C:\\Users\\username\\Documents\\edatk',target_column='species')Feature OverviewFeature [status]Tabular data [partial]Column by column analysis [partial]Basic descriptive statistics (mean, median, min, max, etc) [completed]Distribution charts (numeric) and most frequent values (categorical) [completed]Normality Tests [planned].Relationships between columns [completed]TSNE [planned]Basic feature -> target analysis and feature importance [planned]Autofind interesting relationships and features [planned]Basic exploratory NLP for text columns [planned]Exploring Predicted vs. True Results [planned]Classification Results PlotsTrue vs. Predicted Heatmap by ClassMosiac PlotTime Series [planned]Performance Improvements [planned]Operation timeoutsContributingIf you are interested in contributing, please see thecontributing documentation.StabilityThis library is not yet ready for production use. Treat with caution and for non production purposes aiding in deeper, more formal data analysis.AuthorBarrett Studdard-@bstuddard
Package: eda-viz
EDA and Visualization LibraryLight-weight Python EDA and Visualization Library for Data Scientists.Theeda_vizmodule is a light-weight library that will make your data
exploration and visualization tasks lot simpler.InstallationYou can installeda-vizfrom PyPI:pip install eda-vizThe library is only tested in Python 3.6.5, and on Mac OS v10.13.6.How to useLet's create a sample dataframe:import pandas as pd
df = pd.DataFrame({
    'categories': ['A', 'B', 'A', 'C', 'D', 'B', 'A'],
    'numbers': [1, 2, 1, 3, 4, 2, 1]
})Column Distributionfrom eda_viz.viz import column_distribution
column_distribution(df['categories'])Histogramfrom eda_viz.viz import histogram
histogram(df['numbers'])Bar Plotfrom eda_viz.viz import bar_plot
bar_plot(df['categories'], df['numbers'])Other charts are a WIP.
Package: edawesome
EDAwesomeThis is a package for quick, easy and customizable data analysis with pandas and seaborn. We automate all the routine so you can focus on the data. Clear and cuztomizable workflow is proposed.InstallationEDAwesome is generally compatible with standard Anaconda environment in therms of dependencies. So, you can just install it in you environment with pip:pipinstalledawesomeYou can also install the dependencies, usingrequirements.txt:pipinstall-rrequirements.txtIf you use Poetry, just include the depedencies in yourpyproject.toml:[tool.poetry.dependencies]python=">=3.8,<3.11"seaborn="^0.12.1"kaggle="^1.5.12"ipython="^8.5.0"transitions="^0.9.0"patool="^1.12"pyspark="^3.3.1"pandas="^1.5.2"statsmodels="^0.13.5"scikit-learn=">=1.2.0"scipy="~1.8.0"UsageThis package is designed to be used in Jupyter Notebook. You can use step-by-step workflow or just import the functions you need. Below is the example of the step-by-step workflow:Quick startfromedawesome.edaimportEDAeda=EDA(data_dir_path='/home/dreamtim/Desktop/Coding/turing-ds/MachineLearning/tiryko-ML1.4/data',archives=['/home/dreamtim//Downloads/home-credit-default-risk.zip'],use_pyspark=True,pandas_mem_limit=1024**2,pyspark_mem_limit='4g')This will create theEDAobject. Now you can load the data into your EDA:eda.load_data()This will display the dataframes and their shapes. You can also useeda.dataframesto see the dataframes. Now you can go to the next step:eda.next()eda.clean_check()Let us say, that we don't want to do any cleaning in this case. So, we just go to the next step:eda.next()eda.categorize()Now you can compare some numerical column by category just in one line:eda.compare_distributions('application_train','ext_source_3','target')Real-world exampleFull notebook which was used for examples above can be found in one of my real ML projects.There is also an examplequickstart.ipynbnotebook in this repo.DocumentationYou can find the documentationhere.ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Package: edawishlist
wishlistInstallingClonning repositorygit clone https://gitlab.cern.ch/msilvaol/wishlist.gitInstalling conda encironmentconda create --name wishlist --file wishlist/requirements.txt -c conda-forge -y
conda activate wishlist
pip install bigtree
pip install cocotbext-axiGetting startedActivating environmentconda activate wishlistBuilding and uploading to pippython3 -m build  
python3 -m twine upload dist/*
Package: edblpy
EdblpyEdblpy is an unofficial python module utilizing the electro discord bot list [api](https://www.edbl.xyz/api) . Easy to use and well documented!Getting startedYou must have ython 3*A bot's / user's idInstall the module using pip :pip install edblpyImport what you need :from edblpy import Botorfrom edblpy import UserView more about usage in the docs sectionDocsClass : BotParams ( name , description , type , default )id:The bot's id (Required when retrieving info):integer:Nonetoken:Your token  (Required when posting the bot's status):string:NoneMethods ( name , description , params , returns)get_info:Gets the bot's info:None:Dictpost_status:Posts the server/user count to the DB , requires auth:user_count , server_count:DictClass : UserParams ( name , description , type , default )id:The user's id (Required):integer:NoneMethods ( name , description , params , returns)get_info:Gets the user's info:None:DictExamplesGetting a user's infofromedblpyimportUserjake=User(480407581085532180)print(jake.get_info())Getting a bot's infofromedblpyimportBotmika=Bot(631669116926820353)print(mika.get_info())Posting a bot's statusfromedblpyimportBotmika=Bot(631669116926820353,'YOUR_SUPER_SECRET_TOKEN')print(mika.post_status(user_count=100,server_count=100))# you should probably make the counts dynamic
Package: edbotstudio
EdbotStudio Client APIThis Python package implements a client API for Edbot Studio.InstallationInstall the package using PIP with:$pipinstalledbotstudioUsageRoadmapSee theopen issuesfor a list of proposed features (and known issues).ContributingContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make aregreatly appreciated.Go tohttps://github.com/edbotstudio/client-python.Fork the project.Create your feature branch (git checkout -b feature/AmazingFeature).Commit your changes (git commit -m 'Add some AmazingFeature').Push to the branch (git push origin feature/AmazingFeature).Open a pull request.LicenceDistributed under the MIT Licence. See theLICENCEfor more information.
Package: edc-adverse-event
edc-adverse-eventCreate an AE applicationCreate an AE app that will house your AE concrete models, admin site, list data, and action items.Adverse events modelsModel mixins exist for you to create the following concrete models in your AE app:AE Initial: The initial report of a adverse eventAE Followup: 1 or more follow-ups to the initial AE reportAE Special InterestAE SUSARAE External ReviewerDeath ReportDeath Report External ReviewerTMG: Trial Management Group formsAE Tmg:SettingsThese are thesettingsattributes you need to define foredc_adverse_event:# settings.py...ADVERSE_EVENT_APP_LABEL="edc_adverse_event"# replace with your AE app labelADVERSE_EVENT_ADMIN_SITE="edc_adverse_event_admin"# replave with your AE app admin site name...Define a list_data.pyThere are a few FK fields on the AE models. You need to define alist_data.pythat will be read to populate the FK list models.The list model tables are:
*edc_adverse_event.aeclassification(See AeInitial)
*edc_adverse_event.saereason(See AeInitial)# list_data.pylist_data={"edc_adverse_event.aeclassification":[(ANAEMIA,"Anaemia"),("diarrhoea","Diarrhoea"),(RENAL_IMPAIRMENT,"Renal impairment"),(OTHER,"Other"),],"edc_adverse_event.saereason":[(NOT_APPLICABLE,"Not applicable"),(DEAD,"Death"),("life_threatening","Life-threatening"),("significant_disability","Significant disability"),("in-patient_hospitalization",("In-patient hospitalization or prolongation ""(17 or more days from study inclusion)"),),("medically_important_event","Medically important event (e.g. recurrence of symptoms not requiring admission, ""Hospital acquired pneumonia)",),],}preload_data=PreloadData(list_data=list_data,model_data={},unique_field_data=None)Register AE Action ItemsThe AE action items are not registered by default. To register, in the root of your AE app add anaction_items.py:# action_items.pyfromedc_adverse_event.action_itemsimportAeInitialActionfromedc_adverse_event.action_itemsimportAeFollowupActionfromedc_adverse_event.action_itemsimportAeSusarActionfromedc_adverse_event.action_itemsimportAeTmgActionsite_action_items.register(AeInitialAction)site_action_items.register(AeFollowupAction)site_action_items.register(AeTmgAction)site_action_items.register(AeSusarAction)
Package: edc-base
edc-baseBase model, manager, field, form and admin classes for Edc.All models in the Edc useBaseUuidModelfromedc_base.model_mixinsimportBaseUuidModelclassMyModel(BaseUuidModel):....The mixin:sets the id fields to aUUIDFieldinstead of an integer;adds audit fields throughBaseModel(user_created, user_modified, date_created, etc);addsUrlModelMixin,DeviceModelMixinMost models require an audit trail. If so, add theHistoricalRecordmodel manager.fromedc_base.model.modelsimportHistoricalRecordclassMyModel(BaseUuidModel):...history=HistoricalRecord()HistoricalRecordis an almost identical version ofsimple_history.models.HistoricalRecordwith the exception of two methods:get_extra_fields()andadd_extra_methods(). Methodget_extra_fields()is overridden to change thehistory_idprimary key from anIntegerFieldto aUUIDFieldso that it can work with moduledjango_collect_offline.The audit trail models created byHistoricalRecordhave a foreign key toauth.User. In order for the models to work withdjango_collect_offlinespecify the django_collect_offline User model in settings:AUTH_USER_MODEL='django_collect_offline.User'NotesUser created and modified fields behave as follows:created is only set on pre-save addmodified is always updated
Package: edc-crf
edc_crfIn longitudinal clinical trials, CRFs (case report forms) are the most common
data collection forms required in the data collection schedule.In addition to the logic checks that you will add for a specfic CRF, you also need
to validate a few general conditions. Most of these conditions are checked
relative to thereport_datetimeof the CRF data being submitted. Some examples
are:that a participant is consented and that their consent is still valid on thereport_datetime;that the CRFreport_datetimemakes sense relative to the covering visit reportreport_datetime;that the participant is enrolled to the schedule (onschedule) on or after thereport_datetimeand has not been taken off the schedule (offschedule) on or before thereport_datetime;that the participant has not been taken off study on or before thereport_datetime.CRF formsTheCrfModelFormMixinis used for all CRF modelforms. With this single
mixin the form:Checks for the consent relative to report datetime and this schedule (edc_consent);checks if participant is on/off schedule relative to report datetime and this schedule (edc_visit_schedule);validates subject_visit report datetime (edc_visit_tracking);checks if participant is offstudy relative to report datetime (edc_offstudy).If any of the above conditions fail, aforms.ValidationErroris raised.The mixin imports mixins functionality fromedc_consent,edc_visit_schedule,edc_visit_tracking, andedc_offstudy.fromdjangoimportformsfromedc_crf.modelform_mixinsimportCrfModelFormMixinfromedc_form_validatorsimportFormValidatorfrom..modelsimportFollowupVitalsclassMyCrfFormValidator(FormValidator):passclassMyCrfForm(CrfModelFormMixin,forms.ModelForm):form_validator_cls=MyCrfFormValidatorclassMeta:model=MyCrffields="__all__"CRF modelsSimilar to theCrfModelFormMixin, theCrfModelMixinis used for all CRF models
and checks for the same conditions. However, if any of the conditions is met, an exception
is raised. You should render CRF models with a modelform class using theCRFModelFormMixinto catch these exceptions on the form where the user can respond.classMyCrf(CrfModelMixin,BaseUuidModel):weight_determination=models.CharField(verbose_name="Is weight estimated or measured?",max_length=15,choices=WEIGHT_DETERMINATION,)classMeta(CrfModelMixin.Meta,BaseUuidModel.Meta):verbose_name="My CRF"verbose_name_plural="My CRFs"
Package: edc-dx-review
edc diagnosis reviewClasses to manage review of HIV, DM, HTN and Chol diagnosesSettingsEDC_DX_REVIEW_APP_LABELEDC_DX_REVIEW_CLINICAL_REVIEW_BASELINE_MODELFor example: “edc_dx_review.clinicalreviewbaseline”EDC_DX_REVIEW_LIST_MODEL_APP_LABELFor example: “edc_dx_review” (Default: LIST_MODEL_APP_LABEL)
Package: edc-egfr
edc-egfrClasses and utils to handle eGFR collection and reportingIncludes calculators forCKD-EPI Creatinine equation (2009)andCockcroft-Gault.Calculate value, grade, percent drop, percent drop gradeThe calculators useedc_reportableto reference DAIDS tox tables.egfr1=EgfrCkdEpi(gender=MALE,ethnicity=BLACK,creatinine_value=53.0,age_in_years=30,creatinine_units=MICROMOLES_PER_LITER,)self.assertEqual(round(egfr1.value,2),156.43)and the eGFR gradeself.assertEqual(egfr1.egfr_grade,0)Percent drop from baselineIn a trial, we are interested in the eGFR percent from baseline. Any reference value can be passed as the
baseline value.If the baseline value is not provided, the percent drop = 0:# see edc-reportable for `reference_range_collection_name`opts=dict(gender=MALE,age_in_years=25,ethnicity=BLACK,creatinine_value=10.15,creatinine_units=MILLIGRAMS_PER_DECILITER,report_datetime=get_utcnow(),reference_range_collection_name="my_reference_list",calculator_name="ckd-epi",)egfr=Egfr(**opts)self.assertEqual(egfr.egfr_drop_value,0.0)If a baseline value is provided, the percent drop is calculated:egfr=Egfr(baseline_egfr_value=23.0,**opts)self.assertEqual(round(egfr.egfr_value,2),7.33)self.assertEqual(egfr.egfr_grade,4)self.assertEqual(round(egfr.egfr_drop_value,2),68.15)self.assertEqual(egfr.egfr_drop_grade,4)Notify on percent dropWe can notify when the drop is more than a given percent.eGFRuses a custom
model to be updated.Aedclab result CRF is filled in,calling_crf, that has the creatinine value and units.
Thecalling_crfhas asubject_visit,report_datetime,assay_datetime,creatinine_value, andcreatinine_units.egfr=Egfr(baseline_egfr_value=220.1,notify_on_percent_drop=20,calling_crf=crf,**opts,)self.assertEqual(round(egfr.egfr_drop_value,2),28.93)self.assertTrue(EgfrDropNotification.objects.filter(subject_visit=subject_visit).exists())Connecting a custom drop notification model with edc-action-itemfromedc_crf.crf_with_action_model_mixinimportCrfWithActionModelMixinfromedc_egfr.constantsimportEGFR_DROP_NOTIFICATION_ACTIONfromedc_egfr.model_mixinsimportEgfrDropNotificationModelMixinfromedc_modelimportmodelsasedc_modelsclassEgfrDropNotification(EgfrDropNotificationModelMixin,CrfWithActionModelMixin,edc_models.BaseUuidModel,):action_name=EGFR_DROP_NOTIFICATION_ACTIONtracking_identifier_prefix="EG"classMeta(edc_models.BaseUuidModel.Meta):verbose_name="eGFR Drop Notification"verbose_name_plural="eGFR Drop Notifications"Adding to an EDC model.save()For example, from the BloodResultRft model inmeta-edcclassBloodResultsRft(CrfModelMixin,CreatinineModelMixin,EgfrModelMixin,EgfrDropModelMixin,CrfWithRequisitionModelMixin,BloodResultsModelMixin,edc_models.BaseUuidModel,):lab_panel=rft_panelegfr_formula_name="ckd-epi"classMeta(CrfWithActionModelMixin.Meta,edc_models.BaseUuidModel.Meta):verbose_name="Blood Result: RFT"verbose_name_plural="Blood Results: RFT"
Package: edc-fieldsets
edc-fieldsetsModelAdmin mixins to extend django.admin fieldsets atribute. The classFieldsetformats a data structure in the format of a django.fieldset.For example:from.fieldsetsimportfieldset,biosynex_fieldset@admin.register(BloodResult,site=ambition_subject_admin)classBloodResultsAdmin(CrfModelAdminMixin,admin.ModelAdmin):form=BloodResultFormconditional_fieldsets={DAY1:biosynex_fieldset}fieldsets_move_to_end=['Conclusion','Summary','Action',audit_fieldset_tuple[0]]fieldsets=fieldsetradio_fields=...wherefieldsetis:biosynex_fieldset=Fieldset('bios_crag','crag_control_result','crag_t1_result','crag_t2_result',section='BIOSYNEX® CryptoPS (Semi-quantitative CrAg)')fieldset=[(None,{'fields':('subject_visit','report_datetime',)})]fieldset.append(('Conclusion',{'fields':('results_abnormal','results_reportable')}))fieldset.append(('Summary',{'classes':('collapse',),'fields':('summary',)}))fieldset.append(action_fieldset_tuple)fieldset.append(audit_fieldset_tuple)Theconditional_fieldsetswill only display for CRF completed at visitDAY1
Package: edc-form-label
edc-form-labelCustomize Django’s form label in realtimeFor a sequence of data collection timepoints, we ask the question, “Are you circumcised?”. At some time point we hope the response will beYES, but until then, we need to ask “Since we last saw you, were you circumcised?”. It is a lot better if we can ask, “Since we last saw you in ‘October 2018’, were you circumcised?”, where ‘October 2018’ represents the timepoint from which we got our last reponse.This module shows how you can insert ‘October 2018’ into the ModelAdmin/ModelForm the form label in realtime.For example:For a sequence of data collection timepoints, we ask the question, “Are you circumcised”. At some point we hope the  response will be YES. But until then we need to ask “Since we last saw you in October 2018, were you circumcised?”, etc.fromedc_form_labelimportFormLabel,CustomFormLabel,FormLabelModelAdminMixinclassMyCustomLabelCondition(CustomLabelCondition):defcheck(self,**kwargs):ifself.previous_obj.circumcised==NO:returnTruereturnFalse@register(MyModel)classMyModelAdmin(FormLabelModelAdminMixinadmin.ModelAdmin):fieldsets=((None,{'fields':('subject_visit','report_datetime','circumcised')},),)custom_form_labels=[FormLabel(field='circumcised',custom_label='Since we last saw you in{previous_visit}, were you circumcised?',condition_cls=MyCustomLabelCondition)]
Package: edc-form-validators
edc-form-validatorsForm validator classes for ModelFormsModelFormFormValidatorFormValidatorsimplifies common patterns used inModelForm.clean. For example, if there is a response to field A then there should not a be response to field B and visa-versa.Declare a form with it’sform_validatorclass and useFormValidatorMixin:classMyFormValidator(FormValidator):defclean(self):self.required_if(YES,field='f1',field_required='f2')...classMyModelForm(FormValidatorMixin,forms.ModelForm):form_validator_cls=MyFormValidatorclassMeta:model=TestModelfields='__all__'TestingTest theform_validatorwithout having to instantiate theModelForm:deftest_my_form_validator(self):options={'f1':YES,'f2':None}form_validator=MyFormValidator(cleaned_data=options)self.assertRaises(ValidationError,form_validator.validate)self.assertIn('f2',form_validator._errors)
Package: edc-he
edc-heHealth economics model, form mixins for clinicedc / DjangoDeclare insettingsif using concrete models not included in this app:EDC_HE_ASSETS_MODEL = "<label_lower>"
EDC_HE_HOUSEHOLDHEAD_MODEL = "<label_lower>"
EDC_HE_INCOME_MODEL = "<label_lower>"
EDC_HE_PATIENT_MODEL = "<label_lower>"
EDC_HE_PROPERTY_MODEL = "<label_lower>"See also moduleintecomm_subjectathttps://github.com/intecomm-trial/intecomm-edc.If you need to declare the Health Economics models in your app, use the provided model mixins.For example, theHealthEconomicsHouseholdHeadmodel would be declared like this:# models.pyclassHealthEconomicsHouseholdHead(SingletonCrfModelMixin,HouseholdHeadModelMixin,HouseholdModelMixin,CrfModelMixin,BaseUuidModel,):classMeta(CrfModelMixin.Meta,BaseUuidModel.Meta):verbose_name="Health Economics: Household head"verbose_name_plural="Health Economics: Household head"# forms.pyclassHealthEconomicsHouseholdHeadForm(CrfSingletonModelFormMixin,CrfModelFormMixin,forms.ModelForm):form_validator_cls=HealthEconomicsHouseholdHeadFormValidatordefclean(self):self.raise_if_singleton_exists()raise_if_clinical_review_does_not_exist(self.cleaned_data.get("subject_visit"))returnsuper().clean()# admin.py@admin.register(HealthEconomicsHouseholdHead,site=intecomm_subject_admin)classHealthEconomicsHouseholdHeadAdmin(HealthEconomicsHouseholdHeadModelAdminMixin,CrfModelAdmin):form=HealthEconomicsHouseholdHeadFormThe metadata rules may also be declared locally# metadata_rules.pyfromedc_he.rule_groupsimportPredicatesasBaseHealthEconomicsPredicatesfromedc_he.rule_groupsimportHealthEconomicsRuleGroupasBaseHealthEconomicsRuleGroupclassHealthEconomicsPredicates(BaseHealthEconomicsPredicates):app_label="intecomm_subject"visit_model="intecomm_subject.subjectvisit"@register()classHealthEconomicsRuleGroup(BaseHealthEconomicsRuleGroup):classMeta:app_label="intecomm_subject"source_model="intecomm_subject.subjectvisit"predicates=HealthEconomicsPredicates()
Package: edc-lab
edc-labAdd to settings:INSTALLED_APPS=[...'edc_lab.apps.AppConfig',...]ConfigurationCreate aliquot types:# aliquot typeswb=AliquotType(name='whole_blood',alpha_code='WB',numeric_code='02')bc=AliquotType(name='buffy_coat',alpha_code='BC',numeric_code='16')pl=AliquotType(name='plasma',alpha_code='PL',numeric_code='32')Add possible derivatives to an aliquot type:# in this case, plasma and buffy coat are possible derivativeswb.add_derivatives(pl,bc)Set up a processing profile:viral_load=ProcessingProfile(name='viral_load',aliquot_type=wb)process_bc=Process(aliquot_type=bc,aliquot_count=4)process_pl=Process(aliquot_type=pl,aliquot_count=2)viral_load.add_processes(process_bc,process_pl)Create a``panel`` that uses the processing profile:panel=RequisitionPanel(name='Viral Load',processing_profile=viral_load)Add the panel (and others) to a lab profile:lab_profile=LabProfile(name='lab_profile',requisition_model='edc_lab.subjectrequisition')lab_profile.add_panel(panel)Register thelab_profilewith the site global:site_labs.register(lab_profile)UsageCreate a requisition model instance:requisition=SubjectRequisition.objects.create(subject_visit=self.subject_visit,panel_name=self.panel.name,is_drawn=YES)Pass the requisition toSpecimenspecimen=Specimen(requisition=requisition)Process:specimen.process()Aliquots have been created according to the configured processing profile:>>>specimen.primary_aliquot.identifier'99900GV63F00000201'>>>foraliquotinspecimen.aliquots.order_by('count'):print(aliquot.aliquot_identifier)'99900GV63F00000201''99900GV63F02013202''99900GV63F02013203''99900GV63F02011604''99900GV63F02011605''99900GV63F02011606''99900GV63F02011607'