Discover and read the best of Twitter Threads about #pythoncode

Most recents (13)

2/16

"roc_auc_score" is defined as the area under the ROC curve, which is the curve having False Positive Rate on the x-axis and True Positive Rate on the y-axis at all classification thresholds.

#DataScience #MachineLearning #DeepLearning #100DaysOfMLCode #Python
Read 17 tweets
How to Create Small Multiple Charts in Python, with Plotly

🧵[1/23]

sharpsightlabs.com/blog/plotly-sm…

#python #datascience #pythoncode #datavisualization
[2/]

Before I get into the mechanics of how to create a small multiple charts in Python, let me quickly explain why they are so important.
[3/]

Small multiple charts are one of my favorite chart types.

They are very powerful, and also highly under-used.

#datascience #dataanalytics #datavisualization
Read 23 tweets
In Python ...

You can combine Numpy arrays vertically or horizontally using np.concatenate

#Python #pythoncode #datascience
The first argument to the function is a list (or collection) of arrays that you want to combine.

You can actually combine many arrays ...just put them inside the list.
The axis parameter controls the direction along which you combine the arrays.

For 2D arrays ...

'axis = 0' combines vertically
'axis = 1' combines horizontally
Read 6 tweets
In Matplotlib ...

You can get the RGBA representation of a color with the to_rgba() function.

#Python #pythoncode #datavisualization
You'll notice that the output of to_rgba is a tuple with four floats: (%red, %green, %blue, alpha)

#Python
In RGBA, the alpha channel represents the opacity of the color, where:

– 0.0 is fully transparent
– 1.0 is fully opaque
Read 4 tweets
In Python, you can visualize images with the Plotly IMshow function.

🧵[1/8]

sharpsightlabs.com/blog/plotly-im…

#Python #pythonlearning #datascience #datavisualization
[2/8]

You can use Plotly IMshow for a few uses.

You can use it to plot heatmaps ...

But you can also use it to plot images.
[3/8]

The syntax for Plotly IMshow is pretty simple.

You call the function as px.imshow and then provide the name of the image file you want to visualize.

(This assumes you've imported Plotly express as px)

#Python #pythoncode Image
Read 8 tweets
In Python ...

You can use the Pandas dropna method to drop rows with missing values.

#Python #pythoncode #datascience ImageImageImageImage
As seen above, you can limit dropna to specific columns with the 'subset=' parameter.

With 'subset=', you can specify the columns in which dropna will look for missing values

#Python #pythonlearning #datascience
If it finds missing values in any of those columns, it will drop the row.

But it will ignore missing values in other columns.
Read 6 tweets
In Python ...

You can use Numpy all to test conditions about the properties of a Numpy array.

#Python #pythoncode #datascience ImageImageImageImage
☝️

So for instance, in the example above, I test if all of the values are greater than 2, by column.

#Python
To do this, you need to know how np.all works ...

But you also need to know how to use axes.

#Python #pythonlearning
Read 5 tweets
2/n
Types of magic commands

Line magics - starts with % character. Rest of the line is its argument passed without parentheses or quotes.

Cell magics - %% - can operate on multiple lines below their call.
#DataScience #MachineLearning #100DaysOfMLCode #Python #DataScientist
Read 21 tweets
Image interpolation occurs when you resize or distort your image from one pixel grid to another.

1/n

#computervision #IMAGE #DataScience #MachineLearning #DeepLearning #100DaysOfMLCode #Python #programming #Math #Stat #dataviz #DataAnalytics #AI #ArtificialIntelligence #data
Image interpolation works in two directions, and tries to achieve a best approximation of a pixel's intensity based on the values at surrounding pixels.

2/n

#computervision #IMAGE #DataScience #MachineLearning #DeepLearning #100DaysOfMLCode #Python #programming #Math #Stat
Image resizing is necessary when you need to increase or decrease the total number of pixels, whereas remapping can occur when you are correcting for lens distortion or rotating an image.

3/n
#computervision #DataScience #MachineLearning #DeepLearning #100DaysOfMLCode #Python
Read 8 tweets
#Learn 🧠🐍#python: Sometimes when programming in python they're situations when you want to copy the contents of an existing list into another. Python has several ways of achieving that. In this thread you will learn different ways of achieving that with the help of examples. Image
1) Using the equal (=) sign operator:
Using = operator you can copy the contents of an existing list onto another/new list. But there's a problem with this method which I will explain on the next section. Image
The problem with the above method is that if you modify the new copied_fruits list the original list (fruits) is modified too, this is because the copied list (copied_fruits) is referencing/ pointing to same fruits list in memory.
Read 17 tweets

Related hashtags

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.00/month or $30.00/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!