Forwarded from Python Questions
# Python Code to copy to Windows Clipboard
Code#python #CodeSamples
import win32clipboard
# set clipboard data
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText('testing 123')
win32clipboard.CloseClipboard()
# get clipboard data
win32clipboard.OpenClipboard()
data = win32clipboard.GetClipboardData()
win32clipboard.CloseClipboard()
print data
Forwarded from Python Questions
print('KLM'.maketrans('KLM', '123'))
What is the output? Explain the function maketrans()
What is the output? Explain the function maketrans()
Anonymous Quiz
11%
{65: 49, 66: 50, 67: 51}
26%
{75: 49, 76: 50, 77: 51}
14%
{75: 49, 66: 50, 77: 51}
17%
None of the above
31%
Show me the answer
Check if the file is empty or not
#python #CodeSamples
import os
file_path = 'mysample.txt'
# check if size of file is 0
if os.stat(file_path).st_size == 0:
print('File is empty')
else:
print('File is not empty')
#python #CodeSamples
Forwarded from Python Questions
print('iGnani'.translate({'i': '1', 'G': '2', 'n': '3', 'a': '4', 'i': '5'}))
#What is the output. Explain translate()
#What is the output. Explain translate()
Anonymous Quiz
39%
123435
20%
12345
16%
iGnani
9%
Error
5%
None of the above
12%
Show me the answer
The while Loop
#python #CodeSamples
while <expr>:
<statement(s)>
<break> #will take you out of the loop
<statements>
<continue>
<statements>
<statements> #break will bring you here
Example:
x = 10
while x > 0:
x -= 1
if x == 5:
break
if x == 8:
continue #Don't print when its 8
print(x)
print("outside loop")
#python #CodeSamples
Forwarded from Python Questions
Class accepting List as argument in init()
#python #CodeSamples
class myclass:
def __init__(self, mylst = []):
print(mylst)
names = ["hello", "python", "devs", "iGnani"]
myclass(names)
#python #CodeSamples
machine-learning-cheat-sheet.pdf
1.9 MB
Machine Learning Cheat Sheet
Classical equations, diagrams and tricks in machine learning
#eBook #ML #machineLearning #DataScience #AI #DataMining #DeepLearning #Algorithms #AppliedMathematics
Classical equations, diagrams and tricks in machine learning
This cheat sheet is a condensed version of machine learning manual, which contains many classical equations and
diagrams on machine learning, and aims to help you quickly recall knowledge and ideas in machine learning.
#eBook #ML #machineLearning #DataScience #AI #DataMining #DeepLearning #Algorithms #AppliedMathematics
Pandas SQL Example - Reproducing SQL Queries In Python
https://youtu.be/m1jHkL0qZsI
In this video on reproducing SQL queries in Python using Pandas library, I am going to show you Pandas SQL examples on how to write pandas code reproducing sql statements.
Using pandas, i will show you how to get sql results in python like
* grouping and aggregation on multiple columns in pandas, similar to sql groupby clause
* sorting by multiple columns, reproducing sql order by clause
* filter multiple conditions, which involves where conditions with multiple columns
and a lot more...
https://youtu.be/m1jHkL0qZsI
YouTube
Pandas SQL Example - Reproducing SQL Queries In Python
In this video on reproducing SQL queries in Python using Pandas library, I am going to show you Pandas SQL Example on how to write pandas sql statements.
Using pandas, i will show you how to get sql results in python like
* pandas grouping and aggregation…
Using pandas, i will show you how to get sql results in python like
* pandas grouping and aggregation…
Connecting to Amazon Redshift database and Inserting data
#python #sampleCode #amazon #redshift
import psycopg2
con=psycopg2.connect(dbname= 'dbname', host='host', port= 'port', user= 'user', password= 'pwd')
#once the above code executes and connection is established
# create a cursor
cur = con.cursor()
#now you can execute select statements
cur.execute("SELECT * FROM employee;")
#Next you need to instruct Psycopg how to fetch your data
cur.fetchall()
#Finally, don't forget to close your cursor & connection
cur.close()
conn.close()
#python #sampleCode #amazon #redshift
»»» Interactive Tools and Lessons «««
👉🏻 Computer Science Circles
👉🏻 How to Think Like a Computer Scientist, Interactive Edition
👉🏻 Interactive tutorials for scientific programming using Python
👉🏻 Problem Solving with Algorithms and Data Structures using Python
👉🏻 Thonny, Python IDE for begginners
#tools #lessons #python
👉🏻 Computer Science Circles
👉🏻 How to Think Like a Computer Scientist, Interactive Edition
👉🏻 Interactive tutorials for scientific programming using Python
👉🏻 Problem Solving with Algorithms and Data Structures using Python
👉🏻 Thonny, Python IDE for begginners
#tools #lessons #python
Python for Beginners -
From Microsoft
Even though this course won’t cover everything there is to know about Python, it surely gives you the foundation on programming in Python, starting from common everyday code and scenarios. At the end of the course, you’ll be able to go and learn on your own, for example with docs, tutorials, or books.
#tutorial
From Microsoft
Even though this course won’t cover everything there is to know about Python, it surely gives you the foundation on programming in Python, starting from common everyday code and scenarios. At the end of the course, you’ll be able to go and learn on your own, for example with docs, tutorials, or books.
#tutorial
Forwarded from Python Questions
```
print('The sum of {0} and {1} is {2}'.format(5, 10, 15)) ``` What is the output?
print('The sum of {0} and {1} is {2}'.format(5, 10, 15)) ``` What is the output?
Anonymous Quiz
7%
The sum of 0 and 1 is 2
51%
The sum of 5 and 10 is 15
12%
The sum of {0} and {1} is {2}
17%
Syntax Error
3%
None of the above
10%
Show me the answer
Python Data Science Handbook - Binder Colab
This repository contains the entire Python Data Science Handbook, in the form of (free!) Jupyter notebooks.
#python #ebook #jupyter #notebook
This repository contains the entire Python Data Science Handbook, in the form of (free!) Jupyter notebooks.
#python #ebook #jupyter #notebook
O’Reilly Online Learning
Python Data Science Handbook
For many researchers, Python is a first-class tool mainly because of its libraries for storing, manipulating, and gaining insight from data. Several resources exist for individual... - Selection from Python Data Science Handbook [Book]
Web Scraping Tutorials
👉🏻 Intro To Web Scraping With Python
👉🏻 Intro to Web Scraping with Python and Beautiful Soup
👉🏻 Beautiful Soup Tutorial - Web Scraping in Python
👉🏻 Web Scraping With Python - Edureka
👉🏻 Web Scraping With Python using Beautiful Soup & Requests
#python #tutorial #webScraping #BeautifulSoup
👉🏻 Intro To Web Scraping With Python
👉🏻 Intro to Web Scraping with Python and Beautiful Soup
👉🏻 Beautiful Soup Tutorial - Web Scraping in Python
👉🏻 Web Scraping With Python - Edureka
👉🏻 Web Scraping With Python using Beautiful Soup & Requests
#python #tutorial #webScraping #BeautifulSoup
YouTube
Intro To Web Scraping With Python
In this video we will look at web scraping using Python and the BeautifulSoup library. This is an introductory level tutorial. All beginners welcome
Final Code Gist:
https://gist.github.com/bradtraversy/f2014a236646ff62dccfc9fe5d469ed5
💖 Become a Patron:…
Final Code Gist:
https://gist.github.com/bradtraversy/f2014a236646ff62dccfc9fe5d469ed5
💖 Become a Patron:…
🌟
An Introduction to Machine Learning by Miroslav Kubat
FREE ebook on Machine Learning
https://link.springer.com/book/10.1007%2F978-3-319-63913-0
#machineLearning #DataScience #eBook
An Introduction to Machine Learning by Miroslav Kubat
FREE ebook on Machine Learning
An introduction to machine learning book will get you started with various data science techniques such as decision trees, performance evaluation, among others. It also covers sub-categories such as unsupervised learning, reinforcement learning, and neural networks. Learners can obtain a detailed understanding of various classifiers and algorithms from 17 chapters, thereby making it a good read during the lockdown.
https://link.springer.com/book/10.1007%2F978-3-319-63913-0
#machineLearning #DataScience #eBook
🌟
All of Statistics by Larry Wasserman
A Concise Course in Statistical Inference
FREE ebook on Statistics for Machine Learning
https://link.springer.com/content/pdf/10.1007%2F978-0-387-21736-9.pdf
#machineLearning #DataScience #eBook #statistics
All of Statistics by Larry Wasserman
A Concise Course in Statistical Inference
FREE ebook on Statistics for Machine Learning
A proper grasp of statistics is essential for any machine learning enthusiast to succeed in the competitive domain. Consequently, one should focus more on statistics than on the latest fancy techniques. The book — All of Statistics — consists of 24 chapters and covers every topic right from probability to statistical inference and statistical models and methods.
https://link.springer.com/content/pdf/10.1007%2F978-0-387-21736-9.pdf
#machineLearning #DataScience #eBook #statistics