Tutorial 4- Julia For Data Science-String In Julia Along With Indepth Functions

Krish Naik · Intermediate ·📐 ML Fundamentals ·5y ago

Key Takeaways

Covers strings and in-depth functions in Julia programming language

Full Transcript

hello all my name is krishna again welcome to my youtube channel so guys we are into the tutorial four of julia programming language and in this video we are going to see strings we'll try to see how we can create strings what are the different inbuilt functions apart from that also we are going to see a lot of operations in my previous video i've already given you the basic functionality like how you can actually create strings in julia and it is almost like python programming language but here we are going to deep dive into many more the many more things as such so to begin with first of all whenever we are talking about strings you know if we have multiple words right if we have more than one characters i can definitely consider that as a word and if i have more words i can consider that as a sentence right so initially you should know how to create characters so in this case you will be able to see that characters over here can be defined by single inverted commas okay so if i try to define something like this so suppose if i write n so this n will be a character and it is always denoted by an axi or a unicode you know by this right so this is a kind of unicode you can also convert a character into a unicode also always remember that each and every unit code is unique with respect to different different characters okay so this is the thing more information about it you'll also be able to see that you'll be getting information like whether it is uppercase lowercase like if i make it as small n so definitely i'll be getting it as lowercase and this is basically a category l1 which is also called as letter okay so remember in python programming language or let it be a single character let it be multiple number of words let it be a whole sentence i can write it in one single quotes or double quotes but in case of julia whenever we are writing string whenever we are writing characters we have to actually use single inverted comma okay so here is another example where i've actually written k so here you can see that k is over there and for this again you have a different unique unicode right so here you have capital k like this now the next thing is that we can convert this character into integers how do we convert it by default we have this int right so int function is over here whatever functionality whatever character i am giving inside this it will automatically get converted into a unique integer which is representing that particular character okay so this is basically 75 it is representing k if i make it as small l then it will become 108 if i really want to go and check capital a i'll be getting 65 right so here you'll be able to see different different uh unique integers with respect to that particular character not only that i will also have probably for a special characters like uh suppose if i take uh you know let me let me take some more characters like q right so here you will be able to see that i am getting 113 now similarly with respect to this if i i can also convert this integers into characters right how do i use it i'll be using an inbuilt function which is called a scat and here i'll be providing 75 like in this particular case 75 is nothing but k right if i give 1 1 3 so this will actually be q right so these are some of the basic functionality we can convert the characters into strings sorry character into integers integers into characters and various things right each and every character is represented by this unique values we can also use some comparison operators like i can write int capital k is less than in k right in this particular case obviously i'll be getting true because if i go and find out what is into k then you will be able to see that i will be having some values over here which is like 107 okay and if i say capital k capital k is nothing but uh how much it is let's see for capital k i will be getting 75 so obviously 75 is less than 107 so we are getting it as true i can also perform arithmetic operations like in characters if i'm performing arithmetic operation like suppose k is over here right if i say k plus 1 that basically means j k l right after capital k then we have capital l so if i execute this you will be able to see capital l over here right which is a pretty amazing right if i also will make it like plus 2 k l m so here probably i'll be getting m if i write plus 25 then i'm actually getting d so we can actually write that whole abcd right and we can assign values to that and based on that this particular operation is actually taking place now let's see whether multiplication will also work or not so here you'll be able to see that this kind of operation will not work but if you really want to increment with respect to characters we can definitely use plus okay now let's go towards the string basics so here in order to write a string here we had just written character right but whenever we are writing word or sentences we have to basically use double quotes and in my previous session that is tutorial three i had actually said i had actually explained about it okay so here you can see hello my name is krish okay now let's start with some of the inbuilt keywords in string okay so whenever i use and here this is nothing but slicing operations also guys here i'm also going to discuss about slicing operations okay and this slicing operations is similar to the python programming language like whatever we discussed over there okay now inside this whenever suppose i want to take out this h and we know that this h is the first character of the string right i just want to take out h in order to take out that h the first character i can definitely give this value as 1 okay if i give str of 1 i'll also be getting h if i give str of 0 right i will be getting an error this basically shows that the indexing in julia programming language starts from one whereas in python programming language it starts from zero right i hope everybody knows that so if i write str of one then only i'll be getting h now if i want to just get the first character i can also use an inbuilt keyword which is called as begin okay so by executing this here also you'll be able to get the first character like how you have begin we also have end to get the last character so here you can see hello my name is krish the last character is h so if i really want to execute this i'll be able to get this right so by this we are actually able to get it now suppose i want to pick up any single character like suppose i want to pick up this o so o will be present in which index position one two three four five so if i write h t s t r of five right i will actually be getting this o symbol right pretty much simple this is the lower case now this is my str1 hello okay if i use a length uh like in python you have len right here you have length so if i go and find out this length it is basically str1 now let's let's try with respect to str1 okay now suppose if i really want to get the first character by using indexing i can use a square braces and i can provide that a particular index number suppose if i provide 1 i'll be getting h if i provide 3 i'll be getting l right if i provide 5 i'll be getting o but if i provide 6 it will give me an index out of bound that is the boundary attempts to access string right so always remember it similarly works like python i can also give like slicing operation i can say from one till three i want all the characters so one two three right one two three so here when i execute it i'll be actually getting like this now one one thing that you need to focus over here guys when i started indexing and i gave this range as one colon three in python this will behave little bit in a different way let me just create a new notebook file and show it to you suppose if i write str is equal to hello and this is with respect to python guys just see this okay hello okay and here i will write str one colon three right sorry i'll not just make this as str but instead there also is an inbuilt keyword in python so i'll execute this and here i will write str1 1 colon 3 so here you will be able to see that it starts from one index okay and it will just read within the third index right el but in this case whenever we are giving one colon three it is basically starting from the first index which is my first value and then it goes till the third index right and it pick ups all the character right in this particular case suppose if i am giving three before three how many characters are there it will try to pick up in that specific range so that is the basic difference between python and julia okay there are also some inbuilt function in julia which is called as first index by just writing first index and if you provide your string one you'll be able to get the index number of the string one so first index first index value is h first index is one so by this you will be able to get one last index you will be able to get what is the length of the string or string or word okay so here it is so the next thing is that you can also perform some operations inside the indexing slice right the slice where you're providing or indexing techniques that you are providing can also provide some kind of operations remember one thing guys here i have written end divided by two we know that if i go and use end over here it is basically going towards the last character now here i'm actually going to specify n divided by 2 and basically means 5 right because hello hello one suppose this is my string right over here i have 5 words 5 divided by 2 okay it will be 2.5 and you see over here 2.5 and when i'm picking it up i'm basically picking up the e so it is basically going towards the floor side 2.5 instead of 2.5 takes 2. if it takes 2 since i have hello over here like this if i have hello over here then that basically means it is going to pick up this particular character that is e right pretty much simple and remember guys the division symbol you will not be giving like this if you give like this it will not work it will give you an error with respect to indexing but instead it you will try to give something like this okay only that is the thing but numerical operation you will be using that division only and this order technique is also there it says n minus 2 n minus 2 basically means this is my end minus 2 1 and this you will be basically getting l so here you will be getting this particular value that is l right pretty much simple pretty much easy right in julia you can also pick up the substring of from a particular sentence like in this particular case i have written in this particular case i have written str okay so str you are getting as julia programming language so once you execute this and now you can use substring okay substring substring this is a function over here and if you press shift tab it says that it returns a view into the parent s with a string i colon z let's see what it is first of all i'll give my string value over here then i'll write 1 comma 5. now what this is 1 comma psi 5 says that between the index of 1 to 5 i want to pick up the substring so by this you are actually getting julia over here right so here you can see one two three four five if i change this suppose i want between 10 to 15 probably i have that so here you will be able to see that it is picking up this particular value okay and if you go and see the type of substring it will be a substring type okay substring type now the next operation which i had already taken this is called as concatenation operation in concatenation operation i can combine two sentences like str1 htr 2 suppose if i go and execute this you will be seeing krishnak right now if i really want to concatenate this so i'll be using the string class and inside this i'll say string1 comma string2 now by this you'll be able to see that i'm writing krishnak right i can also give one additional space between this and i can execute this so here you can see that i'm getting krishna okay now similarly you'll be able to see that i can also add any number of words to concatenates but by using the string we can concatenate any number of words let it be inside a variable let it be inside a let it be a string character let it be anything as such okay so we can actually combine any number of words okay the next thing is basically called as interpolation now in interpolation we can actually do something very much amazing which again i had shown in my previous class suppose i say my first name last name is krishnak and my date of birth is 1990. now i can print this in a very amazing way see i can write my first name is suppose i want to basically write down the variable over here okay i really want to write down or place this particular value like krish i want to place this particular value with this placeholder like at that time i can just use dollar first name then i can actually write dollar last underscore name and i can say my age is dollar 2020 minus dob see whenever we write this dollar this is basically just like replacing a variable in that specific placeholder okay so here you can see my first name over here i'm writing it as krish my last name i'm writing it as nai and my age is 20 20 minus dob so once i execute this you'll be able to see that i'm getting this my first name is krish last name is nike and age is 30. so in short what is this interpolation is that we can use dollar operation inside a string and we can perform any mathematical operation like how we have performed over here so here you will be able to see 2010. similarly i had shown you with respect to if you really want to write a string in multiple lines you can use triple quoted string literals so here is the way that how you can actually show it and these are some of the common operations like 1 plus 2 is equal to 3 i've written in string but here i've done some computation like dollar 1 plus 2 this will also give me the same output so it is actually giving the truth symbol right similarly i can do the comparison like krishnak is double equal to krish space snack it will give us false like this lot of inbuilt function lot of operations are actually there so i hope you like this particular video with respect to tutorial full i'll be putting up this whole code in the github you just try it by yourself and make sure that you watch this video from the first tutorial of julia if you are new to julia itself the playlist link will be given in the description so i'll see you all in the next video and please do subscribe the channel and share with all your friends guys uh and yes uh please do learn it yes and it will be a pretty amazing thing so i'll see you all in the next video have a great day thank you bye

