Skip to Content
Python数据处理
book

Python数据处理

by Jacqueline Kazil, Katharine Jarmul
July 2017
Intermediate to advanced
398 pages
11h 54m
Chinese
Posts & Telecom Press
Content preview from Python数据处理
348
附录
C
输入
exit
就可以退出
PowerShell
。提示符应该会变回
cmd
的标准提示符。输入
dir
Downloads\text_examples
,你应该会看到许多下载好的语料库文本文件。我们用
findstr
在这些文件中查找:
findstr "neat" Downloads\text_examples\*.txt
你应该会看到控制台中滚动输出了许多文本。它们是包含单词
neat
的文本文件中的匹配
行。
有时你想搜索特定的文件名,而不是文件中的字符串。你可以用
dir
命令加一个过滤器
filter
)来做到这一点:
dir -r -filter "*.txt"
这应该会找出主文件夹下所有子文件夹中的
.txt
文件。如果你需要继续在这些文件中搜索,
可以使用管道操作。
|
字符可以将第一个命令的输出通过管道传递给下一个命令。比如说,
我们可以用管道找到包含特定函数名的所有
Python
文件,或找到包含特定国家名称的所有
CSV
文件。我们试一下,将
findstr
的输出通过管道传递给
find
命令:
findstr /s "snake" *.txt | find /i "snake" /c
这段代码的作用是,首先找出包含单词
snake
的文本文件,然后利用
find
计算单词
snake
在这些文件中出现的次数。可以看出,学习更多
cmd
命令及其用法将有助于大大简化数据
处理人员和开发人员的很多任务,如搜索文件、运行代码、管理工作等。关于这一话题,
本附录介绍了一些内容,你可以在此基础上深入学习。
C.2.5
 更多资源
想要学习如何将 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

数据科学中的实用统计学(第2版)

数据科学中的实用统计学(第2版)

Peter Bruce, Andrew Bruce, Peter Gedeck
Java持续交付

Java持续交付

Daniel Bryant, Abraham Marín-Pérez
解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787115459190