【ENG SUB】前端自学Python一星期,能干点啥?I learned Python in a week

小雨在烦恼什么
22 Jan 202206:49

Summary

TLDR本视频脚本讲述了我于2022年1月11日开始学习Python的经历。我已经了解Node.js,希望能学会另一种脚本语言,以处理更多类型的自由职业项目和工作需求。我介绍了Python的优势,如易于上手、轻量,以及它在网络爬虫、数据分析等方面的应用。最后,我表示Python是初学者的良好选择,尤其是作为第二门编程语言,它可以帮助我们在工作和生活中提高效率。我很高兴完成了新年决心中的一项,感谢观看。

Takeaways

  • 🐍 开始学习Python,尽管之前多次放弃,但决定再次尝试以扩展自由职业项目类型并提高工作效率。
  • 👨‍💻 作为Node.js开发者,发现Python与JavaScript在数据结构、函数、循环等基础方面有相似之处,但语法和数据结构上存在差异。
  • 📊 在非软件公司的操作团队和HR中,Python被用于数据分析和生成报告,以及自动化发送邮件。
  • 🏆 通过前公司提供的免费Python课程和学习小组,尝试过学习Python,但由于时间限制未能坚持。
  • 🛠️ 认为编程语言之间存在相似性,学习新语言时应关注与已知语言的不同之处。
  • 🔍 发现Python具有清晰简单的特点,易于设置环境,并通过pip安装模块以支持各种应用。
  • 🕸️ 尝试使用Python编写网络爬虫以提高获取Bilibili视频分析数据的效率,但对如何实现功能存在疑问。
  • 📝 通过回顾教程和笔记,以及查看GitHub上的项目示例,开始编写爬虫演示。
  • 🔗 为避免法律问题,选择使用Bilibili的开放API进行练习。
  • 📊 考虑使用Python图表库来可视化数据,并比较Python和Node.js在开发上的不同,发现Python虽然较慢,但对初学者友好,且文件大小更轻。
  • 💡 提出使用Python为Bilibili创作者开发视频分析平台的想法,并计划进一步探索Python图表库。

Q & A

  • 为什么作者决定学习Python?

    -作者想要处理更多类型的自由职业项目,并能够阅读工作中需要的Python代码,同时利用Python提高个人生产力。

  • 作者之前尝试学习Python的结果如何?

    -作者在过去几年中尝试学习Python,但由于没有时间,总是刚开始就放弃了。

  • 为什么Python在作者的生活和工作环境中很受欢迎?

    -在作者生活和工作的湾区,大型科技公司和非软件公司的运营团队都在某种程度上使用Python进行后端开发、数据分析和报告制作,甚至HR也使用Python发送邮件。

  • 作者如何克服过去学习Python时的挑战?

    -作者利用空余时间,采取与以往不同的学习方法,如通过视频教程和查阅GitHub上的项目示例,开始实践编写代码。

  • 作者在学习Python的过程中发现了哪些Python的优点?

    -Python是一种干净、简单的语言,易于设置环境,拥有丰富的模块可以通过pip安装,便于快速开发应用程序。

  • 作者如何利用Python提高工作效率?

    -作者计划通过编写爬虫脚本来快速获取Bilibili视频分析数据,以减少手动收集数据的时间。

  • 作者在实现视频分析数据爬虫的过程中遇到了哪些挑战?

    -作者需要弄清楚如何在VS Code中运行Python脚本,安装所需模块,并处理法律上是否允许从特定地址请求数据的问题。

  • 作者是如何解决编写爬虫程序时遇到的问题的?

    -作者回顾学习笔记,参考其他人的项目示例,并决定使用Bilibili的开放API来避免法律问题。

  • Python与JavaScript在数据处理和可视化方面有哪些不同?

    -作者认为,相比于JavaScript的图表库,使用Python进行数据分析和图表生成更为简便。

  • 作者如何看待Python作为初学者的编程语言?

    -尽管Python在执行速度上可能较慢,但由于其易学和轻量级的特性,作者认为Python是初学者的一个很好的选择。

Outlines

00:00

🚀 开始Python学习之旅

2022年1月11日,作者决定开始学习Python,尽管之前多次放弃,但已有Node.js基础。作者希望通过学习Python来扩展自己的自由职业项目类型,并能够阅读工作中的Python代码。Python的普及和在硅谷的重要性促使作者再次尝试学习。尽管之前因为工作忙碌而没有时间学习,但现在作者有了更多的空闲时间并保持了学习的热情。通过对比Python和JavaScript的基础知识和语法差异,作者快速掌握了Python的基础,并在短时间内实现了实用的应用程序开发,如网络爬虫。作者还提到了使用Python进行数据分析和制作图表的便利性,并分享了使用Python开发视频分析工具的经验,以及如何通过学习和实践来克服编程挑战。

05:01

📊 Python入门心得与应用

