You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+73-7Lines changed: 73 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,7 @@ In this [Houston Data Science][1] meetup we will introduce our members to data s
27
27
* seaborn
28
28
* connect to sqlite
29
29
30
+
30
31
## Create Github Account
31
32
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.
32
33
@@ -108,8 +109,6 @@ Now that you have the package manager, you may begin to install packages. We wil
108
109
> 1. A new text box will open up with a huge list of available packages
109
110
> 1. Type in 'Anaconda'. It should be the first option damnwidget.github.io/anaconda
110
111
111
-
[Watch this video][11] to get more in-depth tutorial on Sublime packages for Python.
112
-
113
112
# Opening our first Python program
114
113
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:
115
114
@@ -169,15 +168,75 @@ Remember how I mentioned above that `guess_number.py` does not run well by using
169
168
> 1. Go to the `guess_number.py` file
170
169
> 1. Go to Tools -> SublimeREPL -> Python - Run Current File
171
170
> 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+1for 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.
172
223
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.
173
232
233
+
PyCharm offers a lot more and is excellent for large and complex projects. Watch [this series of YouTube][21] videos to learn more.
174
234
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.
176
237
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.
181
240
182
241
use jupyter notebook in pycharm: https://www.jetbrains.com/help/pycharm/using-ipython-jupyter-notebook-with-pycharm.html
183
242
@@ -199,3 +258,10 @@ Typical workflows for data scientists
0 commit comments