Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Key Points

  1. Python or R for analytics?  creating models or building models in apps?


References

Reference_description_with_linked_URLs_______________________Notes______________________________________________________________


https://www.python.org/Python.org
https://docs.python.org/3/Python 3.x docs
https://wiki.python.org/moin/Python wiki


https://wiki.python.org/moin/MovingToPythonFromOtherLanguagesMoving to Python from other languages


Python for Java Developers - quick start

https://lobster1234.github.io/2017/05/25/python-java-primer/

https://drive.google.com/open?id=1bSt5RuW8VAGmpE9vYa5x-d02i7TnEyrD

python-4-java-io-lobster1234.github.io-Python Primer for Java Developers.pdf

Python for Java Developers - includes file , http io

https://realpython.com/oop-in-python-vs-java/

python-4-java-realpython.com-Object-Oriented Programming in Python vs Java.pdf

Python for Java Developers - OO concepts - blog - realpython


Analytics with Python or R


https://www.datacamp.com/community/tutorials/r-or-python-for-data-analysis?fbclid=IwAR3AEPrIfQrpoHPIeymv7zAPhEnrpR1RL0zZ8IS7
9AlaHgyzUPgouZmbBX4

python-vs-R-for-analytics-use-cases-2019.pdf

Python or R for analytics ?  comparison from DataCamp


Billable courses on Python
https://www.udemy.com/course/python-for-data-science-and-machine-learning-bootcamp/ML and Python basics - RECOMMENDED first course


https://www.udemy.com/course/math-with-python/learn Python and Math
https://www.udemy.com/course/pytorch-for-deep-learning-with-python-bootcamp/Pytorch intermediate



Key Concepts


Python for Java Developers Quickstart

https://medium.com/nestedif/cheatsheet-python-for-java-developers-98f75c94a1a

python-4-java-medium.com-Python for JAVA Developers Basics.pdf


python-4-java-io-lobster1234.github.io-Python Primer for Java Developers.pdf


Python for Java Developers - OO Coding Concepts - real python

https://realpython.com/oop-in-python-vs-java/

python-4-java-realpython.com-Object-Oriented Programming in Python vs Java.pdf


Migrating to Python

https://wiki.python.org/moin/MovingToPythonFromOtherLanguages


comp.lang.python

Probably your most valuable Python resource, right after python.org. Spot Python luminaries in their native habitat! Don't be surprised to have your questions answered by the original programmer or the author of the book open on your desk! The best thing about comp.lang.python is how "newbie-friendly" the mail group is. You can ask any question and never get a "RTFM" thrown back at you.


Where is Python's CPAN?

See the Python Package Index (PYPI), Python's centralised database of software. Any developer of Python software packaged using distutils (the built-in packaging system) may easily submit their package information to the index.

Before PYPI, Pythonistas contributed code to The Vaults of Parnassus. Unfortunately, the Vaults are not standardized or automated to the degree that the CPAN is, and the site now appears to be inactive. All hail its many useful years of service.


Tips for Learning Python

The following was taken from a post in comp.lang.python from Mel Wilson, which I thought well summarized good Python programming style for people coming from other languages. I also added some things I would have appreciated knowing during my first 3 days with Python.

  • The docs at python.org are very, very good. Hold onto that wallet, you don't need a trip to the bookstore to learn Python!
  • Scan the full list of built-in module names early on. Python is advertised as "batteries included", so knowledge of the built-in modules could reduce the lines of code by a factor of ten.
  • Learn Python slice notation, you will be using it a lot. I have this chart taped to my monitor:


Python indexes and slices for a six-element list.
Indexes enumerate the elements, slices enumerate the spaces between the elements.

Index from rear:    -6  -5  -4  -3  -2  -1      a=[0,1,2,3,4,5]    a[1:]==[1,2,3,4,5]
Index from front:    0   1   2   3   4   5      len(a)==6          a[:5]==[0,1,2,3,4]
                   +---+---+---+---+---+---+    a[0]==0            a[:-2]==[0,1,2,3]
                   | a | b | c | d | e | f |    a[5]==5            a[1:2]==[1]
                   +---+---+---+---+---+---+    a[-1]==5           a[1:-1]==[1,2,3,4]
Slice from front:  :   1   2   3   4   5   :    a[-2]==4
Slice from rear:   :  -5  -4  -3  -2  -1   :
                                                b=a[:]
                                                b==[0,1,2,3,4,5] (shallow copy of a)
  • Lose the braces, as you know them, and most of the semicolons, obviously.
  • Backslash can be used to allow continuing the program line past a carriage-return, but you almost never have to use it. Python is smart enough to do the right thing when it sees an open bracket, a comma separated list, and a carriage-return.
  • Strings are immutable. Whenever you think you have changed a string, remember that you really created a new string.
  • Where you would use <vector T>, use lists, or tuples, that is [] or (). Where you would use <map T1, T2>, use dictionaries, that is {} .

  • The semantics of iterators is available, but most of the syntax goes away. for item in alist: iterates over all the items in alist, one by one .. where alist is a sequence, i.e. a list, tuple, or string. To iterate over a sublist, use slices: for item in alist[1:-1]: does as above, but omits the first and last items.

  • For trickier iterations, read and re-read the Library doc on the topic of general-purpose functions. There are some functions that apply to sequences: map, filter, reduce, zip. that can work wonders. Hidden somewhere under the documentation for sequences there is a description of string methods that you'll want to read.
  • Hidden under the docs for 'Other Types' are the descriptions of all the file methods. There are no iostreams per se, but the class method str can get some of the effect for your own classes, and there are surely other angles I haven't thought of.

  • Forget overloading. You can define a function, and call it with anything you want, but if it has to behave differently for different type operands, you have to use the run-time type identification type function explicitly within the single definition of the function. Default arguments to functions are just as powerful a tool as in C++. Actually polymorphism does work as expected, it just doesn't require deriving from a base class as in C++ or Java.

  • In class definitions the equivalents of operator methods are covered in a chapter in the Python Language Reference. (Look for the double-underscore methods like __cmp__, __str__, __add__, etc.)

  • In C, the gotcha for new users is probably about pointers; they're tricky and they can't be avoided. The gotchas in Python are situations when you use different references to a single object, thinking you are using different objects. I believe the difference between mutable and immutable objects comes into play. I have no clear answers here .. I still get caught once in a while .. keep your eyes open.
  • Read the Tutorial once, skim the Library Reference .. at least the table of contents, then skim the Language Reference and you will probably have encountered everything you need.
  • For reference the excellent Python Quick Reference and the Module Index of the Python docs are generally sufficient.



Python PEP 8: Style Guide for Python Code

Style Guide for Python Code




Potential Value Opportunities



Potential Challenges



Candidate Solutions



Step-by-step guide for Example



sample code block

sample code block
 



Recommended Next Steps



  • No labels