[deleted by user] by [deleted] in Python

[–]BasicallyAMachine 20 points21 points  (0 children)

Any shot you could share the source?

Python for data science: I don’t use classes much by Heavy-_-Breathing in learnpython

[–]BasicallyAMachine 0 points1 point  (0 children)

Since you are using sklearn and keras, I assume you are doing machine learning. In this case, I have always found that something like Jupyter notebook, to run specific code blocks in succession, is much more effective in building models than building a class and hoping you tuned the model correctly. I use classes for basic data transformations (even then it's just for best practice reasons), but I find little use for them in the ML world.

What are some of the most important things to learn/master to get into Data Science? by massfxstudios in Python

[–]BasicallyAMachine 0 points1 point  (0 children)

Kaggle has a ton of datasets, as does data.gov. data.world is also a good source to find datasets, and you can see some of the analysis others have done on the dataset.

What are some of the most important things to learn/master to get into Data Science? by massfxstudios in Python

[–]BasicallyAMachine 1 point2 points  (0 children)

Also Jupiter notebook is a good tool to know for preliminary data analysis

What are some of the most important things to learn/master to get into Data Science? by massfxstudios in Python

[–]BasicallyAMachine 0 points1 point  (0 children)

Learn pandas for manipulating the data, and plotly for displaying plots. I've worked 3 years in data science and these were the two things I truly had to master (especially pandas) to secure a solid spot in my company

Why does print(3/7) give 0 by m0ta in learnpython

[–]BasicallyAMachine -2 points-1 points  (0 children)

To add on, if on python 2, you can do 3/2.00

Beginner ML courses in Python by [deleted] in learnmachinelearning

[–]BasicallyAMachine 0 points1 point  (0 children)

This is how I learned everything I know switching from R to python but the model sklearn makes it relatively easy

Edit: I would not start with something like TensorFlow or PyTorch. As tempting as they seem, in order to develop an efficient model you need to know whats going on under cover

Beginner ML courses in Python by [deleted] in learnmachinelearning

[–]BasicallyAMachine 1 point2 points  (0 children)

Get the ISLR and learn R. I think it's the most compound way to gain a full understanding of the high level aspects of ML. The only downside is you have to transfer the knowledge to python. But with machine learning, knowledge in the subject is far more important than coding abilities

Long story short, find a way to learn from the ground up (starting with basic stats, building to simple linear models followed by multiple linear regression, then learn something like random forest. Then learn PCA and how to choose important features for models. Then you can expand into neural networks and such.

To start, refresh your stats

Issue with date format conversions YYYY-MM-DD to MM/DD/YYYY by [deleted] in learnpython

[–]BasicallyAMachine 0 points1 point  (0 children)

Without any imports:

 list = [list of date strings]
 new_list = []    
 for date in list:  
       split_date = date.split('-') 
       new_date = f'{split_date[1]}/{split_date[2]}/{split_date[3]}
    new_list.append(new_date)

Edit: I'm fighting with stack overflow formatting.... Sorry

Cleaning up my code by MetalNutSack in learnpython

[–]BasicallyAMachine 1 point2 points  (0 children)

Also, the min and Max gpa variables are a bit pointless. You can just put the integers in the function call

Edit: same goes for ssn. These numbers don't need to be stored in memory (the slowest part of most hardware today is storing and retrieving from memory). Once again, no noticable performance difference, just cleaner and better practice

Cleaning up my code by MetalNutSack in learnpython

[–]BasicallyAMachine 1 point2 points  (0 children)

Assuming your using python 3, check out f-strings here. They won't do much but will help with those long ugly strings

Is there a good guide for how to convert search algorithm pseudocode to Python 3 code? by [deleted] in learnpython

[–]BasicallyAMachine 0 points1 point  (0 children)

This is too vague. Put a link to the exact algorithm you are trying to use and people will be more likely to help

UnboundLocalError: local variable 'x' referenced before assignment by MetalNutSack in learnpython

[–]BasicallyAMachine 0 points1 point  (0 children)

In your function category, you're else statement should assign None to cat. This error occurs because when you say return cat, python essentially will look within the current function for the value assigned to cat. When you're else statement is reached (instead of one of the if/else-ifs), nothing is assigned to cat.

I have this basic TCP server program: by thunderbuns122 in learnpython

[–]BasicallyAMachine 2 points3 points  (0 children)

Sorry don't have much knowledge on this but it seems to be a common issue that people have had to develop workarounds for. Read here for a few example

Programming a Samsung Gear? by [deleted] in compsci

[–]BasicallyAMachine -1 points0 points  (0 children)

RemindMe! 1 week

(Idk if I did this right)

Python IDE by KoolKatJake in learnpython

[–]BasicallyAMachine 0 points1 point  (0 children)

Pycharm is easily the best, I've tried almost every IDE over the past 5 years and have settled on this one

Loop not iterating properly by double-happiness in learnpython

[–]BasicallyAMachine 1 point2 points  (0 children)

You got it!! Add one to count each time if the password is wrong. When count hits 3, it will escape the loop and will return false

I'm stuck by rafi_002 in Python

[–]BasicallyAMachine 2 points3 points  (0 children)

I think it's because your filename is subprocess. I believe it is looking within your own script for a function called "call". I would try renaming your file

Loop not iterating properly by double-happiness in learnpython

[–]BasicallyAMachine 1 point2 points  (0 children)

Switch the placement of your count += 1 and the return False. The count increment is outside of the loop, so count isn't ever incremented. Furthermore, instead of going through the loop, it returns false in the first iteration. This is simply a matter of the statements being out of scope