作者总结了学习Python的经验,认为Python是适合初学者的良好选择,尽管执行速度比Node.js慢,但由于其易学和轻量级特性,使得初学者能够快速上手并保持兴趣。Python不仅适用于网络爬虫和数据可视化,还可以用于编写测试、办公自动化、数据科学、后端开发、机器学习等多个领域。作者强调,尽管学习了Python语言,但要进入这些领域还需时间掌握相关框架和积累项目经验。此外,作者通过自己的经历提示,了解就业市场中Python相关职位的需求是重要的,同时也分享了Python作为第二编程语言在技术工作中的实际应用价值。最后,作者提到在面试过程中,拥有数据分析等技能将是简历的加分项。

Mindmap

Keywords

💡学习Python

学习Python是视频中主人公决定要做的一件事。她之前多次试图学习Python但都放弃了,这次她决心要学会。这是视频的主题。

💡网络爬虫

主人公决定用Python写一个网络爬虫程序来自动获取她在B站上的视频数据,这样她就不用一个一个视频地手动查数据了。这成为她学习Python的第一个项目。

💡编程语言

主人公已经会Node.js, 希望再学一门脚本语言。她比较了Python和JavaScript的语法差异。视频中多次提到Python是一个流行的编程语言。

💡数据分析

主人公的同事用Python做数据分析生成报告。这是Python的一个重要应用领域。主人公获取视频数据的目的是为了分析。

💡代码量

主人公比较了用Python和Node.js编写相同爬虫程序的代码量,Python更简洁。这是Python的一个优点。

💡运行速度

主人公比较了Python和Node.js版本爬虫的运行速度,Node.js更快。这是Python的一个劣势。

💡后端开发

视频提到Python也可以用于后端开发,但是并不是许多公司会只用Python做后端。如果想从事后端开发,学习Python可能不是最佳选择。

💡机器学习

视频中简要提到Python也可以用于机器学习,但需要长时间的学习和项目经验。

💡编程入门

视频最后认为Python是编程入门的一个不错选择,容易上手,可以在短时间内产生成果和兴趣。

💡就业前景

视频分析了Python在不同领域的就业前景,提到学习Python对求职有帮助,但不应指望在短时间内从0到找到工作。

Highlights

第一重要摘要

第二关键摘要

第三要点

Transcripts

play00:00

Today is Jan 11th 2022

play00:02

I decided to start learning Python

play00:04

though I gave up on it many times before

play00:08

I already knew Node.js

play00:09

but I want to learn another script language

play00:11

so I will be able to handle more types of freelance projects

play00:13

and I will also be able to read python code for work if needed

play00:16

in my free time

play00:16

maybe I can use it to write scripts to help my productivity

play00:18

Python is a very popular programming language nowadays

play00:19

when I live and work in the Bay area

play00:21

I feel like everybody knows Python

play00:23

big tech companies like google

play00:24

facebook

play00:25

use python for their backend in some ways

play00:27

some companies use python for all of their backend

play00:30

in the company I use to work at (not a software company)

play00:32

coworkers in the operation team

play00:34

use python for data analysis

play00:36

and make reports with beautiful charts for management

play00:38

even HR's use python to send emails

play00:40

and they learned it by themselves

play00:42

so as someone who loves learning new things

play00:45

I have to learn it too

play00:49

in fact I have tried learning python

play00:51

in the past couple years

play00:53

my previous company even provided

play00:55

free

play00:56

python courses and learning groups to employees

play00:57

but I didn't have time to learn it.

play01:00

it's like I just get started and then I give up immediately

play01:03

but this is not an excuse

play01:04

as someone who worked full time at that time

play01:05

to make myself learn something completely new

play01:07

is quite challenging

play01:09

people say you can always make the time for it if you truly want to do something

play01:10

but the time is spent for work

play01:13

now I finally had some time

play01:15

I will learn it when I am still interested and motivated

play01:22

I think programming languages are similar

play01:25

if you already know one language

play01:27

when you learn a new language

play01:29

just focus on finding what is different from the language you already know

play01:31

the basic stuff like data structures

play01:33

functions

play01:35

loops and things like that are similar in different programming languages

play01:36

python and javascript is not that different

play01:39

I'm not used to that there is no {} in python

play01:41

instead you would use :

play01:42

and indent to segment codes

play01:44

the difference is in the syntax

play01:46

and data structure

play01:48

in day 3

play01:49

I went though all the basics of python

play01:52

this time I'm glad I didn't give up

play01:55

up until now I spent less than 14 hours

play01:57

at this point

play01:58

i feel like python is

play02:00

a very clean and simple

play02:01

it's very easy to set up

play02:03

the environment

play02:04

just need to download python package

play02:06

and that's all

play02:07

python comes with many modules

play02:10

just use pip install to grab it

play02:11

and then you can import the module directly and use it in your code

play02:13

and make many fun applications

play02:14

like for web crawler

play02:15

you will need the request module

play02:17

for data analysis you will need to install a chart library

play02:20

then just import it

play02:21

pass the data and you will get the graph

play02:24

I feel like

play02:25

it's a bit easy to use compared to javascript charts

play02:27

now I have mixed feelings as a js developer

play02:30

now it seems like I've learned python

play02:32

but there is just one question left

play02:35

that maybe many of you are also wondering

play02:37

what can you do with python?

play02:39

for me

play02:40

when I review my videos on Bilibili

play02:42

