Python is an interpreted, object-oriented programming language similar to PERL, that has gained popularity because of its clear syntax and readability.
Python is an interpreted, object-oriented, high-level programming language with dynamic semantics.
Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together.
Text Mining with R -- an Analysis of Twitter DataYanchang Zhao
This document discusses analyzing Twitter data using text mining techniques in R. It outlines extracting tweets from Twitter and cleaning the text by removing punctuation, numbers, URLs, and stopwords. It then analyzes the cleaned text by finding frequent words, word associations, and creating a word cloud visualization. It performs text clustering on the tweets using hierarchical and k-means clustering. Finally, it models topics in the tweets using partitioning around medoids clustering. The overall goal is to demonstrate various text mining and natural language processing techniques for analyzing Twitter data in R.
This document provides a summary of Week 2 of a Python programming course. It discusses dictionaries, including defining, modifying, and deleting dictionary items. It also covers lists, such as defining and slicing lists, as well as adding, searching, and deleting list elements. Finally, it introduces tuples as immutable lists and discusses variable declaration and string formatting in Python.
This document provides an overview of key concepts in Python including:
- Python is a dynamically typed language where variables are not explicitly defined and can change type.
- Names and identifiers in Python are case sensitive and follow specific conventions.
- Python uses indentation rather than brackets to define blocks of code.
- Core data types in Python include numeric, string, list, tuple, dictionary, set, boolean and file types. Each has specific characteristics and operators.
The document discusses various data sources for linguistic analysis, including corpora, dictionaries, social media, and linked open data. It provides details on accessing data from Facebook and Twitter using APIs and R packages. It also covers preprocessing text data through tokenization, lemmatization, stemming and creating term-document matrices. Sentiment analysis on data from sources like Experience Project is demonstrated through exploring word-category correlations.
This document summarizes Week 3 of a Python programming course. It discusses introspection, which allows code to examine and manipulate other code as objects. It covers optional and named function arguments, built-in functions like type and str, and filtering lists with comprehensions. It also explains lambda functions and how and and or work in Python.
This is presentation, that covers all the important topics related to strings in python. It covers storing, slicing, format, concatenation, modification, escape characters and string methods.
The file attatched also includes examples related to the slides shown.
This document summarizes Lecture 1 of Real World Haskell. It introduces functional programming and Haskell, discusses the Haskell Platform and interactive interpreter ghci. It demonstrates defining simple functions and expressions, writing small interactive programs, and using recursion to number lines of text. Resources for learning more about Haskell are provided.
Text Mining with R -- an Analysis of Twitter DataYanchang Zhao
This document discusses analyzing Twitter data using text mining techniques in R. It outlines extracting tweets from Twitter and cleaning the text by removing punctuation, numbers, URLs, and stopwords. It then analyzes the cleaned text by finding frequent words, word associations, and creating a word cloud visualization. It performs text clustering on the tweets using hierarchical and k-means clustering. Finally, it models topics in the tweets using partitioning around medoids clustering. The overall goal is to demonstrate various text mining and natural language processing techniques for analyzing Twitter data in R.
This document provides a summary of Week 2 of a Python programming course. It discusses dictionaries, including defining, modifying, and deleting dictionary items. It also covers lists, such as defining and slicing lists, as well as adding, searching, and deleting list elements. Finally, it introduces tuples as immutable lists and discusses variable declaration and string formatting in Python.
This document provides an overview of key concepts in Python including:
- Python is a dynamically typed language where variables are not explicitly defined and can change type.
- Names and identifiers in Python are case sensitive and follow specific conventions.
- Python uses indentation rather than brackets to define blocks of code.
- Core data types in Python include numeric, string, list, tuple, dictionary, set, boolean and file types. Each has specific characteristics and operators.
The document discusses various data sources for linguistic analysis, including corpora, dictionaries, social media, and linked open data. It provides details on accessing data from Facebook and Twitter using APIs and R packages. It also covers preprocessing text data through tokenization, lemmatization, stemming and creating term-document matrices. Sentiment analysis on data from sources like Experience Project is demonstrated through exploring word-category correlations.
This document summarizes Week 3 of a Python programming course. It discusses introspection, which allows code to examine and manipulate other code as objects. It covers optional and named function arguments, built-in functions like type and str, and filtering lists with comprehensions. It also explains lambda functions and how and and or work in Python.
This is presentation, that covers all the important topics related to strings in python. It covers storing, slicing, format, concatenation, modification, escape characters and string methods.
The file attatched also includes examples related to the slides shown.
This document summarizes Lecture 1 of Real World Haskell. It introduces functional programming and Haskell, discusses the Haskell Platform and interactive interpreter ghci. It demonstrates defining simple functions and expressions, writing small interactive programs, and using recursion to number lines of text. Resources for learning more about Haskell are provided.
Text Classification in Python – using Pandas, scikit-learn, IPython Notebook ...Jimmy Lai
Big data analysis relies on exploiting various handy tools to gain insight from data easily. In this talk, the speaker demonstrates a data mining flow for text classification using many Python tools. The flow consists of feature extraction/selection, model training/tuning and evaluation. Various tools are used in the flow, including: Pandas for feature processing, scikit-learn for classification, IPython, Notebook for fast sketching, matplotlib for visualization.
High level introduction to text mining analytics, which covers the building blocks or most commonly used techniques of text mining along with useful additional references/links where required for background/literature and R codes to get you started.
Scala 3 Is Coming: Martin Odersky Shares What To KnowLightbend
Scala 3 is coming and will introduce many new features and changes while maintaining compatibility with Scala 2 code. The roadmap outlines stabilizing Scala 3.0 in fall 2019 and 2020, with Scala 2.x continuing in parallel. Key changes include replacing implicits with "givens", introducing enums, union types, and other features to improve the language for beginners, everyday usage, and experts. While significant, the changes are aimed at regularizing Scala and addressing longstanding issues like implicits in a way that eases migration from Scala 2 to 3 through common intermediate representations like Tasty.
This document discusses various text mining and natural language processing techniques in Python, including tokenization, sentence tokenization, word counting, finding word lengths, word proportions, word types and ratios, finding top N words, plotting word frequencies, lexical dispersion plots, tag clouds, word co-occurrence matrices, and stop words filtering. Code examples are provided for implementing each technique in Python.
The document discusses different data structures and their implementations and applications. It covers arrays, linked lists, stacks, queues, binary trees, and binary search. The key points are:
- Arrays allow fast access but have fixed size; linked lists can grow dynamically but access is slower.
- Binary trees allow fast (O(log n)) search, insertion, and deletion operations due to their hierarchical structure.
- Stacks and queues are useful for modeling LIFO and FIFO data access with applications like function calls and job scheduling.
- Binary search runs in O(log n) time by recursively dividing the search space for sorted data.
This document discusses text mining in R. It introduces important text mining concepts like tokenization, tagging, and stemming. It outlines popular R packages for text mining like tm, SnowballC, qdap, and dplyr. The document explains how to create a corpus from text files, explore and transform a corpus, create a document term matrix, and analyze term frequencies. Visualization techniques like word clouds and heatmaps are also summarized.
The document discusses different techniques for weighting terms in the vector space model for information retrieval, including:
- Sublinear tf scaling using the logarithm of term frequency
- Tf-idf weighting
- Maximum tf normalization to mitigate higher weights for longer documents
It also discusses evaluating information retrieval systems using test collections with queries, relevant documents, and metrics like precision and recall. Standard test collections include Cranfield, TREC, and CLEF.
This document provides an overview of text classification in Scikit-learn. It discusses setting up necessary packages in Ubuntu, loading and preprocessing text data from the 20 newsgroups dataset, extracting features from text using CountVectorizer and TfidfVectorizer, performing feature selection, training classification models, evaluating performance through cross-validation, and visualizing results. The goal is to classify newsgroup posts by topic using machine learning techniques in Scikit-learn.
Natural Language Processing in R (rNLP)fridolin.wild
The introductory slides of a workshop given to the doctoral school at the Institute of Business Informatics of the Goethe University Frankfurt. The tutorials are available on http://crunch.kmi.open.ac.uk/w/index.php/Tutorials
The document discusses Java's stream-based input/output capabilities provided by the java.io package. It describes the different types of streams like input streams, output streams, binary streams, character streams. It covers classes like InputStream, OutputStream, DataInputStream, DataOutputStream and how to read from and write to files using FileInputStream and FileOutputStream. It also discusses formatting output, accessing files and directories, and filtering stream content.
Text analytics in Python and R with examples from Tobacco ControlBen Healey
This document discusses text analytics techniques for summarizing and analyzing unstructured text documents, with examples from analyzing documents related to tobacco control. It covers data cleaning and standardization steps like removing punctuation, stopwords, stemming, and deduplication. It also discusses frequency analysis using document-term matrices, topic modeling using LDA, and unsupervised and supervised classification techniques. The document provides examples analyzing posts from new users versus highly active users on an online forum, identifying topics and comparing topic distributions between different user groups.
The document discusses types in Haskell, explaining that Haskell is strongly typed and describing basic types like Int, Char, and Bool as well as more complex types like tuples, lists, and functions. It also covers type inference, polymorphism, and how to infer the behavior of functions from their types.
This document summarizes a lecture about practical programming in Haskell. It discusses reading files, counting words, and improving performance. It shows how to:
1) Read a file into a bytestring for efficient processing, count the words, and print the result.
2) Use the Data.Text module for Unicode support when processing text files, reading the file as bytes and decoding to text before counting words.
3) Achieve performance comparable or better than C implementations when choosing efficient data representations like bytestrings and text.
This document summarizes a lecture about models of evaluation in Haskell. It discusses lazy evaluation and call-by-need evaluation in Haskell. It provides examples showing that expressions are not evaluated unless their values are needed. Common functions like map and fold can be written in terms of each other due to their shared structural transformation of lists. Both left and right folds are discussed, with right folds constructing nested applications and left folds avoiding this issue.
This document summarizes a lecture about quaternions and how to represent them in Haskell using algebraic data types and type classes. It introduces quaternions, defines a Quaternion data type, and shows how to use data constructors to create and pattern match quaternion values. It also discusses type classes like Eq and Show that allow quaternions to be compared and printed by making Quaternion an instance of these classes. Finally, it provides homework problems about working with points and angles in 2D space.
The document discusses Haskell concepts including:
1) Pattern matching allows functions to handle different cases depending on the structure of input data, like matching empty and non-empty lists.
2) Guards allow selecting different code blocks based on Boolean conditions.
3) Combining pattern matching and guards allows for very expressive functions that concisely handle multiple cases.
4) Metasyntactic variables like (x:xs) follow conventions to bind pattern names and make code more readable.
5) Functions can match multiple patterns at once to handle different input structures.
This document summarizes a text mining project analyzing Stack Overflow posts tagged with R, statistics, machine learning, and other tags. It describes the dataset, data cleaning process, feature engineering including creating word frequency matrices, and unsupervised feature selection to reduce the feature space. Power features beyond word frequencies were also extracted, such as counts of code blocks, LaTeX blocks, and words in titles and bodies. The goal was to classify posts as related to R or not related to R for supervised learning.
String objects are immutable in Java, so any operation that modifies a String value actually creates a new String object. The StringBuffer and StringBuilder classes provide mutable alternatives to String that have similar methods but do not create new objects with each modification. When a String literal value is used in code, it is stored in the String constant pool to promote reuse of these immutable objects.
The binary search is faster than the sequential search. The complexity of binary search is O(log n) whereas the complexity of a sequential search is O(n). Stacks are used to evaluate algebraic or arithmetic expressions using prefix or postfix notations. Heap sort involves creating a max heap from the array and then replacing the root with the last element and rebuilding the heap for the remaining elements, repeating this process to sort the entire array.
I am shubham sharma graduated from Acropolis Institute of technology in Computer Science and Engineering. I have spent around 2 years in field of Machine learning. I am currently working as Data Scientist in Reliance industries private limited Mumbai. Mainly focused on problems related to data handing, data analysis, modeling, forecasting, statistics and machine learning, Deep learning, Computer Vision, Natural language processing etc. Area of interests are Data Analytics, Machine Learning, Machine learning, Time Series Forecasting, web information retrieval, algorithms, Data structures, design patterns, OOAD.
This document summarizes the iOS mobile operating system. It discusses the history and versions of iOS, from its initial release as iPhone OS in 2007 to the current iOS 4. It also describes the four technology layers that make up iOS - Core OS, Core Services, Media, and Cocoa Touch. The document outlines the process for developing apps for iOS using Xcode and Objective-C and the tools available to developers.
Text Classification in Python – using Pandas, scikit-learn, IPython Notebook ...Jimmy Lai
Big data analysis relies on exploiting various handy tools to gain insight from data easily. In this talk, the speaker demonstrates a data mining flow for text classification using many Python tools. The flow consists of feature extraction/selection, model training/tuning and evaluation. Various tools are used in the flow, including: Pandas for feature processing, scikit-learn for classification, IPython, Notebook for fast sketching, matplotlib for visualization.
High level introduction to text mining analytics, which covers the building blocks or most commonly used techniques of text mining along with useful additional references/links where required for background/literature and R codes to get you started.
Scala 3 Is Coming: Martin Odersky Shares What To KnowLightbend
Scala 3 is coming and will introduce many new features and changes while maintaining compatibility with Scala 2 code. The roadmap outlines stabilizing Scala 3.0 in fall 2019 and 2020, with Scala 2.x continuing in parallel. Key changes include replacing implicits with "givens", introducing enums, union types, and other features to improve the language for beginners, everyday usage, and experts. While significant, the changes are aimed at regularizing Scala and addressing longstanding issues like implicits in a way that eases migration from Scala 2 to 3 through common intermediate representations like Tasty.
This document discusses various text mining and natural language processing techniques in Python, including tokenization, sentence tokenization, word counting, finding word lengths, word proportions, word types and ratios, finding top N words, plotting word frequencies, lexical dispersion plots, tag clouds, word co-occurrence matrices, and stop words filtering. Code examples are provided for implementing each technique in Python.
The document discusses different data structures and their implementations and applications. It covers arrays, linked lists, stacks, queues, binary trees, and binary search. The key points are:
- Arrays allow fast access but have fixed size; linked lists can grow dynamically but access is slower.
- Binary trees allow fast (O(log n)) search, insertion, and deletion operations due to their hierarchical structure.
- Stacks and queues are useful for modeling LIFO and FIFO data access with applications like function calls and job scheduling.
- Binary search runs in O(log n) time by recursively dividing the search space for sorted data.
This document discusses text mining in R. It introduces important text mining concepts like tokenization, tagging, and stemming. It outlines popular R packages for text mining like tm, SnowballC, qdap, and dplyr. The document explains how to create a corpus from text files, explore and transform a corpus, create a document term matrix, and analyze term frequencies. Visualization techniques like word clouds and heatmaps are also summarized.
The document discusses different techniques for weighting terms in the vector space model for information retrieval, including:
- Sublinear tf scaling using the logarithm of term frequency
- Tf-idf weighting
- Maximum tf normalization to mitigate higher weights for longer documents
It also discusses evaluating information retrieval systems using test collections with queries, relevant documents, and metrics like precision and recall. Standard test collections include Cranfield, TREC, and CLEF.
This document provides an overview of text classification in Scikit-learn. It discusses setting up necessary packages in Ubuntu, loading and preprocessing text data from the 20 newsgroups dataset, extracting features from text using CountVectorizer and TfidfVectorizer, performing feature selection, training classification models, evaluating performance through cross-validation, and visualizing results. The goal is to classify newsgroup posts by topic using machine learning techniques in Scikit-learn.
Natural Language Processing in R (rNLP)fridolin.wild
The introductory slides of a workshop given to the doctoral school at the Institute of Business Informatics of the Goethe University Frankfurt. The tutorials are available on http://crunch.kmi.open.ac.uk/w/index.php/Tutorials
The document discusses Java's stream-based input/output capabilities provided by the java.io package. It describes the different types of streams like input streams, output streams, binary streams, character streams. It covers classes like InputStream, OutputStream, DataInputStream, DataOutputStream and how to read from and write to files using FileInputStream and FileOutputStream. It also discusses formatting output, accessing files and directories, and filtering stream content.
Text analytics in Python and R with examples from Tobacco ControlBen Healey
This document discusses text analytics techniques for summarizing and analyzing unstructured text documents, with examples from analyzing documents related to tobacco control. It covers data cleaning and standardization steps like removing punctuation, stopwords, stemming, and deduplication. It also discusses frequency analysis using document-term matrices, topic modeling using LDA, and unsupervised and supervised classification techniques. The document provides examples analyzing posts from new users versus highly active users on an online forum, identifying topics and comparing topic distributions between different user groups.
The document discusses types in Haskell, explaining that Haskell is strongly typed and describing basic types like Int, Char, and Bool as well as more complex types like tuples, lists, and functions. It also covers type inference, polymorphism, and how to infer the behavior of functions from their types.
This document summarizes a lecture about practical programming in Haskell. It discusses reading files, counting words, and improving performance. It shows how to:
1) Read a file into a bytestring for efficient processing, count the words, and print the result.
2) Use the Data.Text module for Unicode support when processing text files, reading the file as bytes and decoding to text before counting words.
3) Achieve performance comparable or better than C implementations when choosing efficient data representations like bytestrings and text.
This document summarizes a lecture about models of evaluation in Haskell. It discusses lazy evaluation and call-by-need evaluation in Haskell. It provides examples showing that expressions are not evaluated unless their values are needed. Common functions like map and fold can be written in terms of each other due to their shared structural transformation of lists. Both left and right folds are discussed, with right folds constructing nested applications and left folds avoiding this issue.
This document summarizes a lecture about quaternions and how to represent them in Haskell using algebraic data types and type classes. It introduces quaternions, defines a Quaternion data type, and shows how to use data constructors to create and pattern match quaternion values. It also discusses type classes like Eq and Show that allow quaternions to be compared and printed by making Quaternion an instance of these classes. Finally, it provides homework problems about working with points and angles in 2D space.
The document discusses Haskell concepts including:
1) Pattern matching allows functions to handle different cases depending on the structure of input data, like matching empty and non-empty lists.
2) Guards allow selecting different code blocks based on Boolean conditions.
3) Combining pattern matching and guards allows for very expressive functions that concisely handle multiple cases.
4) Metasyntactic variables like (x:xs) follow conventions to bind pattern names and make code more readable.
5) Functions can match multiple patterns at once to handle different input structures.
This document summarizes a text mining project analyzing Stack Overflow posts tagged with R, statistics, machine learning, and other tags. It describes the dataset, data cleaning process, feature engineering including creating word frequency matrices, and unsupervised feature selection to reduce the feature space. Power features beyond word frequencies were also extracted, such as counts of code blocks, LaTeX blocks, and words in titles and bodies. The goal was to classify posts as related to R or not related to R for supervised learning.
String objects are immutable in Java, so any operation that modifies a String value actually creates a new String object. The StringBuffer and StringBuilder classes provide mutable alternatives to String that have similar methods but do not create new objects with each modification. When a String literal value is used in code, it is stored in the String constant pool to promote reuse of these immutable objects.
The binary search is faster than the sequential search. The complexity of binary search is O(log n) whereas the complexity of a sequential search is O(n). Stacks are used to evaluate algebraic or arithmetic expressions using prefix or postfix notations. Heap sort involves creating a max heap from the array and then replacing the root with the last element and rebuilding the heap for the remaining elements, repeating this process to sort the entire array.
I am shubham sharma graduated from Acropolis Institute of technology in Computer Science and Engineering. I have spent around 2 years in field of Machine learning. I am currently working as Data Scientist in Reliance industries private limited Mumbai. Mainly focused on problems related to data handing, data analysis, modeling, forecasting, statistics and machine learning, Deep learning, Computer Vision, Natural language processing etc. Area of interests are Data Analytics, Machine Learning, Machine learning, Time Series Forecasting, web information retrieval, algorithms, Data structures, design patterns, OOAD.
This document summarizes the iOS mobile operating system. It discusses the history and versions of iOS, from its initial release as iPhone OS in 2007 to the current iOS 4. It also describes the four technology layers that make up iOS - Core OS, Core Services, Media, and Cocoa Touch. The document outlines the process for developing apps for iOS using Xcode and Objective-C and the tools available to developers.
CPP is an air quality and wind engineering consulting firm that provides air permitting and advanced dispersion modeling services. They have expertise in AERMOD modeling, wind tunnel modeling, and other advanced analysis methods like equivalent building dimensions and emission variability processing. Using these advanced methods, CPP can help optimize clients' emission control equipment and stack heights to make projects compliant with permitting requirements in cases where initial modeling shows exceedances.
Python is a general-purpose programming language that emphasizes code readability. It supports multiple programming paradigms including object-oriented, imperative, and functional programming. The reference implementation of Python is free and open source.
Ruby is an object-oriented scripting language that combines elements of Perl and Smalltalk. It supports multiple programming paradigms including functional, object-oriented, imperative and reflective paradigms. There are multiple implementations of Ruby including the standard implementation written in C.
ActionScript is a scripting language based on ECMAScript that is used primarily for Adobe Flash applications. It was initially designed for simple animations but later expanded to support richer applications. Flash MX 2004 introduced ActionScript
Python web frameworks presentation by Nathan VanGheem.
Material covered:
- The major frameworks around and differences between them
- Micro frameworks
- Templating languages
- The state of Python 3 and Python Web Technologies
- Brief ditty on NoSQL with MongoDB
- How to get started
The presentation video and sample code is available here:
http://zootlinux.blogspot.com/2011/10/october-newlug-presentation-python-web.html
iOS is a great platform to work on, and many developers have spend some time looking at the platform. This talk is aimed at programmers with prior iOS experience who want to get into iOS in more depth.
This presentation will take you from a basic level of understanding of iOS to look at advanced topics that will make you apps more polished, better designed and, ideally, more successful.
Abstract concepts are no use, so in this talk we'll take some existing successful commercial iOS applications as a case study, and see how a selection of iOS technologies and techniques combine within it.
On the way, we'll see:
* How to use Objective-C language facilities to their best advantage
* How to exploit key iOS technologies to save you time and effort
* iOS development idioms that will improve the quality of your code
* Creating "universal" iPhone/iPad/retina applications without going mad
* Successful deployment and testing strategies
'Advanced Techonolgies in Architectural Representation'
Presentation for the initial class of architecture course in the universities of Architecture in Barcelona ETSAB (UPC) and ETSALS (URL)
Applications of Data Mining Issues in Data Mining
Financial Data Analysis
Retail Industry
Telecommunication Industry
Biological Data Analysis
Other Scientific Applications
Intrusion Detection
Slides from Advaned Python lectures I gave recently in Haifa Linux club
Advanced python, Part 1:
- Decorators
- Descriptors
- Metaclasses
- Multiple inheritance
ABSTRACT: In recent years, Python had become an extremely popular programming language. Python is becoming more and more present in education as its syntax gets out of the way and makes it easy to learn and use to introduce computer science concepts. This paper explores the inner workings of Python decorators, which is considered an advanced topic even for experienced programmers. The paper provides an insight into decorators mechanism, as well as their implementation using classes and functions. Implementation options are discussed using examples
and visualization.
[Presented at IT'15 Conference in Zabljak, Montenegro]
Python and BIG Data analytics | Python Fundamentals | Python ArchitectureSkillspeed
This Python tutorial will unravel the pro and cons of Python; covering Fundamentals and Advantages of Python. A comprehensive comparison of MapR and Python has been mentioned. At the end, you'll know why Python is a High Level Scripting Tool for BIG Data Analytics
---------
PPT Agenda:
Introduction to Python
Web Scraping Use Case?
Introduction to BIG Data and Hadoop
MapReduce
PyDoop
Word Count Use Case
---------
What is Python? - Introduction Python
Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C++ or Java.
----------
Why Python? - Python Advantages
Clear Syntax
Good for Text Processing
Extended in C and C++
Generates HTML content
Pre-Defined Libraries – NumPy, SciPy
Interpreted Environment
Automatic Memory Management
Good for Code Steering
Merging Multiple Programs
----------
Skillspeed is a live e-learning company focusing on high-technology courses. We provide live instructor-led training in BIG Data & Hadoop featuring 24/7 Lifetime Support, 100% Placement Assistance & Real-time Projects.
Email: sales@skillspeed.com
Website: www.skillspeed.com
Number: +91-90660-20904
Facebook: https://www.facebook.com/SkillspeedOnline
Linkedin: https://www.linkedin.com/company/skillspeed
The document discusses major issues in data mining including mining methodology, user interaction, performance, and data types. Specifically, it outlines challenges of mining different types of knowledge, interactive mining at multiple levels of abstraction, incorporating background knowledge, visualization of results, handling noisy data, evaluating pattern interestingness, efficiency and scalability of algorithms, parallel and distributed mining, and handling relational and complex data types from heterogeneous databases.
Data mining (lecture 1 & 2) conecpts and techniquesSaif Ullah
This document provides an overview of data mining concepts from Chapter 1 of the textbook "Data Mining: Concepts and Techniques". It discusses the motivation for data mining due to increasing data collection, defines data mining as the extraction of useful patterns from large datasets, and outlines some common applications like market analysis, risk management, and fraud detection. It also introduces the key steps in a typical data mining process including data selection, cleaning, mining, and evaluation.
Market Segmentation, Targeting and PositioningDaniel Gibson
The document summarizes the key steps in market segmentation, targeting, and positioning. It discusses:
1) The benefits of segmentation including effective use of resources, focus, and value creation.
2) The main steps in segmentation, targeting, and positioning including identifying market segments, developing segment profiles, evaluating segment attractiveness, selecting target segments, and developing a positioning and marketing mix for each.
3) Common bases used for segmenting markets such as demographics, psychographics, behaviors, and geography. It also outlines strategies for market coverage and choosing positions that create competitive advantage.
Social Media Marketing for Restaurants: 21 tipsWishpond
Do you work for, manage or own an eating establishment? Do you want to know how to use social media to market your restaurant?
It’s a common problem - restaurants want to be engaging with their clientele; they want to use social tools to get more patrons walking through their doors - but they just don’t know how.
Adding social media to your marketing mix can hugely increase awareness about your restaurant, generate motivated engagement with your food, and get you more customers in your door.
In this presentation, I'll show you 21 actionable tactics and tips for using Facebook, Instagram and Twitter to market to your customers.
Java Tools and Technologies Landscape for 2014 (image gallery)ZeroTurnaround
**See the full version here: http://zeroturnaround.com/rebellabs/java-tools-and-technologies-landscape-for-2014/
--
In a recent survey, RebelLabs asked 2164 Java professionals about their technology usage in 14 tool categories, and found some interesting trends…
The document provides an introduction to Python programming. It discusses installing and running Python, basic Python syntax like variables, data types, conditionals, and functions. It emphasizes that Python uses references rather than copying values, so assigning one variable to another causes both to refer to the same object.
The document provides an introduction to the Python programming language. It discusses that Python is an open source, general purpose language that is object oriented, procedural, and functional. It also notes that Python has a great interactive environment and is easy to interface with other languages like C, C++, Java, and Fortran. The document then discusses Python versions, installing Python, the Python interpreter, running Python programs, key Python modules like NumPy and Matplotlib, and some basics of the Python language.
The document provides an introduction to the Python programming language. It discusses that Python is an open source, general purpose language that is object oriented, procedural, and functional. It also notes that Python has a great interactive environment and is easy to interface with other languages like C, C++, Java, and Fortran. The document then discusses Python versions, installing Python, the Python interpreter, running Python programs, key Python modules like NumPy and Matplotlib, and some basics of the Python language.
The document provides an introduction to the Python programming language. It discusses that Python is an open source, general purpose language that is object oriented, procedural, and functional. It also notes that Python has a great interactive environment and batteries included standard library. The document then covers technical issues like installing Python, running Python programs, and commonly used Python modules like NumPy, Matplotlib, and PyFITS. It concludes with an overview of the basics of Python including data types, operators, comments, and understanding reference semantics.
The document provides an introduction to the Python programming language. It discusses that Python is an open source, general purpose language that is object oriented, procedural, and functional. It also notes that Python has a great interactive environment and is easy to interface with other languages. The document then covers technical issues like installing Python, running Python programs, the Python interpreter, and batteries included with the standard Python distribution like NumPy and Matplotlib for scientific computing.
The document summarizes basic elements of Python programs including literals, assignments, data types, identifiers, and expressions. Literals represent specific values like numbers and strings. Variables store values that can change. Expressions combine values using operators to produce new values. Input is obtained using assignments combined with the input function. Data types can be converted between integer, float, and string formats.
Python is an interpreted, general-purpose, high-level programming language. It allows programmers to define functions for reusing code and scoping variables within functions. Key concepts covered include objects, expressions, conditionals, loops, modules, files, and recursion. Functions can call other functions, allowing for modular and reusable code.
- Python is an interpreted, object-oriented programming language that is beginner friendly and open source. It was created in the 1990s and named after Monty Python.
- Python is very suitable for natural language processing tasks due to its built-in string and list datatypes as well as libraries like NLTK. It also has strong numeric processing capabilities useful for machine learning.
- Python code is organized using functions, classes, modules, and packages to improve structure. It is interpreted at runtime rather than requiring a separate compilation step.
This document provides an overview of learning Python in three hours. It covers Python's history, installing and running Python, basic data types like integers, floats and strings. It also discusses sequence types like lists, tuples and strings, and how lists are mutable while tuples are immutable. The document includes examples of basic syntax like assignment, conditionals, functions and modules. It provides guidance on naming conventions and discusses the Python interpreter, editors and development environments.
The document provides an overview of the Python programming language. It discusses Python's history, how to install and run Python, basic data types like integers, floats, strings, lists and tuples. It explains key Python concepts like variable assignment, conditional statements, functions, modules and packages. The document also compares mutable lists and immutable tuples, and covers common list operations.
This document provides an overview of learning Python in three hours. It covers installing and running Python, basic data types like integers, floats and strings. It also discusses sequence types like lists, tuples and strings, including accessing elements, slicing, and using operators like + and *. The document explains basic syntax like comments, indentation and naming conventions. It provides examples of simple functions and scripts.
The WiMAX (IEEE 802.16e) standard offers peak data rates of 128Mbps downlink and
56Mbps uplink over 20MHz wide channels whilst the new standard in development, 4G
WiMAN-Advanced (802.16m) is targeting the requirements to be fully 4G using 64Q QAM,
BPSK and MIMO technologies to reach the 1Gbps rate. It is predicted that in an actual
deployment, using 4X2 MIMO in an urban microcell application using a 20 MHz TDD
channel, the 4G WiMAN-Advanced system will be able to support 120Mbps downlink and
60Mbps uplink per site concurrently. WiMAX applications are already in use in many countries
globally but research in 2010 gave results that showed only just over 350 set ups were actually
in use. Many previous WiMAX operators were found to have moved to LTE along with Yota,
who were the largest WiMAX operator in the world.
This document provides an overview of the Python programming language. It discusses Python's history, how to install and run Python, basic data types like integers, floats, strings, lists and tuples. It also covers topics like functions, modules, files, and classes in Python.
The document discusses several key points about Python:
1. It summarizes praise for Python from programmers and companies like Google, NASA, and CCP Games, highlighting Python's simplicity, compactness, and ability to quickly develop applications.
2. It introduces common Python concepts like strings, lists, sequences, namespaces, polymorphism, and duck typing. Strings can be manipulated using slicing and methods. Lists and other sequences support indexing, slicing, and iteration.
3. Python uses name-based rather than type-based polymorphism through duck typing - an object's capabilities are defined by its methods and properties rather than its class.
This document provides an overview of the Python programming language. It discusses Python's history and key features such as being an interpreted, object-oriented, and functional language. The document also covers installing Python, running Python scripts and programs, basic datatypes like integers and strings, sequence types like lists and tuples, and other basic concepts like functions, variables, and flow control.
The document provides an overview of the Python programming language. It discusses Python's history, how to install and run Python, basic data types like integers, floats, strings, lists and tuples. It explains key concepts like variable assignment, conditional statements, functions, modules and packages. The document also compares mutable lists and immutable tuples, and covers common list operations.
The document provides an overview of the Python programming language. It discusses Python's history, how to install and run Python, basic data types like integers, floats, strings, lists and tuples. It explains key concepts like variable assignment, basic operations, slicing of sequences, and how lists are mutable but tuples are immutable. The document is intended to teach Python fundamentals in about three hours.
This document provides an overview of the Python programming language. It discusses Python's history and key features such as being object-oriented, scalable, and functional from the beginning. It also covers installing Python, running Python programs, basic datatypes like integers and strings, sequence types like lists and tuples, and other basic concepts like functions, comments, and whitespace.
The document provides an overview of the Python programming language. It discusses Python's history, how to install and run Python, basic data types like integers, floats, strings, lists and tuples. It explains key concepts like variable assignment, basic operations, slicing of sequences, and how lists are mutable but tuples are immutable. The document is intended to teach Python fundamentals in about three hours.
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Zilliz
Join us to introduce Milvus Lite, a vector database that can run on notebooks and laptops, share the same API with Milvus, and integrate with every popular GenAI framework. This webinar is perfect for developers seeking easy-to-use, well-integrated vector databases for their GenAI apps.
Building RAG with self-deployed Milvus vector database and Snowpark Container...Zilliz
This talk will give hands-on advice on building RAG applications with an open-source Milvus database deployed as a docker container. We will also introduce the integration of Milvus with Snowpark Container Services.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
20 Comprehensive Checklist of Designing and Developing a WebsitePixlogix Infotech
Dive into the world of Website Designing and Developing with Pixlogix! Looking to create a stunning online presence? Look no further! Our comprehensive checklist covers everything you need to know to craft a website that stands out. From user-friendly design to seamless functionality, we've got you covered. Don't miss out on this invaluable resource! Check out our checklist now at Pixlogix and start your journey towards a captivating online presence today.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
3. What is Python?
• A programming language with strong
similarities to PERL, but with powerful
typing and object oriented features.
– Commonly used for producing HTML content
on websites. Great for text files.
– Useful built-in types (lists, dictionaries).
– Clean syntax, powerful extensions.
"Vibrant Technology & Computer"
Vashi, Navi mumbai
4. Why Python for CSE-391?
• Textbook Code: Very Object Oriented
– Python much less verbose than Java
• AI Processing: Symbolic
– Python’s built-in datatypes for strings, lists, and more.
– Java or C++ require the use of special classes for this.
• AI Processing: Statistical
– Python has strong numeric processing capabilities:
matrix operations, etc.
– Suitable for probability and machine learning code.
"Vibrant Technology & Computer"
Vashi, Navi mumbai
6. Installing Python
• Python is on eniac: /pkg/bin/python
• Python for Win/Mac from www.python.org.
• GUI development environment: IDLE.
Credits:
http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html
"Vibrant Technology & Computer"
Vashi, Navi mumbai
7. IDLE Development Environment
• Shell for interactive evaluation.
• Text editor with color-coding and smart
indenting for creating python files.
• Menu commands for changing system
settings and running files.
• You’ll see me using IDLE in class.
"Vibrant Technology & Computer"
Vashi, Navi mumbai
8. Running Interactively on UNIX
On Unix…
% python
>>> 3+3
6
The ‘>>>’ is the Python prompt. In Unix, when
finished, you can use CONTROL+D.
"Vibrant Technology & Computer"
Vashi, Navi mumbai
9. Running Programs on UNIX
% python filename.py
You can create python files using emacs.
(There’s a special Python editing mode.)
You could even make the *.py file executable
and add the following text to top of the file
to make it runable: #!/pkg/bin/python
"Vibrant Technology & Computer"
Vashi, Navi mumbai
11. Look at a sample of code…
x = 34 - 23 # A comment.
y = “Hello” # Another one.
z = 3.45
if z == 3.45 or y == “Hello”:
x = x + 1
y = y + “ World” # String concat.
print x
print y
"Vibrant Technology & Computer"
Vashi, Navi mumbai
12. Look at a sample of code…
x = 34 - 23 # A comment.
y = “Hello” # Another one.
z = 3.45
if z == 3.45 or y == “Hello”:
x = x + 1
y = y + “ World” # String concat.
print x
print y
"Vibrant Technology & Computer"
Vashi, Navi mumbai
13. Enough to Understand the Code
• Assignment uses = and comparison uses ==.
• For numbers +-*/% are as expected.
– Special use of + for string concatenation.
– Special use of % for string formatting.
• Logical operators are words (and, or, not)
not symbols (&&, ||, !).
• The basic printing command is “print.”
• First assignment to a variable will create it.
– Variable types don’t need to be declared.
– Python figures out the variable types on its own.
"Vibrant Technology & Computer"
Vashi, Navi mumbai
14. Basic Datatypes
• Integers (default for numbers)
z = 5 / 2 # Answer is 2, integer division.
• Floats
x = 3.456
• Strings
Can use “” or ‘’ to specify. “abc” ‘abc’ (Same thing.)
Unmatched ones can occur within the string. “matt’s”
Use triple double-quotes for multi-line strings or strings
than contain both ‘ and “ inside of them: “““a‘b“c”””
"Vibrant Technology & Computer"
Vashi, Navi mumbai
15. Whitespace
• Whitespace is meaningful in Python: especially
indentation and placement of newlines.
– Use a newline to end a line of code.
(Not a semicolon like in C++ or Java.)
(Use when must go to next line prematurely.)
– No braces { } to mark blocks of code in Python…
Use consistent indentation instead. The first line with a
new indentation is considered outside of the block.
– Often a colon appears at the start of a new block.
(We’ll see this later for function and class definitions.)
"Vibrant Technology & Computer"
Vashi, Navi mumbai
16. Comments
• Start comments with # – the rest of line is ignored.
• Can include a “documentation string” as the first
line of any new function or class that you define.
• The development environment, debugger, and
other tools use it: it’s good style to include one.
def my_function(x, y):
“““This is the docstring. This
function does blah blah blah.”””
# The code would go here...
"Vibrant Technology & Computer"
Vashi, Navi mumbai
17. Look at a sample of code…
x = 34 - 23 # A comment.
y = “Hello” # Another one.
z = 3.45
if z == 3.45 or y == “Hello”:
x = x + 1
y = y + “ World” # String concat.
print x
print y
"Vibrant Technology & Computer"
Vashi, Navi mumbai
19. Names and References 1
• Python has no pointers like C or C++. Instead, it has
“names” and “references”. (Works a lot like Lisp or Java.)
• You create a name the first time it appears on the left side
of an assignment expression:
x = 3
• Names store “references” which are like pointers to
locations in memory that store a constant or some object.
– Python determines the type of the reference automatically based
on what data is assigned to it.
– It also decides when to delete it via garbage collection after any
names for the reference have passed out of scope.
"Vibrant Technology & Computer"
Vashi, Navi mumbai
20. Names and References 2
• There is a lot going on when we type:
x = 3
• First, an integer 3 is created and stored in memory.
• A name x is created.
• An reference to the memory location storing the 3
is then assigned to the name x.
Type: Integer
Data: 3
Name: x
Ref: <address1>
name list memory
"Vibrant Technology & Computer"
Vashi, Navi mumbai
21. Names and References 3
• The data 3 we created is of type integer. In
Python, the basic datatypes integer, float, and
string are “immutable.”
• This doesn’t mean we can’t change the value of
x… For example, we could increment x.
>>> x = 3
>>> x = x + 1
>>> print x
4
"Vibrant Technology & Computer"
Vashi, Navi mumbai
22. Names and References 4
• If we increment x, then what’s really happening is:
– The reference of name x is looked up.
– The value at that reference is retrieved.
– The 3+1 calculation occurs, producing a new data element 4 which
is assigned to a fresh memory location with a new reference.
– The name x is changed to point to this new reference.
– The old data 3 is garbage collected if no name still refers to it.
Type: Integer
Data: 3Name: x
Ref: <address1>
"Vibrant Technology & Computer"
Vashi, Navi mumbai
23. Names and References 4
• If we increment x, then what’s really happening is:
– The reference of name x is looked up.
– The value at that reference is retrieved.
– The 3+1 calculation occurs, producing a new data element 4 which
is assigned to a fresh memory location with a new reference.
– The name x is changed to point to this new reference.
– The old data 3 is garbage collected if no name still refers to it.
Type: Integer
Data: 3Name: x
Ref: <address1>
Type: Integer
Data: 4
"Vibrant Technology & Computer"
Vashi, Navi mumbai
24. Names and References 4
• If we increment x, then what’s really happening is:
– The reference of name x is looked up.
– The value at that reference is retrieved.
– The 3+1 calculation occurs, producing a new data element 4 which
is assigned to a fresh memory location with a new reference.
– The name x is changed to point to this new reference.
– The old data 3 is garbage collected if no name still refers to it.
Type: Integer
Data: 3Name: x
Ref: <address2>
Type: Integer
Data: 4
"Vibrant Technology & Computer"
Vashi, Navi mumbai
25. Names and References 4
• If we increment x, then what’s really happening is:
– The reference of name x is looked up.
– The value at that reference is retrieved.
– The 3+1 calculation occurs, producing a new data element 4 which
is assigned to a fresh memory location with a new reference.
– The name x is changed to point to this new reference.
– The old data 3 is garbage collected if no name still refers to it.
Name: x
Ref: <address2>
Type: Integer
Data: 4
"Vibrant Technology & Computer"
Vashi, Navi mumbai
26. Assignment 1
• So, for simple built-in datatypes (integers, floats,
strings), assignment behaves as you would expect:
>>> x = 3 # Creates 3, name x refers to 3
>>> y = x # Creates name y, refers to 3.
>>> y = 4 # Creates ref for 4. Changes y.
>>> print x # No effect on x, still ref 3.
3
"Vibrant Technology & Computer"
Vashi, Navi mumbai
27. Assignment 1
• So, for simple built-in datatypes (integers, floats,
strings), assignment behaves as you would expect:
>>> x = 3 # Creates 3, name x refers to 3
>>> y = x # Creates name y, refers to 3.
>>> y = 4 # Creates ref for 4. Changes y.
>>> print x # No effect on x, still ref 3.
3
Type: Integer
Data: 3
Name: x
Ref: <address1>
"Vibrant Technology & Computer"
Vashi, Navi mumbai
28. Assignment 1
• So, for simple built-in datatypes (integers, floats,
strings), assignment behaves as you would expect:
>>> x = 3 # Creates 3, name x refers to 3
>>> y = x # Creates name y, refers to 3.
>>> y = 4 # Creates ref for 4. Changes y.
>>> print x # No effect on x, still ref 3.
3
Type: Integer
Data: 3
Name: x
Ref: <address1>
Name: y
Ref: <address1>
"Vibrant Technology & Computer"
Vashi, Navi mumbai
29. Assignment 1
• So, for simple built-in datatypes (integers, floats,
strings), assignment behaves as you would expect:
>>> x = 3 # Creates 3, name x refers to 3
>>> y = x # Creates name y, refers to 3.
>>> y = 4 # Creates ref for 4. Changes y.
>>> print x # No effect on x, still ref 3.
3
Type: Integer
Data: 3
Name: x
Ref: <address1>
Type: Integer
Data: 4
Name: y
Ref: <address1>
"Vibrant Technology & Computer"
Vashi, Navi mumbai
30. Assignment 1
• So, for simple built-in datatypes (integers, floats,
strings), assignment behaves as you would expect:
>>> x = 3 # Creates 3, name x refers to 3
>>> y = x # Creates name y, refers to 3.
>>> y = 4 # Creates ref for 4. Changes y.
>>> print x # No effect on x, still ref 3.
3
Type: Integer
Data: 3
Name: x
Ref: <address1>
Type: Integer
Data: 4
Name: y
Ref: <address2>
"Vibrant Technology & Computer"
Vashi, Navi mumbai
31. Assignment 1
• So, for simple built-in datatypes (integers, floats,
strings), assignment behaves as you would expect:
>>> x = 3 # Creates 3, name x refers to 3
>>> y = x # Creates name y, refers to 3.
>>> y = 4 # Creates ref for 4. Changes y.
>>> print x # No effect on x, still ref 3.
3
Type: Integer
Data: 3
Name: x
Ref: <address1>
Type: Integer
Data: 4
Name: y
Ref: <address2>
"Vibrant Technology & Computer"
Vashi, Navi mumbai
32. Assignment 2
• For other data types (lists, dictionaries, user-defined
types), assignment works differently.
– These datatypes are “mutable.”
– When we change these data, we do it in place.
– We don’t copy them into a new memory address each time.
– If we type y=x and then modify y, both x and y are changed!
– We’ll talk more about “mutability” later.
>>> x = 3 x = some mutable object
>>> y = x y = x
>>> y = 4 make a change to y
>>> print x look at x
3 x will be changed as well
immutable mutable
"Vibrant Technology & Computer"
Vashi, Navi mumbai
34. Container Types
• We’ve talked about integers, floats, and strings…
• Containers are other built-in data types in Python.
– Can hold objects of any type (including their own
type).
– There are three kinds of containers:
Tuples
• A simple immutable ordered sequence of items.
Lists
• Sequence with more powerful manipulations possible.
Dictionaries
• A look-up table of key-value pairs."Vibrant Technology & Computer"
Vashi, Navi mumbai
36. Similar Syntax
• Tuples and lists are sequential containers that
share much of the same syntax and functionality.
– For conciseness, they will be introduced together.
– The operations shown in this section can be applied to
both tuples and lists, but most examples will just show
the operation performed on one or the other.
• While strings aren’t exactly a container data type,
they also happen to share a lot of their syntax with
lists and tuples; so, the operations you see in this
section can apply to them as well.
"Vibrant Technology & Computer"
Vashi, Navi mumbai
37. Tuples, Lists, and Strings 1
• Tuples are defined using parentheses (and commas).
>>> tu = (23, ‘abc’, 4.56, (2,3), ‘def’)
• Lists are defined using square brackets (and commas).
>>> li = [“abc”, 34, 4.34, 23]
• Strings are defined using quotes (“, ‘, or “““).
>>> st = “Hello World”
>>> st = ‘Hello World’
>>> st = “““This is a multi-line
string that uses triple quotes.”””
"Vibrant Technology & Computer"
Vashi, Navi mumbai
38. Tuples, Lists, and Strings 2
• We can access individual members of a tuple, list,
or string using square bracket “array” notation.
>>> tu[1] # Second item in the tuple.
‘abc’
>>> li[1] # Second item in the list.
34
>>> st[1] # Second character in string.
‘e’
"Vibrant Technology & Computer"
Vashi, Navi mumbai
39. Looking up an Item
>>> t = (23, ‘abc’, 4.56, (2,3), ‘def’)
Positive index: count from the left, starting with 0.
>>> t[1]
‘abc’
Negative lookup: count from right, starting with –1.
>>> t[-3]
4.56
"Vibrant Technology & Computer"
Vashi, Navi mumbai
40. Slicing: Return Copy of a Subset 1
>>> t = (23, ‘abc’, 4.56, (2,3), ‘def’)
Return a copy of the container with a subset of the
original members. Start copying at the first index,
and stop copying before the second index.
>>> t[1:4]
(‘abc’, 4.56, (2,3))
You can also use negative indices when slicing.
>>> t[1:-1]
(‘abc’, 4.56, (2,3))"Vibrant Technology & Computer"
Vashi, Navi mumbai
41. Slicing: Return Copy of a Subset 2
>>> t = (23, ‘abc’, 4.56, (2,3), ‘def’)
Omit the first index to make a copy starting from the
beginning of the container.
>>> t[:2]
(23, ‘abc’)
Omit the second index to make a copy starting at the
first index and going to the end of the container.
>>> t[2:]
(4.56, (2,3), ‘def’)"Vibrant Technology & Computer"
Vashi, Navi mumbai
42. Copying the Whole Container
You can make a copy of the whole tuple using [:].
>>> t[:]
(23, ‘abc’, 4.56, (2,3), ‘def’)
So, there’s a difference between these two lines:
>>> list2 = list1 # 2 names refer to 1 ref
# Changing one affects both
>>> list2 = list1[:] # Two copies, two refs
# They’re independent
"Vibrant Technology & Computer"
Vashi, Navi mumbai
43. The ‘in’ Operator
• Boolean test whether a value is inside a container:
>>> t = [1, 2, 4, 5]
>>> 3 in t
False
>>> 4 in t
True
>>> 4 not in t
False
• Be careful: the ‘in’ keyword is also used in the
syntax of other unrelated Python constructions:
“for loops” and “list comprehensions.”"Vibrant Technology & Computer"
Vashi, Navi mumbai
44. The + Operator
• The + operator produces a new tuple, list, or string
whose value is the concatenation of its arguments.
>>> (1, 2, 3) + (4, 5, 6)
(1, 2, 3, 4, 5, 6)
>>> [1, 2, 3] + [4, 5, 6]
[1, 2, 3, 4, 5, 6]
>>> “Hello” + “ ” + “World”
‘Hello World’"Vibrant Technology & Computer"
Vashi, Navi mumbai
45. The * Operator
• The * operator produces a new tuple, list, or string
that “repeats” the original content.
>>> (1, 2, 3) * 3
(1, 2, 3, 1, 2, 3, 1, 2, 3)
>>> [1, 2, 3] * 3
[1, 2, 3, 1, 2, 3, 1, 2, 3]
>>> “Hello” * 3
‘HelloHelloHello’
"Vibrant Technology & Computer"
Vashi, Navi mumbai
47. Tuples: Immutable
>>> t = (23, ‘abc’, 4.56, (2,3), ‘def’)
>>> t[2] = 3.14
Traceback (most recent call last):
File "<pyshell#75>", line 1, in -toplevel-
tu[2] = 3.14
TypeError: object doesn't support item assignment
You’re not allowed to change a tuple in place in memory; so,
you can’t just change one element of it.
But it’s always OK to make a fresh tuple and assign its
reference to a previously used name.
>>> t = (1, 2, 3, 4, 5)
"Vibrant Technology & Computer"
Vashi, Navi mumbai
48. Lists: Mutable
>>> li = [‘abc’, 23, 4.34, 23]
>>> li[1] = 45
>>> li
[‘abc’, 45, 4.34, 23]
We can change lists in place. So, it’s ok to change
just one element of a list. Name li still points to the
same memory reference when we’re done.
"Vibrant Technology & Computer"
Vashi, Navi mumbai
49. Operations on Lists Only 1
• Since lists are mutable (they can be changed
in place in memory), there are many more
operations we can perform on lists than on
tuples.
• The mutability of lists also makes managing
them in memory more complicated… So,
they aren’t as fast as tuples. It’s a tradeoff.
"Vibrant Technology & Computer"
Vashi, Navi mumbai
51. Operations on Lists Only 3
The ‘extend’ operation is similar to concatenation with the +
operator. But while the + creates a fresh list (with a new
memory reference) containing copies of the members from
the two inputs, the extend operates on list li in place.
>>> li.extend([9, 8, 7])
>>>li
[1, 2, ‘i’, 3, 4, 5, ‘a’, 9, 8, 7]
Extend takes a list as an argument. Append takes a singleton.
>>> li.append([9, 8, 7])
>>> li
[1, 2, ‘i’, 3, 4, 5, ‘a’, 9, 8, 7, [9, 8, 7]]
"Vibrant Technology & Computer"
Vashi, Navi mumbai
52. Operations on Lists Only 4
>>> li = [‘a’, ‘b’, ‘c’, ‘b’]
>>> li.index(‘b’) # index of first occurrence
1
>>> li.count(‘b’) # number of occurrences
2
>>> li.remove(‘b’) # remove first occurrence
>>> li
[‘a’, ‘c’, ‘b’]
"Vibrant Technology & Computer"
Vashi, Navi mumbai
53. Operations on Lists Only 5
>>> li = [5, 2, 6, 8]
>>> li.reverse() # reverse the list *in place*
>>> li
[8, 6, 2, 5]
>>> li.sort() # sort the list *in place*
>>> li
[2, 5, 6, 8]
>>> li.sort(some_function)
# sort in place using user-defined comparison
"Vibrant Technology & Computer"
Vashi, Navi mumbai
54. Tuples vs. Lists
• Lists slower but more powerful than tuples.
– Lists can be modified, and they have lots of handy
operations we can perform on them.
– Tuples are immutable and have fewer features.
• We can always convert between tuples and lists
using the list() and tuple() functions.
li = list(tu)
tu = tuple(li)
"Vibrant Technology & Computer"
Vashi, Navi mumbai
56. Assignment & Mutability 1
• Remember that assignment works differently for
mutable vs. immutable datatypes.
– If you type y=x, then changing y:
…will change x if they are mutable.
…won’t change x if they are immutable.
>>> x = 3 >>> x = [ 1, 2, 3]
>>> y = x >>> y = x
>>> y = y + 1 >>> y.reverse()
>>> print x >>> print x
3 [ 3, 2, 1]
immutable mutable
"Vibrant Technology & Computer"
Vashi, Navi mumbai
57. Assignment & Mutability 2
Python is object-oriented, and user-defined classes are mutable.
Let’s say that the name x refers to an object of some class.
This class has a “set” and a “get” function for some value.
>>> x.getSomeValue()
4
What happens if we create a new name y and set y=x ?
>>> y = x
This creates a new name y which points to the same memory
reference as the name x. Now, if we make some change to y,
then x will be affected as well.
>>> y.setSomeValue(3)
>>> y.getSomeValue()
3
>>> x.getSomeValue()
3
"Vibrant Technology & Computer"
Vashi, Navi mumbai
58. Assignment & Mutability 3
• When passing parameters to functions:
– Immutable data types are “call by value.”
– Mutable data types are “call by reference.”
– If you pass mutable data to a function, and you
change it inside that function, the changes will
persist after the function returns.
– Immutable data appear unchanged inside of
functions to which they are passed.
"Vibrant Technology & Computer"
Vashi, Navi mumbai
59. Naming Rules
• Names are case sensitive and cannot start with a
number. They can contain letters, numbers, and
underscores.
bob Bob _bob _2_bob_ bob_2 BoB
• There are some reserved words:
and, assert, break, class, continue,
def, del, elif, else, except, exec,
finally, for, from, global, if,
import, in, is, lambda, not, or,
pass, print, raise, return, try,
while
"Vibrant Technology & Computer"
Vashi, Navi mumbai
60. Accessing Non-Existent Name
• If you try to access a name before it’s been
properly created (by placing it on the left side of
an assignment), you’ll get an error.
>>> y
Traceback (most recent call last):
File "<pyshell#16>", line 1, in -toplevel-
y
NameError: name ‘y' is not defined
>>> y = 3
>>> y
3 "Vibrant Technology & Computer"
Vashi, Navi mumbai
61. Multiple Assignment
• You can also assign to multiple names at the same
time.
>>> x, y = 2, 3
>>> x
2
>>> y
3
"Vibrant Technology & Computer"
Vashi, Navi mumbai