SlideShare a Scribd company logo
#GetConnected with
Jan Kroon
Hogeschool Rotterdam
Workshop 1
–Steve Jobs
"Computers are like a bicycle for our minds."
https://www.youtube.com/watch?v=ob_GX50Za6c
Computer Programming
• Programming: to build a machine that does your work
• Whenever you enter a search term in Google, you are
programming Google to search for you …
• but if you need to think about AND and/or OR and "grouping of
search terms" most people give up.
• A computer is a general purpose machine: a calculator,
a word processor, a drawing machine, a search
machine, a remember machine, an analytics machine, an information
machine, a communications machine, a game machine, a navigation machine, a music
machine, a video machine, a design machine …
• If you learn how to program you can build these (and
many other) machines!
Programming Languages
Expressive Power:
1 line of code in Python, Perl, R or Ruby
3 lines of code in C++, C# or Java
10 lines of code in C
50-100 lines of code in Machine Language or
Assembler
Python 3.4.0
In this workshop you will learn to write Python One Liners!
Guido van Rossum
Benevolent Dictator For Life
Object Oriëntation
'Edwin Jansen' is a 'Plumber'
'Edwin Jansen' has properties:
• edwinJansen.phoneNumber
• edwinJansen.available
'Edwin Jansen' has skills to do things:
• edwinJansen.fixTap()
• edwinJansen.repairRoof()
>>> import plumber and let a
plumber do the work!
Object Class
Methods
(verbs)
Properties
(nouns)
Everything is an object!
• Whole Numbers: int
• Broken numbers: float
• Text: str
• User Interface Elements: Windows, Buttons,
Sliders, TextFields, ImageViews, MapViews.
• Containers: list, dict, tuple, …
Assignment 0
Install Python on your laptop (use Google to look
for Python / IDLE download)
IDLE Integrated
DeveLopment Environment
Programmer's Workbench
Console
"Python chat"
Editor
"Python email"
Run menu
Run Module
Syntax Colour
Code?
Happy Coding!
print("Hello World")
help()
help(print)
type("Hello World")
IDLE
dir()
Assignment 1
Write your first computer program, a classic:
>>> print("Hello World")
Assignment 2
Introduce yourself:
>>> myName = "…"
>>> print("Hello", myName)
New Object!
Assignment 3
Introduce your group:
>>> ourGroup = ["Komala Mazerant", …]
and say hello to everyone (except yourself!)
Iteration (Looping)
>>> for student in ourGroup:
print("Hello", student)
Condition (Skipping)
… == … means 'is equal to'
… != … means 'is not equal to'
>>> for student in ourGroup:
if student != myName:
print("Hello", student)
Assignment 4
Find out the class of the objects you created:
>>> type(…)
find out their size (length)
>>> len(…)
and find out what you can do with these objects
>>> dir(…)
and if you want detailed information use
>>> help(…)
Dynamic Typing
Try this:
>>> aNumber = 747
>>> aNumber + aNumber
>>> sameNumber = str(aNumber)
>>> sameNumber + sameNumber
>>> anotherNumber = int(sameNumber)
>>> anotherNumber + anotherNumber
What is going on here???
Juggle with types
Make a 'class list' object from a 'class string' object:
>>> aQuote = "Computers are like a bicycle for our
minds"
>>> quoteWords = aQuote.split()
and turn the words back into a sentence"
>>> aSentence = ""
>>> for word in quoteWords:
aSentence = aSentence + " " + word
Assignment 5
Copy the contents of theJungle in an object:
>>> theJungle = "…"
A. Is there a lion in the jungle?
B. Where do you encounter the first tiger?
C. How many trees in the jungle?
Selection (Slicing)
>>> aStudent = ourGroup[1]
>>> someStudents = ourGroup[2:5]
>>> lastStudent = ourGroup[-1]
Assignment 6
Find palindromes in 'words' list:
>>> words = […]
Big Data
Assignment 7
Browse to: https://twitter.com/search-advanced
A. How many tweets today in Rotterdam?
B. Any tweets with tag #GetConnected?
C. What is last tweet from @BarackObama
D. More positive or more negative tweets last week
about @BarackObama?
Analytics
1. Collect Data
2. Clean Data
3. Wrangle, Merge, Aggregate
4. Visualize, Summarize Data
5. Interpret, Develop Insights
6. Act!
Collect Data
>>> from urllib import request
>>> twitterHandle = request.urlopen("http://
twitter.com")
>>> twitterData = twitterHandle.read()
>>> twitterText = str(twitterData)
>>> twitterText[0:500]
>>> len(twitterText)
Assignment 8
Copy the contents of aBusinessCard and someBusinessCards in
two objects:
>>> aBusinessCard = […]
>>> someBusinessCards = […]
A. How can you recognize a phone number or an email address in
aBusinessCard
B. Print a list of names extracted from someBusinessCards
C. Print a list of email addresses extracted from someBusinessCards
Assignment 9
Copy the contents of tweets in an object:
>>> tweets = […]
A. How many tweets?
B. How many from Rotterdam?
C. Who has sent tweets with hashtag
#GetConnected?
Assignment 10
Copy the contents of twitterFollowers in an object:
>>> tf = "…"
A. Is there overlap in the followers of
@KomalaDubois and @jankroon?
B. What would be the possibilities if you would
know all followers of all people on Twitter?
Algorithms
• Dictionary attack to break password protection
• Harvesting email addresses for spamming
• Recommendations: "People who rented this movie
also rented …"
• Segmentation: clustering people that are similar in
some respect
• Outlier detection: discover exceptional behavior, i.e.
to prevent credit card fraud
Visualize Data
Our eyes are extremely good at finding patterns
• Mathematical Graphs
• Statistical Diagrams
• Maps
• Timelines
• Network Graphs
Ice Bucket Challenge
https://srogers.cartodb.com/viz/89e638ac-2a2c-11e4-9cb7-0e73339ffa50/embed_map
10.000 hours of practice
Malcom Gladwell states in his book 'Outliers' that
you need to practice for at least 10.000 hours in
order to master a specific skill.
8 hours/day * 7 days/week * 52 weeks/year * 3,5 year =
10192 uur
0,1%
Backup Slides
{
"coordinates": null,
"created_at": "Thu Oct 21 16:02:46 +0000 2010",
"favorited": false,
"truncated": false,
"id_str": "28039652140",
"entities": {
"urls": [
{
"expanded_url": null,
"url": "http://gnip.com/success_stories",
"indices": [
69,
100
]
}
],
"hashtags": [
 
],
"user_mentions": [
{
"name": "Gnip, Inc.",
"id_str": "16958875",
"id": 16958875,
"indices": [
25,
30
],
"screen_name": "gnip"
}
]
},
"in_reply_to_user_id_str": null,
"text": "what we've been up to at @gnip -- delivering data to happy customers http://gnip.com/success_stories",
"contributors": null,
"id": 28039652140,
"retweet_count": null,
"in_reply_to_status_id_str": null,
"geo": null,
"retweeted": false,
"in_reply_to_user_id": null,
"user": {
"profile_sidebar_border_color": "C0DEED",
"name": "Gnip, Inc.",
"profile_sidebar_fill_color": "DDEEF6",
"profile_background_tile": false,
"profile_image_url": "http://a3.twimg.com/profile_images/62803643/icon_normal.png",
"location": "Boulder, CO",
"created_at": "Fri Oct 24 23:22:09 +0000 2008",
"id_str": "16958875",
"follow_request_sent": false,
"profile_link_color": "0084B4",
"favourites_count": 1,
"url": "http://blog.gnip.com",
"contributors_enabled": false,
"utc_offset": -25200,
"id": 16958875,
"profile_use_background_image": true,
"listed_count": 23,
"protected": false,
"lang": "en",
"profile_text_color": "333333",
"followers_count": 260,
"time_zone": "Mountain Time (US & Canada)",
"verified": false,
"geo_enabled": true,
"profile_background_color": "C0DEED",
"notifications": false,

More Related Content

Viewers also liked

Paradigm shifts #4
Paradigm shifts #4Paradigm shifts #4
Paradigm shifts #4
Jan Kroon
 
Los lugares
Los lugaresLos lugares
Los lugares
kishwarivan
 
The exploration of cork
The exploration of corkThe exploration of cork
The exploration of cork
luisamiguel
 
Halloween2
Halloween2Halloween2
Halloween2
luisamiguel
 
Shellfish
ShellfishShellfish
Shellfish
luisamiguel
 
Shellfish
ShellfishShellfish
Shellfish
luisamiguel
 
Jn wp wpp2012
Jn wp wpp2012Jn wp wpp2012
Jn wp wpp2012
winpoweryourteam
 
Cvpw
CvpwCvpw
Jn wp wcpn2012
Jn wp wcpn2012Jn wp wcpn2012
Jn wp wcpn2012
winpoweryourteam
 
Jn wp wpd2012
Jn wp wpd2012Jn wp wpd2012
Jn wp wpd2012
winpoweryourteam
 

Viewers also liked (11)

Paradigm shifts #4
Paradigm shifts #4Paradigm shifts #4
Paradigm shifts #4
 
Los lugares
Los lugaresLos lugares
Los lugares
 
The exploration of cork
The exploration of corkThe exploration of cork
The exploration of cork
 
Halloween2
Halloween2Halloween2
Halloween2
 
Shellfish
ShellfishShellfish
Shellfish
 
Shellfish
ShellfishShellfish
Shellfish
 
Jn wp wpp2012
Jn wp wpp2012Jn wp wpp2012
Jn wp wpp2012
 
Cvpw
CvpwCvpw
Cvpw
 
Jn wp wyt2012
Jn wp wyt2012Jn wp wyt2012
Jn wp wyt2012
 
Jn wp wcpn2012
Jn wp wcpn2012Jn wp wcpn2012
Jn wp wcpn2012
 
Jn wp wpd2012
Jn wp wpd2012Jn wp wpd2012
Jn wp wpd2012
 

Similar to Get connected with python

Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
Gangeshwar Krishnamurthy
 
A Developer's Guide To Machine Learning
A Developer's Guide To Machine LearningA Developer's Guide To Machine Learning
A Developer's Guide To Machine Learning
Sefik Ilkin Serengil
 
Ig1 Mashups
Ig1   MashupsIg1   Mashups
Ig1 Mashups
IgniteChicago
 
The Data Janitor Returns | Daniel Molnar | DN18
The Data Janitor Returns | Daniel Molnar | DN18The Data Janitor Returns | Daniel Molnar | DN18
The Data Janitor Returns | Daniel Molnar | DN18
DataconomyGmbH
 
DN18 | The Data Janitor Returns | Daniel Molnar | Oberlo/Shopify
DN18 | The Data Janitor Returns | Daniel Molnar | Oberlo/Shopify DN18 | The Data Janitor Returns | Daniel Molnar | Oberlo/Shopify
DN18 | The Data Janitor Returns | Daniel Molnar | Oberlo/Shopify
Dataconomy Media
 
Evolving as a professional software developer
Evolving as a professional software developerEvolving as a professional software developer
Evolving as a professional software developer
Anton Kirillov
 
All of javascript
All of javascriptAll of javascript
All of javascript
Togakangaroo
 
Promises of Deep Learning
Promises of Deep LearningPromises of Deep Learning
Promises of Deep Learning
David Khosid
 
I don't know what I'm Doing: A newbie guide for Golang for DevOps
I don't know what I'm Doing: A newbie guide for Golang for DevOpsI don't know what I'm Doing: A newbie guide for Golang for DevOps
I don't know what I'm Doing: A newbie guide for Golang for DevOps
Peter Souter
 
Data Science with Spark - Training at SparkSummit (East)
Data Science with Spark - Training at SparkSummit (East)Data Science with Spark - Training at SparkSummit (East)
Data Science with Spark - Training at SparkSummit (East)
Krishna Sankar
 
OpenFest 2012 : Leveraging the public internet
OpenFest 2012 : Leveraging the public internetOpenFest 2012 : Leveraging the public internet
OpenFest 2012 : Leveraging the public internet
tkisason
 
Weaponizing Neural Networks. In your browser!
Weaponizing Neural Networks. In your browser!Weaponizing Neural Networks. In your browser!
Weaponizing Neural Networks. In your browser!
DefCamp
 
[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx
[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx
[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx
AhmedElbaloug
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
00_pytorch_and_deep_learning_fundamentals.pdf
00_pytorch_and_deep_learning_fundamentals.pdf00_pytorch_and_deep_learning_fundamentals.pdf
00_pytorch_and_deep_learning_fundamentals.pdf
eanyang7
 
Software Security : From school to reality and back!
Software Security : From school to reality and back!Software Security : From school to reality and back!
Software Security : From school to reality and back!
Peter Hlavaty
 
antrikshindutrialmachinelearningPPT.pptx
antrikshindutrialmachinelearningPPT.pptxantrikshindutrialmachinelearningPPT.pptx
antrikshindutrialmachinelearningPPT.pptx
AnkitMishra616883
 
An Introduction to Machine Learning
An Introduction to Machine LearningAn Introduction to Machine Learning
An Introduction to Machine Learning
Angelo Simone Scotto
 
Python and Oracle : allies for best of data management
Python and Oracle : allies for best of data managementPython and Oracle : allies for best of data management
Python and Oracle : allies for best of data management
Laurent Leturgez
 
Trip Report from Meeting C++ 2017: It's Way More Than C++
Trip Report from Meeting C++ 2017: It's Way More Than C++Trip Report from Meeting C++ 2017: It's Way More Than C++
Trip Report from Meeting C++ 2017: It's Way More Than C++
Andrey Upadyshev
 

Similar to Get connected with python (20)

Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 
A Developer's Guide To Machine Learning
A Developer's Guide To Machine LearningA Developer's Guide To Machine Learning
A Developer's Guide To Machine Learning
 
Ig1 Mashups
Ig1   MashupsIg1   Mashups
Ig1 Mashups
 
The Data Janitor Returns | Daniel Molnar | DN18
The Data Janitor Returns | Daniel Molnar | DN18The Data Janitor Returns | Daniel Molnar | DN18
The Data Janitor Returns | Daniel Molnar | DN18
 
DN18 | The Data Janitor Returns | Daniel Molnar | Oberlo/Shopify
DN18 | The Data Janitor Returns | Daniel Molnar | Oberlo/Shopify DN18 | The Data Janitor Returns | Daniel Molnar | Oberlo/Shopify
DN18 | The Data Janitor Returns | Daniel Molnar | Oberlo/Shopify
 
Evolving as a professional software developer
Evolving as a professional software developerEvolving as a professional software developer
Evolving as a professional software developer
 
All of javascript
All of javascriptAll of javascript
All of javascript
 
Promises of Deep Learning
Promises of Deep LearningPromises of Deep Learning
Promises of Deep Learning
 
I don't know what I'm Doing: A newbie guide for Golang for DevOps
I don't know what I'm Doing: A newbie guide for Golang for DevOpsI don't know what I'm Doing: A newbie guide for Golang for DevOps
I don't know what I'm Doing: A newbie guide for Golang for DevOps
 
Data Science with Spark - Training at SparkSummit (East)
Data Science with Spark - Training at SparkSummit (East)Data Science with Spark - Training at SparkSummit (East)
Data Science with Spark - Training at SparkSummit (East)
 
OpenFest 2012 : Leveraging the public internet
OpenFest 2012 : Leveraging the public internetOpenFest 2012 : Leveraging the public internet
OpenFest 2012 : Leveraging the public internet
 
Weaponizing Neural Networks. In your browser!
Weaponizing Neural Networks. In your browser!Weaponizing Neural Networks. In your browser!
Weaponizing Neural Networks. In your browser!
 
[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx
[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx
[GEMINI EXTERNAL DECK] Introduction to Gemini.pptx
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
00_pytorch_and_deep_learning_fundamentals.pdf
00_pytorch_and_deep_learning_fundamentals.pdf00_pytorch_and_deep_learning_fundamentals.pdf
00_pytorch_and_deep_learning_fundamentals.pdf
 
Software Security : From school to reality and back!
Software Security : From school to reality and back!Software Security : From school to reality and back!
Software Security : From school to reality and back!
 
antrikshindutrialmachinelearningPPT.pptx
antrikshindutrialmachinelearningPPT.pptxantrikshindutrialmachinelearningPPT.pptx
antrikshindutrialmachinelearningPPT.pptx
 
An Introduction to Machine Learning
An Introduction to Machine LearningAn Introduction to Machine Learning
An Introduction to Machine Learning
 
Python and Oracle : allies for best of data management
Python and Oracle : allies for best of data managementPython and Oracle : allies for best of data management
Python and Oracle : allies for best of data management
 
Trip Report from Meeting C++ 2017: It's Way More Than C++
Trip Report from Meeting C++ 2017: It's Way More Than C++Trip Report from Meeting C++ 2017: It's Way More Than C++
Trip Report from Meeting C++ 2017: It's Way More Than C++
 

Recently uploaded

UR BHATTI ACADEMY AND ONLINE COURSES.pdf
UR BHATTI ACADEMY AND ONLINE COURSES.pdfUR BHATTI ACADEMY AND ONLINE COURSES.pdf
UR BHATTI ACADEMY AND ONLINE COURSES.pdf
urbhattiacademy
 
HMS Facebook Stories All V1 06092024.docx
HMS Facebook Stories All V1 06092024.docxHMS Facebook Stories All V1 06092024.docx
HMS Facebook Stories All V1 06092024.docx
Charles Bayless
 
Your LinkedIn Success Starts Here.......
Your LinkedIn Success Starts Here.......Your LinkedIn Success Starts Here.......
Your LinkedIn Success Starts Here.......
SocioCosmos
 
原版制作(Hull毕业证书)赫尔大学毕业证Offer一模一样
原版制作(Hull毕业证书)赫尔大学毕业证Offer一模一样原版制作(Hull毕业证书)赫尔大学毕业证Offer一模一样
原版制作(Hull毕业证书)赫尔大学毕业证Offer一模一样
7lkkjxt
 
Dominate Reddit Discussions.............
Dominate Reddit Discussions.............Dominate Reddit Discussions.............
Dominate Reddit Discussions.............
SocioCosmos
 
STUDY ON THE DEVELOPMENT STRATEGY OF HUZHOU TOURISM
STUDY ON THE DEVELOPMENT STRATEGY OF HUZHOU TOURISMSTUDY ON THE DEVELOPMENT STRATEGY OF HUZHOU TOURISM
STUDY ON THE DEVELOPMENT STRATEGY OF HUZHOU TOURISM
AJHSSR Journal
 
EASY TUTORIAL OF HOW TO USE G-TEAMS BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE G-TEAMS BY: FEBLESS HERNANEEASY TUTORIAL OF HOW TO USE G-TEAMS BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE G-TEAMS BY: FEBLESS HERNANE
Febless Hernane
 
Transportation_Channel_Investor_Presentation_April_2024_ Final .pdf
Transportation_Channel_Investor_Presentation_April_2024_ Final .pdfTransportation_Channel_Investor_Presentation_April_2024_ Final .pdf
Transportation_Channel_Investor_Presentation_April_2024_ Final .pdf
Matthewperry105
 
Maximize Your Twitch Potential!..........
Maximize Your Twitch Potential!..........Maximize Your Twitch Potential!..........
Maximize Your Twitch Potential!..........
SocioCosmos
 
快速办理(BCR毕业证书)加州大学河滨分校毕业证文凭证书一模一样
快速办理(BCR毕业证书)加州大学河滨分校毕业证文凭证书一模一样快速办理(BCR毕业证书)加州大学河滨分校毕业证文凭证书一模一样
快速办理(BCR毕业证书)加州大学河滨分校毕业证文凭证书一模一样
ryxqoswi
 
快速办理(worcester毕业证书)伍斯特大学毕业证PDF成绩单一模一样
快速办理(worcester毕业证书)伍斯特大学毕业证PDF成绩单一模一样快速办理(worcester毕业证书)伍斯特大学毕业证PDF成绩单一模一样
快速办理(worcester毕业证书)伍斯特大学毕业证PDF成绩单一模一样
9u4xjk4w
 
HOW TO USE FACEBOOK _ by Clarissa Credito
HOW TO USE FACEBOOK _ by Clarissa CreditoHOW TO USE FACEBOOK _ by Clarissa Credito
HOW TO USE FACEBOOK _ by Clarissa Credito
ClarissaAlanoCredito
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE TELEGRAM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE TELEGRAMLORRAINE ANDREI_LEQUIGAN_HOW TO USE TELEGRAM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE TELEGRAM
lorraineandreiamcidl
 

Recently uploaded (13)

UR BHATTI ACADEMY AND ONLINE COURSES.pdf
UR BHATTI ACADEMY AND ONLINE COURSES.pdfUR BHATTI ACADEMY AND ONLINE COURSES.pdf
UR BHATTI ACADEMY AND ONLINE COURSES.pdf
 
HMS Facebook Stories All V1 06092024.docx
HMS Facebook Stories All V1 06092024.docxHMS Facebook Stories All V1 06092024.docx
HMS Facebook Stories All V1 06092024.docx
 
Your LinkedIn Success Starts Here.......
Your LinkedIn Success Starts Here.......Your LinkedIn Success Starts Here.......
Your LinkedIn Success Starts Here.......
 
原版制作(Hull毕业证书)赫尔大学毕业证Offer一模一样
原版制作(Hull毕业证书)赫尔大学毕业证Offer一模一样原版制作(Hull毕业证书)赫尔大学毕业证Offer一模一样
原版制作(Hull毕业证书)赫尔大学毕业证Offer一模一样
 
Dominate Reddit Discussions.............
Dominate Reddit Discussions.............Dominate Reddit Discussions.............
Dominate Reddit Discussions.............
 
STUDY ON THE DEVELOPMENT STRATEGY OF HUZHOU TOURISM
STUDY ON THE DEVELOPMENT STRATEGY OF HUZHOU TOURISMSTUDY ON THE DEVELOPMENT STRATEGY OF HUZHOU TOURISM
STUDY ON THE DEVELOPMENT STRATEGY OF HUZHOU TOURISM
 
EASY TUTORIAL OF HOW TO USE G-TEAMS BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE G-TEAMS BY: FEBLESS HERNANEEASY TUTORIAL OF HOW TO USE G-TEAMS BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE G-TEAMS BY: FEBLESS HERNANE
 
Transportation_Channel_Investor_Presentation_April_2024_ Final .pdf
Transportation_Channel_Investor_Presentation_April_2024_ Final .pdfTransportation_Channel_Investor_Presentation_April_2024_ Final .pdf
Transportation_Channel_Investor_Presentation_April_2024_ Final .pdf
 
Maximize Your Twitch Potential!..........
Maximize Your Twitch Potential!..........Maximize Your Twitch Potential!..........
Maximize Your Twitch Potential!..........
 
快速办理(BCR毕业证书)加州大学河滨分校毕业证文凭证书一模一样
快速办理(BCR毕业证书)加州大学河滨分校毕业证文凭证书一模一样快速办理(BCR毕业证书)加州大学河滨分校毕业证文凭证书一模一样
快速办理(BCR毕业证书)加州大学河滨分校毕业证文凭证书一模一样
 
快速办理(worcester毕业证书)伍斯特大学毕业证PDF成绩单一模一样
快速办理(worcester毕业证书)伍斯特大学毕业证PDF成绩单一模一样快速办理(worcester毕业证书)伍斯特大学毕业证PDF成绩单一模一样
快速办理(worcester毕业证书)伍斯特大学毕业证PDF成绩单一模一样
 
HOW TO USE FACEBOOK _ by Clarissa Credito
HOW TO USE FACEBOOK _ by Clarissa CreditoHOW TO USE FACEBOOK _ by Clarissa Credito
HOW TO USE FACEBOOK _ by Clarissa Credito
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE TELEGRAM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE TELEGRAMLORRAINE ANDREI_LEQUIGAN_HOW TO USE TELEGRAM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE TELEGRAM
 

Get connected with python

  • 2. –Steve Jobs "Computers are like a bicycle for our minds." https://www.youtube.com/watch?v=ob_GX50Za6c
  • 3. Computer Programming • Programming: to build a machine that does your work • Whenever you enter a search term in Google, you are programming Google to search for you … • but if you need to think about AND and/or OR and "grouping of search terms" most people give up. • A computer is a general purpose machine: a calculator, a word processor, a drawing machine, a search machine, a remember machine, an analytics machine, an information machine, a communications machine, a game machine, a navigation machine, a music machine, a video machine, a design machine … • If you learn how to program you can build these (and many other) machines!
  • 4. Programming Languages Expressive Power: 1 line of code in Python, Perl, R or Ruby 3 lines of code in C++, C# or Java 10 lines of code in C 50-100 lines of code in Machine Language or Assembler
  • 5. Python 3.4.0 In this workshop you will learn to write Python One Liners!
  • 6. Guido van Rossum Benevolent Dictator For Life
  • 7.
  • 9. 'Edwin Jansen' is a 'Plumber' 'Edwin Jansen' has properties: • edwinJansen.phoneNumber • edwinJansen.available 'Edwin Jansen' has skills to do things: • edwinJansen.fixTap() • edwinJansen.repairRoof() >>> import plumber and let a plumber do the work! Object Class Methods (verbs) Properties (nouns)
  • 10. Everything is an object! • Whole Numbers: int • Broken numbers: float • Text: str • User Interface Elements: Windows, Buttons, Sliders, TextFields, ImageViews, MapViews. • Containers: list, dict, tuple, …
  • 11. Assignment 0 Install Python on your laptop (use Google to look for Python / IDLE download)
  • 14. Console "Python chat" Editor "Python email" Run menu Run Module Syntax Colour Code?
  • 16. Assignment 1 Write your first computer program, a classic: >>> print("Hello World")
  • 17. Assignment 2 Introduce yourself: >>> myName = "…" >>> print("Hello", myName) New Object!
  • 18. Assignment 3 Introduce your group: >>> ourGroup = ["Komala Mazerant", …] and say hello to everyone (except yourself!)
  • 19. Iteration (Looping) >>> for student in ourGroup: print("Hello", student)
  • 20. Condition (Skipping) … == … means 'is equal to' … != … means 'is not equal to' >>> for student in ourGroup: if student != myName: print("Hello", student)
  • 21. Assignment 4 Find out the class of the objects you created: >>> type(…) find out their size (length) >>> len(…) and find out what you can do with these objects >>> dir(…) and if you want detailed information use >>> help(…)
  • 22. Dynamic Typing Try this: >>> aNumber = 747 >>> aNumber + aNumber >>> sameNumber = str(aNumber) >>> sameNumber + sameNumber >>> anotherNumber = int(sameNumber) >>> anotherNumber + anotherNumber What is going on here???
  • 23. Juggle with types Make a 'class list' object from a 'class string' object: >>> aQuote = "Computers are like a bicycle for our minds" >>> quoteWords = aQuote.split() and turn the words back into a sentence" >>> aSentence = "" >>> for word in quoteWords: aSentence = aSentence + " " + word
  • 24. Assignment 5 Copy the contents of theJungle in an object: >>> theJungle = "…" A. Is there a lion in the jungle? B. Where do you encounter the first tiger? C. How many trees in the jungle?
  • 25. Selection (Slicing) >>> aStudent = ourGroup[1] >>> someStudents = ourGroup[2:5] >>> lastStudent = ourGroup[-1]
  • 26. Assignment 6 Find palindromes in 'words' list: >>> words = […]
  • 28. Assignment 7 Browse to: https://twitter.com/search-advanced A. How many tweets today in Rotterdam? B. Any tweets with tag #GetConnected? C. What is last tweet from @BarackObama D. More positive or more negative tweets last week about @BarackObama?
  • 29. Analytics 1. Collect Data 2. Clean Data 3. Wrangle, Merge, Aggregate 4. Visualize, Summarize Data 5. Interpret, Develop Insights 6. Act!
  • 30. Collect Data >>> from urllib import request >>> twitterHandle = request.urlopen("http:// twitter.com") >>> twitterData = twitterHandle.read() >>> twitterText = str(twitterData) >>> twitterText[0:500] >>> len(twitterText)
  • 31. Assignment 8 Copy the contents of aBusinessCard and someBusinessCards in two objects: >>> aBusinessCard = […] >>> someBusinessCards = […] A. How can you recognize a phone number or an email address in aBusinessCard B. Print a list of names extracted from someBusinessCards C. Print a list of email addresses extracted from someBusinessCards
  • 32. Assignment 9 Copy the contents of tweets in an object: >>> tweets = […] A. How many tweets? B. How many from Rotterdam? C. Who has sent tweets with hashtag #GetConnected?
  • 33. Assignment 10 Copy the contents of twitterFollowers in an object: >>> tf = "…" A. Is there overlap in the followers of @KomalaDubois and @jankroon? B. What would be the possibilities if you would know all followers of all people on Twitter?
  • 34. Algorithms • Dictionary attack to break password protection • Harvesting email addresses for spamming • Recommendations: "People who rented this movie also rented …" • Segmentation: clustering people that are similar in some respect • Outlier detection: discover exceptional behavior, i.e. to prevent credit card fraud
  • 35. Visualize Data Our eyes are extremely good at finding patterns • Mathematical Graphs • Statistical Diagrams • Maps • Timelines • Network Graphs
  • 37. 10.000 hours of practice Malcom Gladwell states in his book 'Outliers' that you need to practice for at least 10.000 hours in order to master a specific skill. 8 hours/day * 7 days/week * 52 weeks/year * 3,5 year = 10192 uur 0,1%
  • 39. { "coordinates": null, "created_at": "Thu Oct 21 16:02:46 +0000 2010", "favorited": false, "truncated": false, "id_str": "28039652140", "entities": { "urls": [ { "expanded_url": null, "url": "http://gnip.com/success_stories", "indices": [ 69, 100 ] } ], "hashtags": [   ], "user_mentions": [ { "name": "Gnip, Inc.", "id_str": "16958875", "id": 16958875, "indices": [ 25, 30 ], "screen_name": "gnip" } ] }, "in_reply_to_user_id_str": null, "text": "what we've been up to at @gnip -- delivering data to happy customers http://gnip.com/success_stories", "contributors": null, "id": 28039652140, "retweet_count": null, "in_reply_to_status_id_str": null, "geo": null, "retweeted": false, "in_reply_to_user_id": null, "user": { "profile_sidebar_border_color": "C0DEED", "name": "Gnip, Inc.", "profile_sidebar_fill_color": "DDEEF6", "profile_background_tile": false, "profile_image_url": "http://a3.twimg.com/profile_images/62803643/icon_normal.png", "location": "Boulder, CO", "created_at": "Fri Oct 24 23:22:09 +0000 2008", "id_str": "16958875", "follow_request_sent": false, "profile_link_color": "0084B4", "favourites_count": 1, "url": "http://blog.gnip.com", "contributors_enabled": false, "utc_offset": -25200, "id": 16958875, "profile_use_background_image": true, "listed_count": 23, "protected": false, "lang": "en", "profile_text_color": "333333", "followers_count": 260, "time_zone": "Mountain Time (US & Canada)", "verified": false, "geo_enabled": true, "profile_background_color": "C0DEED", "notifications": false,