Recently I created my first package called pycohort: https://pypi.org/project/pycohort/
Here there are existing python functions that are working without any issues. A snippet from the code looks like this:
# packages needed
import pandas as pd
import numpy as np
def calculate_mean(some_list):
"""Function to calculate the mean of the data set.
Returns:
float: mean of the data set
"""
return (1.0 * sum(some_list) / len(some_list))
I first pip install pycohort
and then import pycohort
. When I call the above mentioned function like pycohort.calculate_mean(df.col1)
, I get the error message: AttributeError: module 'pycohort' has no attribute 'calculate_mean'
.
While uploading the function, I navigated to my current working directory and then entered the below code. But I don't suspect that there is an issue here since I was able to upload and pip install successfully.
python setup.py sdist
pip install twine
twine upload dist/*
What am I missing here about uploading or calling the function?
Thanks for the help,