Original Description

github: https://github.com/krishnaik06/Julia-Programming-With-MAchine-Learning Julia is a high-level, high-performance, dynamic programming language. While it is a general purpose language and can be used to write any application, many of its features are well-suited for numerical analysis and computational science Distinctive aspects of Julia's design include a type system with parametric polymorphism in a dynamic programming language; with multiple dispatch as its core programming paradigm. Julia supports concurrent, (composable) parallel and distributed computing (with or without using MPI and/or the built-in corresponding[clarification needed][20] to "OpenMP-style" threads), and direct calling of C and Fortran libraries without glue code. Julia uses a just-in-time (JIT) compiler that is referred to as "just-ahead-of-time" (JAOT) in the Julia community, as Julia compiles (on default settings) to machine code before running it. ⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for a few months and I love it! https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=krishnaik&utm_content=description-only All Playlist In My channel Julia Playlist: https://www.youtube.com/watch?v=Bxp1YFA6M4s&list=PLZoTAELRMXVPJwtjTo2Y6LkuuYK0FT4Q- Complete ML Playlist :https://www.youtube.com/playlist?list=PLZoTAELRMXVPBTrWtJkn3wWQxZkmTXGwe Complete NLP Playlist:https://www.youtube.com/playlist?list=PLZoTAELRMXVMdJ5sqbCK2LiM0HhQVWNzm Docker End To End Implementation: https://www.youtube.com/playlist?list=PLZoTAELRMXVNKtpy0U_Mx9N26w8n0hIbs Live stream Playlist: https://www.youtube.com/playlist?list=PLZoTAELRMXVNxYFq_9MuiUdn2YnlFqmMK Machine Learning Pipelines: https://www.youtube.com/playlist?list=PLZoTAELRMXVNKtpy0U_Mx9N26w8n0hIbs Pytorch Playlist: https://www.youtube.co
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Krish Naik · Krish Naik · 0 of 60

