1 / 9

seaborn

Seaborn is a Python data visualization library based on matplotlib. Some basics of seaborn are highlighted in this tutorial along with some characteristics. Moreover, various plots that can be plotted to observe the distribution patterns using seaborn are also named. Distplot function is discussed in detail.<br>

Télécharger la présentation

seaborn

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Dictionary • Dictionaries are used to store data values in key:value pairs. • A dictionary is a collection which is unordered, changeable and does not allow duplicates.Dictionary is mutable. • Dictionaries are written with curly brackets, and have keys and values. • Key should be unique and immutable datatype. • If we try to assign a new value to same key prior value will be deleted and the new one will be stored.

  2. Values in the dictionary can be duplicated but key cannot be duplicated. • Key can be any immutable object like integer, float, character, complex,tuple. • Dictionary keys are case sensitive, same name but different cases of Key will be treated distinctly.

  3. Creating a dictionary:d={1:100, ’c’:20, (10,20,30):[100,200,300],4:30}print(d)O/P: {1:100, ’c’:20, (10,20,30):[100,200,300],4:30} • Values in the dictionary can be accessed using keys. • Eg:(d[‘c’])O/P:20 • In Python Dictionary, deletion of keys can be done by using the del keyword. Using del keyword, specific values from a dictionary as well as whole dictionary can be deleted. • Eg: del d[1] print(d)O/P:{’c’:20, (10,20,30):[100,200,300],4:30}

  4. Dictionary Methods • clear():Removes all the elements from the dictionary • copy():Returns a copy of the dictionary • fromkeys():Returns a dictionary with the specified keys and value • get():Returns the value of the specified key • items():Returns a list containing a tuple for each key value pair • keys():Returns a list containing the dictionary's keys

  5. pop():Removes the element with the specified key • popitem():Removes the last inserted key-value pair • setdefault():Returns the value of the specified key. If the key does not exist: insert the key, with the specified value • update():Updates the dictionary with the specified key-value pairs • values():Returns a list of all the values in the dictionary

  6. Examples • d = {1:100, 2.3:200, 10+20j:300, 'a': 'Python', (10,20,30):[100,200,300]} print(d.get('a'))O/P: Python • print(d.setdefault('b'))O/P: None • d1 = d.copy()   # shallow copy of dictionaryprint(d1 is d)O/P:False • d={1:100,2.3:200,10+20j:300,'a':'Python',(10,20,30):[100,200,300]}d.pop(1)print(d) O/P:{2.3: 200, (10+20j): 300, 'a': 'Python', (10, 20, 30): [100, 200, 300]}

  7. d={1:100,2.3:200,10+20j:300,'a':'Python',(10,20,30):[100,200,300]}d.popitem()print(d)O/P: {1: 100, 2.3: 200, (10+20j): 300, 'a': 'Python'}

  8. Thanks for Watching!!! • For more follow us on our social media platforms: • Instagram : learnbay_datascience • Facebook : learnbay • LinkedIn : Learnbay • Twitter : Learnbay1

More Related