未加星标

Intro to Python CSV Processing for Actual Beginners

字体大小 | |
[开发(python) 所属分类 开发(python) | 发布者 店小二05 | 时间 2017 | 作者 红领巾 ] 0人收藏点击收藏

I've written quite a bit about CSV processing . It crops up in my books. A lot.

In all cases, though, I make the implicit assumption that my readers already know a lot of python. This is a disservice to anyone who's getting started.

Getting Started

You'll need Python 3.6. Nothing else will do if you're starting out. Go here to find it.You can get the small "Miniconda" version to start with. It has some of what you'll need to hack around with CSV files. The full Anaconda version contains a mountain of cool stuff, but it's a big download.

Once you have Python installed, what next? To be sure things are running do this:

Find a command line prompt (terminal window, cmd.exe, whatever it's called on your OS.) Enter python3.6 (or just python in windows.) If Anaconda installed everything properly, you'll have an interaction that looks like this: MacBookPro-SLott:Python2v3 slott$ python3.5 Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>

More-or-less. (Yes, the example shows 3.5.1 even though I said you should get 3.6. As soon as the Lynda.com course drops, I'll upgrade. The differences between 3.5 and 3.6 are almost invisible.)

Here's your first interaction:

>>> 355 / 113 3.1415929203539825 >>> 355 / 113 3.1415929203539825

Here's some more.

>>> exit Use exit() or Ctrl - D(i.e.EOF) to exit >>> exit()

Okay. That was fun. But it's not data wrangling. When do we get to the good stuff?

To Script or Not To Script

We have two paths when it comes to scripting. You can write script files and run them. This is pretty normal application development stuff. It works well. Or, you can use a Jupyter Notebook. This isn't exactly a script, but you can use it like a script. It's a good place to start building some code that's useful. You can rerun some (or all) of the notebook to make it script-like.

If you downloaded Anaconda, you have Jupyter. Done. Skip over the next part that covers installing Jupyter.

Installing Jupyter

If you did not download the full Anaconda -- perhaps because you used the Miniconda -- you'll need to add Jupyter. You can use the 'conda command' installer for this.

Another choice is to use the PIP program to install Jupyter. The net effect is the same. It starts like this:

MacBookPro-SLott:Python2v3 slott$ pip3 install jupyter Collecting jupyter Downloading jupyter-1.0.0-py2.py3-none-any.whl Collecting ipykernel (from jupyter) Downloading ipykernel-4.5.2-py2.py3-none-any.whl (98kB)

100% |%

本文开发(python)相关术语:python基础教程 python多线程 web开发工程师 软件开发工程师 软件开发流程

主题: MacBookPythonWindowsAppleInc.Apple Inc.
分页:12
转载请注明
本文标题:Intro to Python CSV Processing for Actual Beginners
本站链接:http://www.codesec.net/view/534950.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 开发(python) | 评论(0) | 阅读(78)