Table of Contents
ToggleAny person having some programming background is aware of what is a data type. It is the type/category which describes the data. Generally in any programming language, there are few data types . “int”—integer data type which deals with integers, “str/char”—string or character data type which takes care of characters, “float”—float data type for decimal numbers, “complex”—complex data type that deals with complex numbers, “bool”—Boolean data type (True/False), etc. Are you looking to become a Data Scientist? Go through 360DigiTMG’s PG Diploma in Data Science and Artificial Intelligence!
In Python also we have these data types. In addition to these, we have other data structures as well. They are
i) List ii)Tuple iii)dictionary iv)Set v)Frozenset vi)String.
We will go through them in detail.
Want to learn more about data science? Enroll in the Data Science Classes in Pune to do so.
i)List:
The list is a sequential, mutable, and indexible data structure. It is an array-like structure. We can store different types of data together. Generally, we use square brackets [ ] to create a list.
Ex: list1=[1,’data’,3+5j, True]
We can access individual elements of a list through index numbers and even we can modify them.
list1[2] — 3+5j
list1[1]=55.40
list1— [1,55.40,3+5j,True]
ii)Tuple:
It is a sequential, immutable, and indexible data structure. It is just like a list except that we cannot change once created. Generally, we use parenthesis ( ) to create a tuple.
Ex: tuple1=(1,4.5,False,’c’)
We can access individual elements but we cannot modify them.
tuple1[3]—c
tuple1[3]=’a’—it gives an error
Earn yourself a promising career in data science by enrolling in the Data Science Online Courses in Bangalore offered by 360DigiTMG.
iii)Dictionary:
It is a special type of data structure. Unlike the list and tuple, it stores elements in a key-value pair structure. We can use flower brackets { } to create a dictionary.
Ex: dict1={‘a’:1,’b’:2,’c’:3}
Here (a,b,c) are keys and (1,2,3) are values. We can change the values through keys.
dict1[‘a’]=” apple”
dict1— {‘a’:’apple’, ‘b’:2, ‘c’:3}
iv)Sets:
It is an unordered/non-sequence collection of items. We cannot access by index. It is also created by flower brackets { }.
Ex: set1={5,4.0,”science”,False}
When we try to print the data, it may get in a different order.
print(set1) – {“science”,5,4.0,False}
Also, check out this Data Science Course in Chennai to start a career in Data Science.
v)Frozen sets:
It is a special type of set. Like tuple, it is also immutable. Once created, we cannot change it. These are hashable which means tuples and frozen sets can be used as keys of a dictionary and multi-index of elements as well. These are created using the keyword “frozenset”.
Ex: f1=frozenset({2,5.5,’c’})
F2=frozenset([1,2,3])
vi) Strings:
It can be treated as a sequence of Unicode characters. Like tuples and frozensets, Strings are also immutable. It can be created by using single or double quotes.
Ex: s1=”360 digital”
S2=’hello’
S2[0]—‘h’
S2[0]=’m’— gives an error.
So, we got a brief introduction to different types of data in Python.
Become a Data Scientist with 360DigiTMG Data Science course in Hyderabad. Get trained by the alumni from IIT, IIM, and ISB.
Data Science Training Institutes in Other Locations
Tirunelveli, Kothrud, Ahmedabad, Hebbal, Chengalpattu, Borivali, Udaipur, Trichur, Tiruchchirappalli, Srinagar, Ludhiana, Shimoga, Shimla, Siliguri, Rourkela, Roorkee, Pondicherry, Rajkot, Ranchi, Rohtak, Pimpri, Moradabad, Mohali, Meerut, Madurai, Kolhapur, Khammam, Jodhpur, Jamshedpur, Jammu, Jalandhar, Jabalpur, Gandhinagar, Ghaziabad, Gorakhpur, Gwalior, Ernakulam, Erode, Durgapur, Dombivli, Dehradun, Cochin, Bhubaneswar, Bhopal, Anantapur, Anand, Amritsar, Agra , Kharadi, Calicut, Yelahanka, Salem, Thane, Andhra Pradesh, Greater Warangal, Kompally, Mumbai, Anna Nagar, ECIL, Guduvanchery, Kalaburagi, Porur, Chromepet, Kochi, Kolkata, Indore, Navi Mumbai, Raipur, Coimbatore, Bhilai, Dilsukhnagar, Thoraipakkam, Uppal, Vijayawada, Vizag, Gurgaon, Bangalore, Surat, Kanpur, Chennai, Aurangabad, Hoodi,Noida, Trichy, Mangalore, Mysore, Delhi NCR, Chandigarh, Guwahati, Guntur, Varanasi, Faridabad, Thiruvananthapuram, Nashik, Patna, Lucknow, Nagpur, Vadodara, Jaipur, Hyderabad, Pune, Kalyan.
Data Analyst Courses In Other Locations
Tirunelveli, Kothrud, Ahmedabad, Chengalpattu, Borivali, Udaipur, Trichur, Tiruchchirappalli, Srinagar, Ludhiana, Shimoga, Shimla, Siliguri, Rourkela, Roorkee, Pondicherry, Rohtak, Ranchi, Rajkot, Pimpri, Moradabad, Mohali, Meerut, Madurai, Kolhapur, Khammam, Jodhpur, Jamshedpur, Jammu, Jalandhar, Jabalpur, Gwalior, Gorakhpur, Ghaziabad, Gandhinagar, Erode, Ernakulam, Durgapur, Dombivli, Dehradun, Bhubaneswar, Cochin, Bhopal, Anantapur, Anand, Amritsar, Agra, Kharadi, Calicut, Yelahanka, Salem, Thane, Andhra Pradesh, Warangal, Kompally, Mumbai, Anna Nagar, Dilsukhnagar, ECIL, Chromepet, Thoraipakkam, Uppal, Bhilai, Guduvanchery, Indore, Kalaburagi, Kochi, Navi Mumbai, Porur, Raipur, Vijayawada, Vizag, Surat, Kanpur, Aurangabad, Trichy, Mangalore, Mysore, Chandigarh, Guwahati, Guntur, Varanasi, Faridabad, Thiruvananthapuram, Nashik, Patna, Lucknow, Nagpur, Vadodara, Jaipur, Hyderabad, Pune, Kalyan, Delhi, Kolkata, Noida, Chennai, Bangalore, Gurgaon, Coimbatore.
Navigate to:
360DigiTMG – Data Science, Data Scientist Course Training in Bangalore
No 23, 2nd Floor, 9th Main Rd, 22nd Cross Rd, 7th Sector, HSR Layout, Bengaluru, Karnataka 560102
1800212654321
Visit on map: Data Science Course