How to Fix a Low-Contrast Gray-Scale Image using Histogram Equalization in Python

This video will help you to fix your low-contrast gray scale image using histogram equalization in simplest and easiest way. This program is written in python.

Link to the Histogram Computation Video: ()

Link to the complete code: ()

Music:

Read more

How to use Python to expose politicians

Rafael Garcia-Dias

This talk presents a project that uses an API of the Brazilian government to retrieve data from congresspeople and expose how they are spending people’s money. I use Pandas to manipulate the data and, Lektor and Chart.JS to create a website that makes this data accessible and comprehensible.

This talk presents the basic concepts of data treatment and manipulation. It presents a quick introduction to Lektor, a framework to build static websites in pure Python (and, a little bit of markdown and HTML). I also make a brief presentation of the project Serenata de Amor, which I use to retrieve the data of Brazilian congresspeople. I talk about Pandas_profiling, Pandas, and chart.js, giving very simple examples of how they can be used to produce nice data visualization.

This talk is especially interesting for those that want to build a simple static website and don’t want to deal with javascript frameworks like Hugo. It is also interesting for people that are interested in data science and anybody that is thinking about how to use their skills to impact politics.

Read more

How to make an AI read your handwriting (LAB) : Crash Course Ai #5

Follow along:
John Green Bot wrote his first novel! Today, in our first ever Lab we’re going to program a neural network to recognize handwritten letters to convert the first part of John Green Bot’s novel into typed text. To do this we’re going to import a labeled dataset, called EMNIST, we’ll to use a pre-written library called SKLearn to build the network, we’ll train and tweak our code until it’s accurate (enough), and then we’ll use our newly trained network to convert John Green Bot’s handwritten pages.

We created this project in a way that you don’t have to install anything on your computer, the only thing you’ll need to get started is a Google account and a sense of adventure! To run the Colaboratory file (link at the top) you’ll have to click “open in playground” at the top of the page OR open the File Menu and click “Save a Copy to Drive.” From there you can change, tweak, and edit the code as you wish. We also left text around and within the code to help you along the way. If you use this code in your own project let us know in the comments!

If you want the raw data we used for the project you can download our files from GitHub here:

EMNIST paper:

Crash Course AI is produced in association with PBS Digital Studios

#CrashCourse #ArtificialIntelligence #MachineLearning

Crash Course is on Patreon! You can support us directly by signing up at

Thanks to the following patrons for their generous monthly contributions that help keep Crash Course free for everyone forever:

Eric Prestemon, Sam Buck, Mark Brouwer, Indika Siriwardena, Avi Yashchin, Timothy J Kwist, Brian Thomas Gossett, Haixiang N/A Liu, Jonathan Zbikowski, Siobhan Sabino, Zach Van Stanley, Jennifer Killen, Nathan Catchings, Brandon Westmoreland, dorsey, Kenneth F Penttinen, Trevin Beattie, Erika & Alexa Saur, Justin Zingsheim, Jessica Wode, Tom Trval, Jason Saslow, Nathan Taylor, Khaled El Shalakany, SR Foxley, Yasenia Cruz, Eric Koslow, Caleb Weeks, Tim Curwick, David Noe, Shawn Arnold, Andrei Krishkevich, Rachel Bright, Jirat, Ian Dundore

Want to find Crash Course elsewhere on the internet?
Facebook –
Twitter –
Tumblr –
Support Crash Course on Patreon:

CC Kids:

Read more

NPTEL | Programming, Data Structures And Algorithms Using Python |Programming Assignment Week 3 |

WEBSITE:- https://easycodesol.herokuapp.com/

Write three Python functions as specified below. Paste the text for all three functions together into the submission window. Your function will be called automatically with various inputs and should return values as specified. Do not write commands to read any input or print any output.

You may define additional auxiliary functions as needed.
In all cases you may assume that the value passed to the function is of the expected type, so your function does not have to check for malformed inputs.
For each function, there are normally some public test cases and some (hidden) private test cases.
“Compile and run” will evaluate your submission against the public test cases.
“Submit” will evaluate your submission against the hidden private test cases. There are 10 private test cases, with equal weightage. You will not get any feedback about which private test cases pass or fail.
Ignore warnings about “Presentation errors”.
Write a function expanding(l) that takes as input a list of integer l and returns True if the absolute difference between each adjacent pair of elements strictly increases.

Here are some examples of how your function should work.

expanding([1,3,7,2,9])
True
Explanation: Differences between adjacent elements are 3-1 = 2, 7-3 = 4, 7-2 = 5, 9-2 = 7.

expanding([1,3,7,2,-3])
False
Explanation: Differences between adjacent elements are 3-1 = 2, 7-3 = 4, 7-2 = 5, 2-(-3) = 5, so not strictly increasing.

expanding([1,3,7,10])
False
Explanation: Differences between adjacent elements are 3-1 = 2, 7-3 = 4, 10-7 = 3, so not (strictly) increasing.

Write a function accordian(l) that takes as input a list of integer l and returns True if the absolute difference between each adjacent pair of elements alternates between increasing strictly and decreasing strictly.

Here are some examples of how your function should work.

accordian([1,5,1])
False
Explanation: Differences between adjacent elements are 5-1 = 4, 5-1 = 4, which are equal.

accordian([1,5,2,8,3])
True
Explanation: Differences between adjacent elements are 5-1 = 4, 5-2 = 3, 8-2 = 6, 8-3 = 5, so the differences decrease, increase and then decrease.

accordian([-2,1,5,2,8,3])
True
Explanation: Differences between adjacent elements are 1-(-2) = 3, 5-1 = 4, 5-2 = 3, 8-2 = 6, 8-3 = 5, so the differences increase, decrease, increase and then decrease.

accordian([1,5,2,8,1])
False
Explanation: Differences between adjacent elements are 1-(-2) = 3, 5-1 = 4, 5-2 = 3, 8-2 = 6, 8-1 = 7, so the differences increase, decrease, increase and then increase again.

A square n×n matrix of integers can be written in Python as a list with n elements, where each element is in turn a list of n integers, representing a row of the matrix. For instance, the matrix

1 2 3
4 5 6
7 8 9
would be represented as [[1,2,3], [4,5,6], [7,8,9]].

Write a function rotate(m) that takes a list representation m of a square matrix as input, and returns the matrix obtained by rotating the original matrix clockwise by 90 degrees. For instance, if we rotate the matrix above, we get

7 4 1
8 5 2
9 6 3
Your function should not modify the argument m provided to the function rotate().

Here are some examples of how your function should work.

rotate([[1,2],[3,4]])
[[3, 1], [4, 2]]
Explanation:

1 2 becomes 3 1
3 4 4 2

rotate([[1,2,3],[4,5,6],[7,8,9]])
[[7, 4, 1], [8, 5, 2], [9, 6, 3]]
Explanation:

1 2 3 becomes 7 4 1
4 5 6 8 5 2
7 8 9 9 6 3

rotate([[1,1,1],[2,2,2],[3,3,3]])
[[3, 2, 1], [3, 2, 1], [3, 2, 1]]
Explanation:

1 1 1 becomes 3 2 1
2 2 2 3 2 1
3 3 3 3 2 1

Read more
Loading...