Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 days ago.
Improve this question
I try getgfs to list forecast for tomorrow hourly.
import getgfs
f=getgfs.Forecast("0p25")
print(f)
print(f.times)
f.search("temperature")
print(f)
print(f.times)
res=f.get(["gustsfc"],date_time="20230213 "+"{:02d}".format(x)+":00", lat=42.13551084674774,lon=21.721419433353784)
for x in range(18, 23): #23):
f=getgfs.Forecast("0p25")
res=f.datetime_to_forecast('20230211')
res=f.get(["tcdcaveclm"],date_time="20230214 "+"{:02d}".format(x)+":00", lat=42.13551084674774,lon=21.721419433353784)
print("20230214 "+"{:02d}".format(x)+":00",res.variables["tcdcaveclm"].data[0][0][0])
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 days ago.
Improve this question
how I can How can I do it the other hay around, for example, I want my program to be able to ask me for the value of r1 and vote for the level like this Input is 10000000 and the result is 10001, which would be the level
nivel = 10001 - 1
re = nivel**2
re1 = re *10
print (f"\nnivel 7014 : {re1}")
I don't know how I can solve it
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
What code should I use to write a program that stores the following content in a variable?
I cannot use an external file.
{'title':'El Más Allá','aka':'E tu vivrai nel terrore - Laldilà','director':'Lucio Fulci', 'year':1981, 'country':'Italia'}
just store it in a dict like this
import json
instr = input(">>>")
myDict = json.loads(instr)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Request:
data['Churn'].value_counts(0)
Output:
0 7963
1 2037
Request:
data['Churn'].value_counts(1)
Output:
0 79.63
1 20.37
Could you please explain how parameters of 1, 0 for value_counts work?
You can find an answer when reading documentation:
value_counts(0)
is the same as:
value_counts(normalize=0)
which is interpreted as:
value_counts(normalize=False)
While 1 is interpreted as True in the opposite case.
That's why.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am trying to separate all the images from the following string.
how can I get a list of images that start with "comp1/img_" and are either split by a "," or a ";"
/*jsonp*/jsonresp({"img_set":"comp1/img_23434;comp1/img_3243r43r,comp1/img_o43nfjr;comp1/img_wjfno43,comp1/img_nrejfner;comp1/img_jrenckerjv,comp1/img_23434k;comp1/img_rkfnk4n"},"fknreff\",");
so I would end up with a list like...
comp1/img_23434
comp1/img_3243r43r
comp1/img_o43nfjr
comp1/img_wjfno43
comp1/img_nrejfner
comp1/img_jrenckerjv
comp1/img_23434k
comp1/img_rkfnk4n
any help would be appreciated.
thanks
You can do this:
>>> data = '/*jsonp*/jsonresp({"img_set":"comp1/img_23434;comp1/img_3243r43r,comp1/img_o43nfjr;comp1/img_wjfno43,comp1/img_nrejfner;comp1/img_jrenckerjv,comp1/img_23434k;comp1/img_rkfnk4n"},"fknreff\",");'
>>> import re
>>> re.findall(r'comp1/img_[^;,"]+', data)
['comp1/img_23434', 'comp1/img_3243r43r', 'comp1/img_o43nfjr', 'comp1/img_wjfno43', 'comp1/img_nrejfner', 'comp1/img_jrenckerjv', 'comp1/img_23434k', 'comp1/img_rkfnk4n']
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am looking for nice alternative for this part of code:
def reportResult (finalParsResult):
print "Total Number of Mimatch Files:",
diffSum=0
for (gP, matchFiles, diffFiles, matchFolders, gpExtrFld, upExtraFldrs) in FinalResult:
diffSum=diffSum+len(diffFiles)
print "Number of diff files", diffSum
Any suggestion?
def reportResult(finalParsResult):
return sum(len(result_row[2]) for result_row in FinalResult)
Or, if FinalResult should actually be the parameter finalParsResult:
def reportResult(finalParsResult):
return sum(len(result_row[2]) for result_row in finalParsResult)