← Previous Next →
1 Natural Language Processing|Stemming
Natural Language Processing|Stemming
Krish Naik
2 Natural Language Processing|BagofWords
Natural Language Processing|BagofWords
Krish Naik
3 Gaussian distribution or Normal Distribution in statisctics
Gaussian distribution or Normal Distribution in statisctics
Krish Naik
4 Natural Language Processing|TF-IDF for Machine Learning| Text Prerocessing
Natural Language Processing|TF-IDF for Machine Learning| Text Prerocessing
Krish Naik
5 Log Normal Distribution in Statistics
Log Normal Distribution in Statistics
Krish Naik
6 Covariance in Statistics
Covariance in Statistics
Krish Naik
7 Confusion matrix, Precision, Recall| Data Science Interview questions
Confusion matrix, Precision, Recall| Data Science Interview questions
Krish Naik
8 Tutorial 44-Balanced vs Imbalanced Dataset and how to handle Imbalanced Dataset
Tutorial 44-Balanced vs Imbalanced Dataset and how to handle Imbalanced Dataset
Krish Naik
9 Implementing a Spam classifier in python| Natural Language Processing
Implementing a Spam classifier in python| Natural Language Processing
Krish Naik
10 Tutorial 11-Exploratory Data Analysis(EDA) of Titanic dataset
Tutorial 11-Exploratory Data Analysis(EDA) of Titanic dataset
Krish Naik
11 Face Recognition using open CV and VGG 16 Transfer Learning
Face Recognition using open CV and VGG 16 Transfer Learning
Krish Naik
12 Pedestrian Detection using OpenCV from Videos
Pedestrian Detection using OpenCV from Videos
Krish Naik
13 Face and Eye Detection from Videos using HAAR Cascade Classifier
Face and Eye Detection from Videos using HAAR Cascade Classifier
Krish Naik
14 Reading, Writing and Displaying images with Opencv| OpenCV Tutorial
Reading, Writing and Displaying images with Opencv| OpenCV Tutorial
Krish Naik
15 OpenCV Installation | OpenCV tutorial
OpenCV Installation | OpenCV tutorial
Krish Naik
16 Face and Eye Detection from Images using HAAR Cascade Classifier
Face and Eye Detection from Images using HAAR Cascade Classifier
Krish Naik
17 Car Detection using HAAR Cascade and Opencv from Videos.
Car Detection using HAAR Cascade and Opencv from Videos.
Krish Naik
18 Using OpenFace for Face recognition in Keras
Using OpenFace for Face recognition in Keras
Krish Naik
19 OpenPose Tutorial with Tensorflow
OpenPose Tutorial with Tensorflow
Krish Naik
20 Multiple Linear Regression using python and sklearn
Multiple Linear Regression using python and sklearn
Krish Naik
21 Dimensional Reduction| Principal Component Analysis
Dimensional Reduction| Principal Component Analysis
Krish Naik
22 Movie Recommender System using Python
Movie Recommender System using Python
Krish Naik
23 TPR,FPR,FNR,TNR, Confusion Matrix
TPR,FPR,FNR,TNR, Confusion Matrix
Krish Naik
24 Precision, Recall and F1-Score
Precision, Recall and F1-Score
Krish Naik
25 Artificial Neural Network for Customer's Exit Prediction from Bank
Artificial Neural Network for Customer's Exit Prediction from Bank
Krish Naik
26 GridSearchCV- Select the best hyperparameter for any Classification Model
GridSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
27 RandomizedSearchCV- Select the best hyperparameter for any Classification Model
RandomizedSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
28 K Nearest Neighbor classification with Intuition and practical solution
K Nearest Neighbor classification with Intuition and practical solution
Krish Naik
29 K Means Clustering Intuition
K Means Clustering Intuition
Krish Naik
30 Create custom Alexa Skill- Lambda function- Part2
Create custom Alexa Skill- Lambda function- Part2
Krish Naik
31 Hierarchical Clustering intuition
Hierarchical Clustering intuition
Krish Naik
32 Implement Transfer Learning with a generic Code Template
Implement Transfer Learning with a generic Code Template
Krish Naik
33 Gender Classifier and Age Estimator using Resnet Convolution Neural Network
Gender Classifier and Age Estimator using Resnet Convolution Neural Network
Krish Naik
34 Unlock Your Application With Your Face using OpenCV
Unlock Your Application With Your Face using OpenCV
Krish Naik
35 Draw rectangle from webcam and sketch process it on a live feed
Draw rectangle from webcam and sketch process it on a live feed
Krish Naik
36 Complete Life Cycle of a Data Science Project
Complete Life Cycle of a Data Science Project
Krish Naik
37 How we can apply Machine Learning in Finance
How we can apply Machine Learning in Finance
Krish Naik
38 Deep Learning in Medical Science
Deep Learning in Medical Science
Krish Naik
39 How to switch your career to Data Science.
How to switch your career to Data Science.
Krish Naik
40 Linear Regression Mathematical Intuition
Linear Regression Mathematical Intuition
Krish Naik
41 Handle Categorical features using Python
Handle Categorical features using Python
Krish Naik
42 Machine Learning Algorithm- Which one to choose for your Problem?
Machine Learning Algorithm- Which one to choose for your Problem?
Krish Naik
43 DBSCAN Clustering Easily Explained with Implementation
DBSCAN Clustering Easily Explained with Implementation
Krish Naik
44 Curse of Dimensionality Easily explained| Machine Learning
Curse of Dimensionality Easily explained| Machine Learning
Krish Naik
45 Feature Selection Techniques Easily Explained | Machine Learning
Feature Selection Techniques Easily Explained | Machine Learning
Krish Naik
46 Tutorial 29-R square and Adjusted R square Clearly Explained| Machine Learning
Tutorial 29-R square and Adjusted R square Clearly Explained| Machine Learning
Krish Naik
47 Cross Validation using sklearn and python | Machine Learning
Cross Validation using sklearn and python | Machine Learning
Krish Naik
48 Handling Missing Data Easily Explained| Machine Learning
Handling Missing Data Easily Explained| Machine Learning
Krish Naik
49 Deploy Machine Learning Model using Flask
Deploy Machine Learning Model using Flask
Krish Naik
50 Deployment of Deep Learning Model using Flask
Deployment of Deep Learning Model using Flask
Krish Naik
51 How to Visualize Multiple Linear Regression in python
How to Visualize Multiple Linear Regression in python
Krish Naik
52 K Nearest Neighbour Easily Explained with Implementation
K Nearest Neighbour Easily Explained with Implementation
Krish Naik
53 Predicting Heart Disease using Machine Learning
Predicting Heart Disease using Machine Learning
Krish Naik
54 Predicting Lungs Disease using Deep Learning
Predicting Lungs Disease using Deep Learning
Krish Naik
55 Stock Sentiment Analysis using News Headlines
Stock Sentiment Analysis using News Headlines
Krish Naik
56 Random Forest(Bootstrap Aggregation) Easily Explained
Random Forest(Bootstrap Aggregation) Easily Explained
Krish Naik
57 Voting Classifier(Hard Voting and Soft Voting Classifier)
Voting Classifier(Hard Voting and Soft Voting Classifier)
Krish Naik
58 Credit Card Fraud Detection using Machine Learning from Kaggle
Credit Card Fraud Detection using Machine Learning from Kaggle
Krish Naik
59 Hyperparameter Optimization for Xgboost
Hyperparameter Optimization for Xgboost
Krish Naik
60 Tutorial 45-Handling imbalanced Dataset  using python- Part 1
Tutorial 45-Handling imbalanced Dataset using python- Part 1
Krish Naik

Related Reads

📰
Natural Language Processing (NLP)!
Learn how computers understand human language through Natural Language Processing (NLP) and its applications
Medium · NLP
📰
8 Python Skills That Separate Beginners From Professionals
Learn 8 essential Python skills to transition from beginner to professional and start solving real-world problems
Medium · Programming
📰
8 Python Skills That Separate Beginners From Professionals
Take your Python skills to the next level by learning 8 key skills that separate beginners from professionals, enabling you to solve real-world problems efficiently
Medium · Python
📰
Sapient Interview Experience: Complete Guide to Java, Selenium, API Testing, and Automation…
Learn how to prepare for Automation Testing interviews with a focus on Java, Selenium, API Testing, and Automation
Medium · Programming
Up next
Solve a Murder Mystery with Me Using Bayes’ Theorem 🕵️‍♀️ | Bayesian Reasoning Explained
Pavithra’s Podcast
Watch →