Ferds Tech Channel
Ferds Tech Channel
  • 361
  • 425 595
Learn Nested Dictionaries in Python with Netmiko
In this video, we will learn about nested dictionaries in Python. Below is the code I used in the video:
# A nested dictionary is a dictionary inside another dictionary.
# Key: A unique and immutable identifier (e.g., a string, number, or tuple).
# Value: Can be any data type (string, number, list, another dictionary, etc.).
# Structure: Key-value pairs are separated by a colon (:), and pairs are enclosed within curly braces ({}).
# Separator: Each key-value pair is separated by a comma (,).
from pprint import pprint
# Initial Nested Dictionary
device_data = { # Main dict
"Router1": { # Nested dict for "Router1"
"hostname": "R1", # Key-value pair
"ip": "192.168.1.1", # Key-value pair
} # End of nested dict
} # End of main dict
# Create: Add new interface
device_data["Router1"]["interfaces"] = {
"Gig0/0": {"status": "up", "ip": "192.168.1.2"},
"Gig0/1": {"status": "down", "ip": None},
}
# Read: Access data
print(device_data["Router1"]["hostname"])
print(device_data["Router1"]["interfaces"]["Gig0/0"]["ip"])
# Update: Modify existing data
device_data["Router1"]["ip"] = "192.168.1.2"
device_data["Router1"]["interfaces"]["Gig0/1"]["status"] = "up"
# Delete: Remove data
del device_data["Router1"]["interfaces"]["Gig0/1"]
del device_data["Router1"]["ip"]
# Print final result
print(device_data)
#python #pythonforbeginners #networkautomation
มุมมอง: 16

วีดีโอ

