今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Transforms
- Python has become pretty popular among data scientists and other developers who need to work with large amounts of data and that's not an accident. The Python standard library provides built-in functions for transforming sequences of data. And you should use these whenever you find you have a need for that kind of operation. So in this example, we'll take a look at some of those functions. So here in VS code, I have opened the file transforms_start.py in my built-in functions chapter. And I'll try out the filter function first. The filter functions does essentially what its name implies. It creates an iterator that filters out values from a given sequence. You pass it a function to perform a Boolean test and if that test returns false, then that item is removed from the resulting sequence. So I have a list of numbers here in my editor right here at nums. And let's suppose I'd like to filter out the even numbers. So first, I'll write the code to call the filter function and I'll name…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。