Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Data Science
#1
Hello everybody, i have some questions regarding the following code in python:

localWinds = {name: site.local_wind(x_i=site.initial_position[:,0], # x position

                                    y_i = site.initial_position[:,1], # y position
                                    h_i=site.initial_position[:,0]*0+70, # height
                                    ws=None, # defaults to 3,4,..,25
                                    wd=None, # defaults to 0,1,...,360
                                    ) for name, site in sites.items()}
firstly I want to know what is the function of {name:.....}? why we used it here?
secondly, for in the last line means that we set these values x_i.... for the variable of name?
lastly, site in sites.items means every item in sites will be placed in variable: Site ??
buran write Oct-14-2021, 06:51 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply


Messages In This Thread
Data Science - by sadra_ss - Oct-14-2021, 05:53 PM
RE: Data Science - by buran - Oct-14-2021, 07:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python issue - Data science - Help is needed yovel 2 2,067 Jul-29-2021, 04:27 PM
Last Post: yovel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020