How to Hide and VeryHide Sheets in Excel Like a Pro!
มุมมอง 929 ชั่วโมงที่ผ่านมา
In this video, I will show you how to hide and veryhide sheets in Excel. Below are the step-by-step guides. Feel free to use them if you need. 1. To Hide Sheets Steps: 1. Right-click on the sheet tab you want to hide. 2. Select Hide from the context menu. 3. The sheet will no longer appear in the tab list. 2. To Make Sheets VeryHidden Steps: 1. Press Alt F11 to open the VBA editor. 2. In the Pr...
how to COPY and PASTE VISIBLE CELLS ONLY in Excel (Step-by-Step)
มุมมอง 2339 ชั่วโมงที่ผ่านมา
In this video, I will show you how to copy and paste visible cells only in Excel. Below is the step by step guide. Feel free to use it if you need. How to Copy and Paste Visible Cells Only in Excel 1. Select Your Data Highlight the range of cells that includes both visible and hidden data. 2. Activate 'Visible Cells Only' Option 1 (Ribbon): Go to the Home tab. Click Find & Select (in the Editin...
How to Add a Trendline in Excel Charts (Step-by-Step)
มุมมอง 1412 ชั่วโมงที่ผ่านมา
In this video, I will show you how to add a trendline to an Excel chart. #excel #exceltutorial #exceltips
how to use INDEX MATCH in Excel - Easy!
มุมมอง 4314 ชั่วโมงที่ผ่านมา
In this video, I will show you how to use the INDEX and MATCH functions to lookup data in Excel. #excel #exceltips #exceltutorial
How to use VLOOKUP in Excel (Step-by-Step)
มุมมอง 4216 ชั่วโมงที่ผ่านมา
In this video, we will learn how to use VLOOKUP in Excel. Below are the step by step guide I used in the video: VLOOKUP (Vertical Lookup) is a built-in Excel function used to search for a value in the first column of a table and return a corresponding value from another column in the same row. Steps to use the VLOOKUP function in Excel 1. Prepare Data: Ensure your data has a lookup column (firs...
How to create PIVOTCHART in Excel | Step by Step
มุมมอง 27วันที่ผ่านมา
In this video, I talk about how to create a PivotChart in Excel. Below are step by step guides I used in the video: A PivotChart in Excel is a graphical representation of the data in a PivotTable. It allows you to visualize trends, patterns, and comparisons in your data by providing interactive charting capabilities. Create a PivotChart 1. Select a cell in your table. 2. Go to Insert and select...
How to create PIVOTTABLE in Excel | Step by Step
มุมมอง 64วันที่ผ่านมา
In this video, we learn how to create a PivotTable in Excel. Below is the step by step guide: How to Create a PivotTable in Excel: A PivotTable is a powerful tool in Excel that allows you to quickly summarize, analyze, and explore large amounts of data. 1. Select Your Data: Click anywhere in the dataset you want to use for the PivotTable. 2. Insert PivotTable: Go to the Insert tab on the Ribbon...
How to LOOP OVER dictionaries in Python (Network Automation Example)
มุมมอง 54วันที่ผ่านมา
In this video, we learn how to loop over dictionaries in Python and peform practical examples using the Netmiko library. Below is the code used in the video: from netmiko import ConnectHandler # Device connection details devices_dict = { "host1": { "device_type": "cisco_ios_telnet", "host": "route-views.routeviews.org", "username": "rviews", }, "host2": { "device_type": "cisco_ios_telnet", "hos...
how to use XLOOKUP in Excel l Step by Step
มุมมอง 72วันที่ผ่านมา
In this video, I talk about how to use XLOOKUP within the same workbook and across workbooks. Below are step by step guides for both. How to use XLOOKUP within the same workbook XLOOKUP Syntax: =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]) 1. Click on the cell where you want the result. 2. Enter =XLOOKUP(. 3. Select the value or cell reference y...
How to Create HYPERLINK to Another Sheet in Excel - Step by Step
มุมมอง 4014 วันที่ผ่านมา
In this video, I show you how to create a hyperlink to another sheet in Excel step by step. Below is the steps I used in the video: How to Create a Hyperlink to Another Sheet in Excel 1. Click on the cell where you want to create the hyperlink. 2. Right-click on the cell and select Link (or press Ctrl K). 3. In the Insert Hyperlink dialog box, select Place in This Document from the left panel. ...
Python Dictionary Comprehension for Network Automation
มุมมอง 5914 วันที่ผ่านมา
In this video, I talk about the Python dictionary comprehension and I use practical examples using the Netmiko library. Below is the code I used in the video. # Python dictionary comprehension is a concise way to create dictionaries. # You use it to create a dictionary from an existing iterable in a single line of code. # Dictionary comprehension syntax: # dict_name = {key_expression: value_exp...
How to extract COMMENTS and USERNAMES in Excel (Step by Step)
มุมมอง 4114 วันที่ผ่านมา
In this video, I show you how to extract comments and usernames in Excel. Below is the step by step procedure I used in the video: How to extract comments and usernames in Excel 1. Right click on the sheet and select View Code. 2. Right click on your sheet and select Insert then Module. 3. Paste the VBA code below. Function GetCommentDetails(rng As Range) As String Dim cmtText As String Dim aut...
How to Sum Visible Cells Only in Excel - Step by Step
มุมมอง 7514 วันที่ผ่านมา
In this video, I talk about how to sum the visible cells only in Excel. Below is the step by step procedure: Summing Visible Cells Only 1. Click on the cell where you want the sum of the visible cells to appear. 2. Type =SUBTOTAL( into the selected cell. For summing, use 9 as the first argument. Your formula should look like this: =SUBTOTAL(9,. 3. Select the Range of Cells: After the comma, sel...
Python Dictionary Methods for Network Automation
มุมมอง 3214 วันที่ผ่านมา
In this video, I talk about some of the most useful dictionary methods and use practical examples using the Netmiko library. Below is the code I used in the video: from netmiko import ConnectHandler # Define connection details in a dictionary cisco_device = { "device_type": "cisco_ios_telnet", "host": "route-views.routeviews.org", "username": "rviews", } # Example 1: Using `.keys()` to list all...
How to Customize Lines and Markers in Excel Line Graphs - Easy!
มุมมอง 8821 วันที่ผ่านมา
How to Customize Lines and Markers in Excel Line Graphs - Easy!
Python Dictionary Basics for Network Automation
มุมมอง 10321 วันที่ผ่านมา
Python Dictionary Basics for Network Automation
How to Transpose (Rotate) Data in Excel: Step by Step
มุมมอง 5828 วันที่ผ่านมา
How to Transpose (Rotate) Data in Excel: Step by Step
Python List Comprehensions for Network Automation
มุมมอง 24828 วันที่ผ่านมา
Python List Comprehensions for Network Automation
How to Adjust Bar Width in Excel Bar Chart - Quick Tutorial
มุมมอง 75หลายเดือนก่อน
How to Adjust Bar Width in Excel Bar Chart - Quick Tutorial
Python List Slicing for Network Automation
มุมมอง 52หลายเดือนก่อน
Python List Slicing for Network Automation
How to Format Python Lists for Network Automation
มุมมอง 52หลายเดือนก่อน
How to Format Python Lists for Network Automation
Python List Basics for Network Automation
มุมมอง 149หลายเดือนก่อน
Python List Basics for Network Automation
How to attach file in PowerPoint (THE RIGHT WAY)
มุมมอง 132หลายเดือนก่อน
How to attach file in PowerPoint (THE RIGHT WAY)
Python String Tips for Network Automation
มุมมอง 36หลายเดือนก่อน
Python String Tips for Network Automation
How to install and use IPython in VS Code - Easy Guide!
มุมมอง 140หลายเดือนก่อน
How to install and use IPython in VS Code - Easy Guide!
How to Rotate Axis Labels Diagonally in Excel - Easy!
มุมมอง 140หลายเดือนก่อน
How to Rotate Axis Labels Diagonally in Excel - Easy!
Python String Slicing for Network Automation
มุมมอง 108หลายเดือนก่อน
Python String Slicing for Network Automation
Python String Formatting (%, .format() and f-string) for Network Automation
มุมมอง 56หลายเดือนก่อน
Python String Formatting (%, .format() and f-string) for Network Automation
Python string methods for Network Automation
มุมมอง 58หลายเดือนก่อน
Python string methods for Network Automation

ความคิดเห็น

  • @ManthaarJanyaro
    @ManthaarJanyaro 3 ชั่วโมงที่ผ่านมา

    You are great 👍🏻, An awesome trick 👏🏻

  • @hannahma624
    @hannahma624 15 ชั่วโมงที่ผ่านมา

    It works. This saved my life. Thank you very much!

    • @FerdsTechChannel
      @FerdsTechChannel 14 ชั่วโมงที่ผ่านมา

      @@hannahma624 Glad it helped! 😊

  • @Inderaaa_
    @Inderaaa_ วันที่ผ่านมา

    Great video!

  • @saqibjani1136
    @saqibjani1136 วันที่ผ่านมา

    D[]

  • @saqibjani1136
    @saqibjani1136 วันที่ผ่านมา

    R[]

  • @saqibjani1136
    @saqibjani1136 วันที่ผ่านมา

    A[]

  • @saqibjani1136
    @saqibjani1136 วันที่ผ่านมา

    E[]

  • @saqibjani1136
    @saqibjani1136 วันที่ผ่านมา

    M[]

  • @saqibjani1136
    @saqibjani1136 วันที่ผ่านมา

    L[]

  • @saqibjani1136
    @saqibjani1136 วันที่ผ่านมา

    A[]

  • @saqibjani1136
    @saqibjani1136 วันที่ผ่านมา

    N[]

  • @saqibjani1136
    @saqibjani1136 วันที่ผ่านมา

    D[]

  • @capturedart0
    @capturedart0 7 วันที่ผ่านมา

    The folder is opened is VS code by code . But the file or folders inside the folder are not showing.

  • @JuanAssy
    @JuanAssy 9 วันที่ผ่านมา

    Thanks for your help

    • @FerdsTechChannel
      @FerdsTechChannel 9 วันที่ผ่านมา

      No problem. Glad you found it helpful! 😊

  • @josefisrael9887
    @josefisrael9887 13 วันที่ผ่านมา

    Thank you the detailed explanation. I just want to add that if you encounter the following error message ""python" not recognized as a command..." Please make make sure that Python is correctly installed and added to the PATH environment variable. After adding python to the PATH environment variable, restart VSCode and it will work. If you do not re-start VSCode, it will not work. Thanks

  • @Brutailgod
    @Brutailgod 15 วันที่ผ่านมา

    simple, fast, and understandable thanks!

  • @FerdsTechChannel
    @FerdsTechChannel 15 วันที่ผ่านมา

    How to Create a Hyperlink to Another Sheet in Excel 1. Click on the cell where you want to create the hyperlink. 2. Right-click on the cell and select Link (or press Ctrl + K). 3. In the Insert Hyperlink dialog box, select Place in This Document from the left panel. 4. Choose the sheet you want to link to and enter the cell reference. 5. Click OK to create the hyperlink.

  • @Oniigiri-x9n
    @Oniigiri-x9n 15 วันที่ผ่านมา

    Need help, why cant create a project on mine. It does not have a field for filename, only the location?

  • @FerdsTechChannel
    @FerdsTechChannel 18 วันที่ผ่านมา

    How to extract comments and usernames in Excel 1. Right click on the sheet and select View Code. 2. Right click on your sheet and select Insert then Module. 3. Paste the VBA code below. Function GetCommentDetails(rng As Range) As String Dim cmtText As String Dim authorName As String Dim result As String On Error Resume Next ' Check for threaded comments (modern comments) Dim threadedComment As CommentThreaded Set threadedComment = rng.CommentThreaded If Not threadedComment Is Nothing Then cmtText = threadedComment.Text authorName = threadedComment.Author.Name End If ' If no threaded comment, check for traditional comment (note) If cmtText = "" Then cmtText = rng.NoteText If Not rng.Comment Is Nothing Then authorName = rng.Comment.Author End If End If On Error GoTo 0 ' Format the result If cmtText = "" Then result = "No comment" ElseIf authorName = "" Then result = "Comment: " & cmtText Else result = "Author: " & authorName & "; Comment: " & cmtText End If GetCommentDetails = result End Function 4. Save your excel file as a macro-enabled file. 5. Type the following next to the cell you want the comment and username extracted. =GetCommentDetails(A1)

  • @FerdsTechChannel
    @FerdsTechChannel 19 วันที่ผ่านมา

    Summing Visible Cells Only 1. Click on the cell where you want the sum of the visible cells to appear. 2. Type =SUBTOTAL( into the selected cell. For summing, use 9 as the first argument. Your formula should look like this: =SUBTOTAL(9,. 3. Select the Range of Cells: After the comma, select the range of cells you want to sum. For example, =SUBTOTAL(9, A1:A10). Press Enter: The cell will now display the sum of only the visible cells in the selected range.

  • @FerdsTechChannel
    @FerdsTechChannel 20 วันที่ผ่านมา

    Here’s the excel file I used in the video: drive.google.com/file/d/1kh9f87TNvHs_PIv8mwa1H6XfACepLvJA/view?usp=sharing

  • @garethjones2293
    @garethjones2293 22 วันที่ผ่านมา

    Did not work for me?!? Shows as a threaded comment and your version of Excel allows.... if there is no comment, that is working and displaying 'no comment' (I have check marco enabled/save enabled)

    • @FerdsTechChannel
      @FerdsTechChannel 22 วันที่ผ่านมา

      I’ll share the excel file I used so you can have a look at it. 😊

    • @FerdsTechChannel
      @FerdsTechChannel 20 วันที่ผ่านมา

      Here’s the file I used in the video 😊: drive.google.com/file/d/1kh9f87TNvHs_PIv8mwa1H6XfACepLvJA/view?usp=sharing

  • @SN33kzy
    @SN33kzy 23 วันที่ผ่านมา

    this is great, please make a video for the latest version of pycharm, a lot of people are having trouble creating new file after installation

    • @FerdsTechChannel
      @FerdsTechChannel 22 วันที่ผ่านมา

      okay, ill try to make a video about it. 😊

  • @GraciaVargas-z7t
    @GraciaVargas-z7t 27 วันที่ผ่านมา

    This was awesome, took under a minute to do something that would have taken me hours by hand. Thanks!

  • @FerdsTechChannel
    @FerdsTechChannel 28 วันที่ผ่านมา

    How to Transpose (Rotate) Data in Excel Using Paste Special 1. Copy the data you want to transpose (Ctrl + C). 2. Select the cell where you want the transposed data to start. 3. Right-click and choose Paste Special. 4. Check the Transpose box and click OK. Using the TRANSPOSE Function 1. Select the range where you want the transposed data to appear. 2. Type the formula =TRANSPOSE(A1:B10) (replace A1:B10 with your actual range) and press Enter.

  • @qurbansadaqat6341
    @qurbansadaqat6341 หลายเดือนก่อน

    Please try to make sure yourself 100% then publish on the net, it's easy for everyone to copy and paste the commands without proper explanations and concepts.

  • @FerdsTechChannel
    @FerdsTechChannel หลายเดือนก่อน

    charot charot lang yan 😂

  • @RideskotoPH
    @RideskotoPH หลายเดือนก่อน

    paturo ako nyan python sir😊

  • @RideskotoPH
    @RideskotoPH หลายเดือนก่อน

    paturo ako nyan python sir😊

    • @FerdsTechChannel
      @FerdsTechChannel หลายเดือนก่อน

      Czcvnnnbnhgvvbnn V. H. Chhjhjjnjkhhwqqwqwguj mv. Cc byjs u Oc

  • @RideskotoPH
    @RideskotoPH หลายเดือนก่อน

    paturo ako nyan python sir😊

  • @sumsalty
    @sumsalty หลายเดือนก่อน

    I am looking to be able to get the full comment thread including the user name is there a way to do that? Even so your video was still very helpful thank you for making this!

    • @FerdsTechChannel
      @FerdsTechChannel 18 วันที่ผ่านมา

      I just made a video about how to extract both comments and usernames in Excel here :) th-cam.com/video/VLvsHfaoF00/w-d-xo.htmlsi=NNOatCpzvxuxZkIN

  • @UsmanAli-sz8kx
    @UsmanAli-sz8kx หลายเดือนก่อน

    That is well explained mate. Subscribed

    • @FerdsTechChannel
      @FerdsTechChannel หลายเดือนก่อน

      Glad you found it helpful!

  • @markganus1085
    @markganus1085 หลายเดือนก่อน

    great video. i needed this right now

    • @FerdsTechChannel
      @FerdsTechChannel หลายเดือนก่อน

      Glad you found it helpful!

  • @SeyedMohamadrezaIzadpanah
    @SeyedMohamadrezaIzadpanah หลายเดือนก่อน

    very useful . thank you

  • @JacobPonce-q9p
    @JacobPonce-q9p หลายเดือนก่อน

    you saved me. thank you

  • @venthan-c1n
    @venthan-c1n หลายเดือนก่อน

    Video quality very poor. It's mean editing we couldn't understand where you click. And fast you so fast. You would be use arrows or click animation

    • @thegoldentree6913
      @thegoldentree6913 10 วันที่ผ่านมา

      Your English so poor that i had a stroke trying to read that

  • @ekidona8775
    @ekidona8775 2 หลายเดือนก่อน

    Very nice explanation of Split Horizon Rule. Can you help me understand the "update-source loopback0" command? ( sorry, first time seeing that command, and mainly work with junOS equipment) Salamat in advance :)

    • @FerdsTechChannel
      @FerdsTechChannel 2 หลายเดือนก่อน

      The update-source Loopback0 command ensures that the router uses the IP address associated with its Loopback0 interface to establish BGP peerings and for BGP updates.

  • @Anamika00004
    @Anamika00004 2 หลายเดือนก่อน

    Thank you thank you thank you so much 😭😭😭🖤🖤🖤

  • @leonardobascope6492
    @leonardobascope6492 2 หลายเดือนก่อน

    Muchas gracias!!!!!!!

  • @fuzzzy17
    @fuzzzy17 2 หลายเดือนก่อน

    Excellent video! Thanks.

  • @Test-xn9jq
    @Test-xn9jq 2 หลายเดือนก่อน

    oh wtf my code is in 3.8.5 depression

  • @luistierestieresdasilva630
    @luistierestieresdasilva630 2 หลายเดือนก่อน

    The uncompyle6 only working with archive of version 3.8 or less?

    • @FerdsTechChannel
      @FerdsTechChannel 2 หลายเดือนก่อน

      @@luistierestieresdasilva630 correct. i mentioned it in the video also. 😊

  • @SamihaAhammed
    @SamihaAhammed 2 หลายเดือนก่อน

    oh thank u so much

  • @1_AzA_1
    @1_AzA_1 2 หลายเดือนก่อน

    Thank you!

    • @FerdsTechChannel
      @FerdsTechChannel 2 หลายเดือนก่อน

      Glad you found it useful!

  • @khankhan-g7d1q
    @khankhan-g7d1q 2 หลายเดือนก่อน

    Thanks 🥰🥰🥰

  • @rayaguirre3347
    @rayaguirre3347 2 หลายเดือนก่อน

    Thank you, I’ve gone through two other videos where they skipped over this part for some reason and used existing projects. Appreciate the help.

  • @RideskotoPH
    @RideskotoPH 2 หลายเดือนก่อน

    paki tagalog sir 😂

  • @Jambi46n2
    @Jambi46n2 2 หลายเดือนก่อน

    Life saver! Thank you so much.

    • @FerdsTechChannel
      @FerdsTechChannel 2 หลายเดือนก่อน

      @@Jambi46n2 Glad it was helpful. Dont forget to subscribe if you havent yet. 😊

  • @FerdsTechChannel
    @FerdsTechChannel 2 หลายเดือนก่อน

    In this video, I talk about how to compare files such as python code or Cisco configuration files in VS video.

  • @mathiaslangner226
    @mathiaslangner226 3 หลายเดือนก่อน

    Thanks, your video helped a lot. :)

    • @FerdsTechChannel
      @FerdsTechChannel 3 หลายเดือนก่อน

      Glad you found the video useful. Don’t forget to subscribe for more content. 😊