Python Functions, Files, and Dictionaries

所在平台: Coursera

课程主页: https://www.coursera.org/learn/python-functions-files-dictionaries

课程评论:没有评论

第一个写评论        关注课程

课程简介

课程名称:Python函数、文件和字典 课程概述:本课程介绍字典数据结构和用户定义的函数。你将学习关于局部和全局变量、可选参数和关键字参数传递、命名函数和lambda表达式的知识。此外,还将学习Python的sorted函数以及如何通过传递其他函数作为输入来控制排序顺序。在最终项目中,你将从文件中读取模拟社交媒体数据,计算情感分数,并输出.csv文件。课程涵盖了教科书《Python编程基础》中的第10至16章,该书为本课程的辅导材料(可选且免费的)。 适合人群:如果你已经完成“Python基础”课程,想要进一步深入了解Python编程语言,那么这门课程非常适合你。两门课程一起旨在帮助Python编程新手、需要复习Python基础的学习者,或对Python有过一些接触但希望获得更深入知识和描述程序的词汇的人。 课程结构: 1. **文件和CSV输出**:第一周将通过视频讲座和Runestone教科书介绍如何将文件作为额外数据源纳入程序。你将学习如何从文件中读取、写入文件,以及如何处理.csv数据格式。 2. **字典与字典累积**:第二周的内容重点是字典这一新数据类型。你将了解字典的机制,并练习使用累积模式来构建字典以及找到最佳或最差的结果。 3. **函数与元组**:第三周将介绍函数的构建。到目前为止,你在程序中使用过函数,但还没有机会编写自己的函数,包括如何定义函数、如何结合参数、如何从函数返回数据、变量的局部或全局范围,以及函数执行可能产生的副作用。最后,我们将更深入地探讨元组,以及如何在函数和for循环中使用元组的自动打包和解包。 4. **更多迭代与高级函数**:第四周将介绍更高级的迭代机制while循环。你将学习如何在获取用户反馈时使用它,并将其应用于turtle模块绘制图像。此外,你还将接触到高级函数概念,例如可选参数、匿名函数和lambda表达式。 5. **排序**:第五周将详细讲解如何对Python对象进行排序,包括基础和更高级形式的字典排序,以及如何打破排序中的平局。最终课程评估将是一个项目,要求你读取来自社交媒体网站的虚假自动生成数据,分析社交媒体帖子情感。你需要提交一个csv文件,以及展示你的发现的图表图片。

课程大纲

Name:Files and CSV Output

Description:In week one the video lectures and the Runestone textbook will introduce you to the idea of incorporating files into your programs as an additional source of data. You will learn how to read from a file, write to a file, and how to work with the .csv data format.

Name:Dictionaries and Dictionary Accumulation

Description:In week two the video lectures and the Runestone textbook will focus on a new data type, dictionaries. You will be introduced to the mechanics of dictionaries and then get practice using them in accumulation patterns, both to build a dictionary using the pattern as well as find the best, or worst, result using the pattern.

Name:Functions and Tuples

Description:In week three you will be introduced to the construction of functions. Up to this point, you have used functions in the programs before, but have not had a chance to write your own functions, including how to define a function, how to incorporate parameters, how to return data from a function, the local or global scope of variables, and potential side effects that could occur from function execution. Finally, we look at tuples more in depth, and how automatic packing and unpacking of tuples can be used in functions and in for loops.

Name:More Iteration and Advanced Functions

Description:In week four the video lectures and the Runestone textbook will outline a more advanced iteration mechanism, the while loop. You will be introduced to using it when getting feedback from users, as well as applying it to the turtle module to draw images. Additionally, you will also be exposed to more advanced function concepts such as the idea of parameters being optional, not required, and anonymous functions using lambda.

Name:Sorting

Description:In week five the videos and Runestone textbook will detail how to sort python objects - both the basics and more advanced forms of sorting for dictionaries and how to break a tie (if that occurs). The final course assessment will be a project that asks you to read fake, auto-generated data from a social media site to analyze social media post sentiments. You will submit a csv file as well as images of graphs that demonstrate your findings.

课程评论(0条)

课程详情

This course introduces the dictionary data structure and user-defined functions. You’ll learn about local and global variables, optional and keyword parameter-passing, named functions and lambda expressions. You’ll also learn about Python’s sorted function and how to control the order in which it sorts by passing in another function as an input. For your final project, you’ll read in simulated social media data from a file, compute sentiment scores, and write out .csv files. It covers chapters 10-16 of the textbook “Fundamentals of Python Programming,” which is the accompanying text (optional and free) for this course. The course is well-suited for you if you have already taken the "Python Basics" course and want to gain further fundamental knowledge of the Python language. Together, both courses are geared towards newcomers to Python programming, those who need a refresher on Python basics, or those who may have had some exposure to Python programming but want a more in-depth exposition and vocabulary for describing and reasoning about programs. This is a follow-up to the "Python Basics" course (course 1 of the Python 3 Programming Specialization), and it is the second of five courses in the specialization.

课程标签

0人关注该课程

主题相关的课程