Feedback on Mean-Variance-Standard Deviation Calculator

Hi everyone!

Just completed (hopefully) the first Python project. Any feedback would be appreciated!

link to project



You can shorten the code in several ways by not using append but instead just creating the dictionairy WITH the arrays inside WITH the respective commands inside those in one go. This level of nesting with some nice indentation can make the entire thing much more cleaner and easy to read.

Also don’t use the name of an object for a variable. In your case dict is the class-name to create dictionairy objects, instead you turn it into a variable.

First of all, how do you publish your project without allowing people to edit it? When I’ve published my link I allowed to edit it. Hopefully, nobody wants to cheat me :stuck_out_tongue_closed_eyes: but would be nice to know how to do it.

About your project, I’ve been working on the same project a few days ago. Maybe isn’t necessary to create a dict with keys before calculating statistics. I think that also works if u write something like this:

calculations[“mean”] = test.mean(axis=0)

Maybe I’m wrong in the form, but sure that a similar code will work.

Also, I’ve made this mistake a few times, try to name variables well from the very begginig. Don’t write dict if u can write calculations, also remember that dict is a reserved word in Python if I’m not wrong.

If you go to my project u will see how I’ve made a function to calculate statistics, it’s maybe a clearer way to do it. My code

I’m new to Python and I think that trying to help others is a good way to learn: Maybe I’m not useful but reading other’s code is an interesting path to see how others work on the same projects as I do.

Hi Jagaya!

Thanks for a quick response. I have a tendency to make my code very barebones. I have modified the code to make it easier to read and comprehend.

Is this what you had in mind?
Link to code

Hey Adria!

Same here, pretty much new to this, I gone through a course on Udemy, and now trying to solve these cool projects.

Afaik, everyone can make a copy of a project and edit it on their own (without affecting your original code). I’ve read somewhere that you can make it run-only, but people can still find the code if they search your profile, not 100% sure though.

Thanks for the suggestions, I made some modifications.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.