Skip to content

Commit ae9a310

Browse files
committed
lots of additions
1 parent a93e6db commit ae9a310

File tree

1 file changed

+73
-7
lines changed

1 file changed

+73
-7
lines changed

README.md

Lines changed: 73 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ In this [Houston Data Science][1] meetup we will introduce our members to data s
2727
* seaborn
2828
* connect to sqlite
2929

30+
3031
## Create Github Account
3132
The page is currently being hosted on Github, a site that hosts remote Git repositories. Github is a popular place to share and collaborate on software projects. The most popular data science libraries are all hosted on Github. On Github, you can find the latest developments, track bugs and join the conversation with fellow developers.
3233

@@ -108,8 +109,6 @@ Now that you have the package manager, you may begin to install packages. We wil
108109
> 1. A new text box will open up with a huge list of available packages
109110
> 1. Type in 'Anaconda'. It should be the first option damnwidget.github.io/anaconda
110111
111-
[Watch this video][11] to get more in-depth tutorial on Sublime packages for Python.
112-
113112
# Opening our first Python program
114113
Open up the program `guess_number.py` in Sublime. This is a small game that attempts to guess your number within 5 steps. Before we play or analyze the game, take a look at the bottom right hand corner of Sublime. You should see some text that reads `Tab Size: 4`. There is nothing inherrently wrong with this except that Python's style guide PEP 8 suggests using 4 spaces over tabs. To change the default settings do the following:
115114

@@ -169,15 +168,75 @@ Remember how I mentioned above that `guess_number.py` does not run well by using
169168
> 1. Go to the `guess_number.py` file
170169
> 1. Go to Tools -> SublimeREPL -> Python - Run Current File
171170
> 1. This exacat option is also available via the command palette.
171+
> 1. Play the game in the REPL
172+
173+
You may also use the REPL to run code interactively.
174+
> 1. Start SublimeREPL and run some lines of code
175+
176+
### Sublime resources
177+
178+
+ [Watch this video][11] to get more in-depth tutorial on Sublime packages for Python.
179+
+ Sublime has a [very detailed documentation][15] page where you can learn everything about it.
180+
+ There is also a package called Sublime Tutor you can install and learn through practice.
181+
182+
## IPython
183+
IPython is an enhanced command line REPL with much more functionality than the default one shipped with Python. IPython stands for interactive Python and has grown extremely popular in recent years.
184+
185+
Let's see some of the extra features it provides
186+
187+
> 1. Launch IPython by opening up a terminal and running the command `ipython`
188+
> 1. Enter `?` and press enter. This will give you a quick overview of IPython
189+
> 1. For a more complete reference of its capabilities run `%quickref`
190+
191+
192+
Get help with any object by placing a question mark after it.
193+
```
194+
import pandas as pd
195+
pd?
196+
```
197+
198+
Get nice tab completion with `pd.<press tab>`
199+
200+
Run shell comands with `!` like `!ls`
201+
202+
### IPython magic commands
203+
IPython comes equipped with a few dozen [magic commands][18] that conveniently do things that are not so easy using native Python interactively. Take for instance the `%timeit` magic which is the one I most often use. Let's time the difference between adding a one to each element in a list vs adding one to each element of a NumPy array.
204+
205+
```python
206+
In [1]: n = 10000000
207+
In [2]: some_list = list(range(n))
208+
In [3]: import numpy as np
209+
In [4]: some_array = np.arange(n)
210+
In [5]: %timeit [x+1 for x in some_list]
211+
809 ms ± 19.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
212+
In [6]: %timeit some_array + 1
213+
27.9 ms ± 720 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
214+
```
215+
216+
### IPython resources
217+
+ [IPython documentation][16]
218+
+ [IPython cookbook][17]
219+
220+
## PyCharm
221+
PyCharm is an excellent [IDE][19] (integrated development environment) made specifically for Python. It provides lots of graphical tools to help developers produce code.
222+
There is a free community edition a paid enterprise edition and an education edition with lots of exercises to get you started using it.
172223

224+
Let's download and install PyCharm Edu
225+
> 1. Visit [PyCharm Edu][20] and download and install.
226+
> 1. A new project title **Introduction to Python** should start up.
227+
> 1. If it does not navigate to file -> new project -> educational
228+
> 1. Before beginning on the 50 exercises you will want to ensure that PyCharm is using a Python 3 interpretter
229+
> 1. Go to Preferences -> Project -> Project Interpreter and choose the Python 3 interpreter than comes with Anaconda
230+
> 1. Complete the exercises by reading the task description and editing the code.
231+
> 1. Press the run button to execute the code and then mark the code as complete.
173232
233+
PyCharm offers a lot more and is excellent for large and complex projects. Watch [this series of YouTube][21] videos to learn more.
174234

175-
Sublime has a [very detailed documentation][15] page where you can learn everything about it.
235+
## Spyder and Rodeo
236+
Anaconda ships with its own IDE called Spyder which is similar to R-Studio the main development environment for R users. Rodeo is a product from Yhat that has gained lots of momentum recently and is similar to Spyder.
176237

177-
pycharm
178-
https://www.jetbrains.com/pycharm-edu/
179-
file -> new project -> educational
180-
choose python 3 interpreter
238+
## Minimal text editors
239+
Some developers like to keep their hands on the keyboard at all times and prefer minimal text editors like VIM or Emacs. [Visit this page][22] to see a longer list of editors for Python.
181240

182241
use jupyter notebook in pycharm: https://www.jetbrains.com/help/pycharm/using-ipython-jupyter-notebook-with-pycharm.html
183242

@@ -199,3 +258,10 @@ Typical workflows for data scientists
199258
[13]: https://en.wikipedia.org/wiki/Comparison_of_text_editors
200259
[14]: https://matplotlib.org/examples/animation/rain.html
201260
[15]: http://docs.sublimetext.info/en/latest/
261+
[16]: http://ipython.readthedocs.io/en/stable/
262+
[17]: https://github.com/ipython/ipython/wiki?path=Cookbook
263+
[18]: http://ipython.readthedocs.io/en/stable/interactive/tutorial.html#magic-functions
264+
[19]: https://en.wikipedia.org/wiki/Integrated_development_environment
265+
[20]: https://www.jetbrains.com/pycharm-edu/
266+
[21]: https://www.youtube.com/watch?v=BPC-bGdBSM8&list=PLQ176FUIyIUZ1mwB-uImQE-gmkwzjNLjP
267+
[22]: https://wiki.python.org/moin/PythonEditors

0 commit comments

Comments
 (0)