Santiago Profile picture
31 Dec 20, 9 tweets, 2 min read
For a long time, I didn't understand how to use Virtual Environments in Python 🐍.

If this is just, let's end it here and now: πŸ§΅πŸ‘‡
[2] Virtual Environments let you deal with the dependencies that your code has with external Python libraries.

It avoids having conflicts when your projects depend on different versions of the same library.

πŸ‘‡
[3] Let's imagine that you are building your first Python project and you install the "requests" library:

pip install requests

You get version 2.24.0 installed in your system.

πŸ‘‡
[4] A month later, you decide to work on your second project. It also needs the "requests" library.

But the latest version is not 2.24.0 anymore.

Now version 3 is available, and that's the one you want to use!

πŸ‘‡
[5] You could upgrade your entire system to version 3, but then you'll be potentially breaking the first project you built that depends on 2.24.0!

Can you imagine this happening on a server with many more applications running?

πŸ‘‡
[6] Virtual environments solve this problem.

The first step for every new project is to create a virtual environment for it.

Some people have a central location where they store all environments. I prefer to keep them inside the project folder.

πŸ‘‡
[7] You can create a new virtual environment with Python 3 using the following command:

python3 -m venv .myvenv

Then, you can use "source" to activate the environment.

At this point, you'll have full isolation for your project.

πŸ‘‡
[8] If you install any libraries within a virtual environment, they will never mess with the libraries installed at the system level or other virtual environments.

And this is great!

Here is a @realpython's article covering virtual environments: realpython.com/python-virtual…
[9] The built-in "venv" module is not the only way to create virtual environments. Here are other options:

- conda
- pipenv
- virtualenv

What's your choice?

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Santiago

Santiago Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @svpino

28 Dec 20
I told everyone that I didn't care.

"Screw math! I've never been great with it, so I'm not starting with machine learning to fail at the end."

That was many years ago.

Math is still hard, but I don't think you should be scared at all. Here is why: πŸ§΅πŸ‘‡
[1] One thing changed my mind: school pushed me to the deep end of the pool, and I was forced to swim.

I had to face my fears, and I started machine learning and realized that the math involved is not as scary (or as much) as some people believe.

πŸ‘‡
[2] Probably one of the most frequent questions I get is around the math needed for machine learning.

Answer:

▫️ Probabilities and Statistics
▫️ Linear Algebra
▫️ Calculus

But it turns out that this is not helpful.

πŸ‘‡
Read 18 tweets
27 Dec 20
I've worked with Dell, HP, IBM, Cisco, HSBC, Disney, G4S, among other large companies.

Don't think for a minute that they have things figured out.

They have amazing development teams. They also have mediocre and straight-horrible teams.

πŸ§΅πŸ‘‡
[2] In my experience, smaller companies tend to be more selective when hiring: they can't afford to make a mistake.

I've found out that these smaller companies build consistently decent teams. (Although they have a harder time hiring talent.)

πŸ‘‡
[3] Larger companies, on the other hand, build teams across many different departments. Maintaining consistency is hard, if not impossible.

I met excellent teams: sharp, organized, building excellent products using state-of-the-art technology.

πŸ‘‡
Read 6 tweets
27 Dec 20
An introduction to one of the the most basic structures used in machine learning: a tensor.

πŸ§΅πŸ‘‡
Tensors are the data structure used by machine learning systems, and getting to know them is an essential skill you should build early on.

A tensor is a container for numerical data. It is the way we store the information that we'll use within our system.

(2 / 16)
Three primary attributes define a tensor:

▫️ Its rank
▫️ Its shape
▫️ Its data type

(3 / 16)
Read 16 tweets
26 Dec 20
11 key concepts of Machine Learning.

β€” Supervised Learning Edition β€”

πŸ§΅πŸ‘‡
😜

Before starting, remember that, if you follow me, one of your enemies will be immediately destroyed (and you'll get to read more of these threads, of course.)

And if you don't follow me, well, you just hurt my feelings.

😜
1. Labels

(Also referred to as "y")

The label is the piece of information that we are predicting.

For example:

- the animal that's shown in a picture
- the price of a house
- whether a message is spam or not

πŸ‘‡
Read 13 tweets
22 Dec 20
The 8-step quick-start guide to learn Machine Learning.

πŸ§΅πŸ‘‡
1⃣ Start with Python 🐍

Yes, you can do other languages, but Python is by far the most straightforward option.

πŸ‘‡
2⃣ Get familiar with numpy, pandas, and matplotlib

These three libraries are probably the most common Python libraries you'll have to use every day.

(Even if you don't end up doing machine learning, these libraries are awesome and useful.)

πŸ‘‡
Read 10 tweets
21 Dec 20
Rumors are going around that Twitter cripples tweets that include links.

There's nothing in their official documentation, but a lot of people think that's the case.

I thought this through, and I will not play along.

πŸ§΅πŸ‘‡
Allegedly, if I disable the links, my tweets will get much more impressions because Twitter will push them to more people.

Assuming this is the case, what's the cost?

My followers will have to start copying, then pasting any links that I post.

(2 / 4)
Seems like a small nuance, but reading comments on tweets with disabled links, the process is very error-prone and a lot of people have trouble accessing the content.

This is not what I want.

(3 / 4)
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!