to see if people like my content

play02:44

since Bilibili

play02:45

didn't allow us to export

play02:47

my analytics

play02:48

so I had to check each video individually

play02:51

and look at the metrics I think it's important to me

play02:53

and then put them

play02:54

on my excel template

play02:56

then I can try to analyze it

play02:59

but this is quite time consuming

play03:01

I always had to spend a whole morning to collect the data

play03:02

in order to be more productive

play03:04

I need to figure out how to

play03:05

get my video analytics faster

play03:07

instead of me having to click on each video and find it

play03:09

so I will need a crawler

play03:11

here is the problem

play03:12

I just went through the whole video tutorial

play03:13

I still don't know how to make this application

play03:15

so I had to review a bit of what I learned

play03:18

and my notes

play03:20

then I start to figure out how to write a demo of my crawler

play03:22

first thing is to figure out how to run python script in vs code

play03:25

and how to install the modules I need

play03:27

I looked at projects of other people on github as examples

play03:28

and try to write something similar

play03:30

this is the learning method I tend to use

play03:32

it's good that

play03:33

crawler is simple

play03:35

step one is to start a request

play03:38

step two is

play03:38

to format the data

play03:40

you get from the request

play03:42

the tricky part is

play03:43

whether you can find the request address

play03:45

and whether it's legal to request data from that address

play03:47

this something I've been wondering

play03:49

technically

play03:49

it's not allow to use crawler to get data from other websites for business use

play03:51

but it seems like crawlers are so common

play03:53

that everyone knows how to do it

play03:54

so to avoid getting in trouble

play03:55

I will use Bilibili's open api for practice

play03:57

after creating bug and debug

play03:59

I officially wrote my first python script

play04:02

this took me a bit over two hours

play04:04

just run these 50-lines of code

play04:06

it will return my video analytics

play04:08

now I have the data I can do anything I want with it

play04:12

for example

play04:12

there is another open api to

play04:13

get creator id

play04:15

then we can use the creator id

play04:17

and get the video analytics of that creator

play04:19

to analyze

play04:19

so we can make a

play04:21

video analytics platform for Bilibili creators

play04:23

umm that's actually a pretty good idea

play04:25

another example is that we can use a chart library

play04:27

to visualize these data

play04:29

then I will have a personalized

play04:31

Bilibili video analytics tool

play04:33

I'll find out the secret to the algorithm

play04:34

it seems like I will be closer to 100k now

play04:37

I was going to do that

play04:38

but then I researched a bit

play04:39

and find that there are so many different python chart libraries

play04:42

to avoid making this video too long

play04:43

let me know if you are interested in

play04:45

another episode

play04:46

of python chart library comparison

play04:48

I can't help to write the same script using node.js for comparison

play04:52

since it's the language I'm familiar with

play04:55

it only took 10 min

play04:56

now let's compare them

play04:57

I'm not sure if

play04:58

I made any mistake

play04:59

for the same

play05:00

node is much faster in returning data

play05:04

but the code amount is the same

play05:07

it's about 50 lines

play05:09

in terms of the file size

play05:12

python scripts are much

play05:13

light weight than a node project

play05:14

of course

play05:15

these are all based on a beginner's perspective

play05:17

it's not a tutorial

play05:19

in summary

play05:19

I think python is actually a

play05:21

good option for beginners

play05:23

although it's slower

play05:24

it's easy and light weight

play05:26

it allows you to get a feel of programming in a short amount of time

play05:29

before you run out of interest

play05:31

besides crawler and data visualization

play05:32

python is also used for writing tests, office automation

play05:35

data science, etc

play05:36

further more, it can also use for backend development

play05:38

machine learning and much more

play05:39

but don't expect to get into these fields after you learned the language

play05:41

like web frontend development, you will need to learn the framework

play05:44

it takes time to master in these areas

play05:46

and accumulate project experience

play05:47

formal education is required in some circumstances

play05:49

long story short

play05:49

it's not something you can

play05:51

go from zero experience to getting a job in a few days

play05:52

if you are interested in backend development with python

play05:55

I don't think it's a good fit

play05:57

because there aren't that many companies just use python for their backend

play05:59

for what I knew

play06:00

like the big tech companies I mentioned before

play06:02

they are only using python for part of their stack

play06:05

if your goal is to get a job

play06:06

I think it's a good idea to research

play06:08

whether there are python jobs are out there in your area

play06:10

and what you personally wants to get into

play06:12

python is great as a second programming language

play06:14

especially for people who work in tech

play06:16

some simple application of python

play06:18

like data analysis

play06:19

coding some productivity tools

play06:20

it will help

play06:21

in your day to day work or life

play06:23

when I was interviewing interns in my previous company

play06:26

in their resume

play06:26

they like to include

play06:28

data analysis in the skill section

play06:29

even though they are not interviewing a programming or

play06:31

business analysis position

play06:33

this skill is great for interviewing

play06:34

a variety of positions

play06:35

it will be a big plus

play06:37

ok that would be all I want to share today

play06:40

I'm happy to check off another of my new year's resolution

play06:42

thank you for watching

play06:43

see you next time

play06:44

bye bye