back soft

مطالب مرتبط با «python list of functions» در back soft | نویسنده: استخدام کار

How do you indicate certain elements in list of list and vectors based on list characteristics in R

Vote count: 0 For example testList0. If I run sapply(testList,function(x)is.list(x) & x[[3]]>1) I get Error in x[[3]] : subscript out of bounds. But really the problem is that the x[[3]]>1 should only be applied to the lists, not the vectors. The boolean needs to be of length testList. Any simple way of doing this? asked 40 secs agoColinTea Let's block ads!...

ادامه مطلب

How do I validate an implementation of python's IOBase?

Vote count: 0 Is there an existing test suite I can make use of to test an implementation of IOBase? If possible, I would like to exhaustively test a new implementation, but there are a lot of tests that would need to be manually written. For instance, say I have a non-seekable, non-writeable stream. I want to validate that my implementation of read is compliant and that all other methods raise the right kinds of errors. Such a class might look like this: import io class NonSeekableReader(io.Raw...

ادامه مطلب

How to create this kind of animation for a listview?

Vote count: 0 What I want to do I've got only the first animation: and it makes my list view item being removed and scaled. However, what I didn't figure out yet is how to build the second animation what push the rest of the items up. This is what I built:What I reached to do Thanks ahead! asked 1 min agoAssaf Zfani Let's block ads!...

ادامه مطلب

add navbar item in list accordin to width of page and the full of nav bar

Vote count: 0 i want to make a responsive navbar that is collapsed according to the number of items "li" not according to the width of the window i will attach some images to describe what i want to do. 1-case1:number of item not exceed the navbar width 2-number of item exceed the navbar width 3-if i collapse the window , the item in navbar must be added in dropdown list 4-if mobile ( less than 320) add all nav item in dropdown menu "bootstrap style} asked 30 secs agoGeorge Samuel Let's block ad...

ادامه مطلب

Sample code for listing a FixedPriceItem with ebay python api

Vote count: 0 i'm working with python 2.7 on a linux environment, my app working with the ebay trading api with the sdk: ebaysdk-python. My goal is to list a fixedpriceitem, i didn't found a correct way to do it ... It seems the example on the ebay website for the developer isn't working also. Someone out there can post a full working code written in python, to publish a fixedpriceitem with the ebaysdk-python api ? Thanks. asked 21 secs agoilmetu Let's block ads!...

ادامه مطلب

getting string array parse to date and get maximum and minimum of it in Python for java code

Vote count: 0 i am trying to write python functions to parse list or array of dates and sort it and then get max or min value from it. I have to call this functions around 4 million times and input to it will be passed from Amazon Redshift Database, for performance reasons i want to do this in Amazon Redhsift Database user defined functions. Below is Java Code needs to be converted into Python/Amazon Redshift user defined functions. public String doItMin(String v_effect_date){ java.util.List arr...

ادامه مطلب

Importing software in python error

Vote count: 0 importing procedure in python - utina@utinax55:~$ python Python 2.7.11+ (default, Apr 17 2016, 14:00:29) [GCC 5.3.1 20160413] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import lal Traceback (most recent call last): File "", line 1, in File "/home/utina/.local/lib/python2.7/site-packages/lal/__init__.py", line 2, in from .lal import * File "/home/utina/.local/lib/python2.7/site-packages/lal/lal.py", line 28, in _lal = swig_import_helper() Fi...

ادامه مطلب

Excel 2013 VBA - setting up a list of email reciepients (TO and CC) populating Oulook email

Vote count: 0 I have set up a Userform which saves data to the Incident Details data sheet and also saves data temporarily to a worksheet called 'Email Form' and laid out like a form so that the 'email form' is copied into the body of a MS Outlook email. This works perfectly, and with the current coding I was provided sends one email To 1 recipient and CC'd to another, but I need to send same email to multiple recipients. I have created another sheet called ‘Email Recipient List (same workbook) ...

ادامه مطلب

Is it possible to change the event type of an event listener in Firebase during runtime?

Vote count: 0 For example, I called a listener once with a .ChildAdded event type but later I want to call that same listener again with a .ChildRemoved listener. asked 15 secs agokeyhoffman Let's block ads!...

ادامه مطلب

Get match of two lists

Vote count: 0 I have two lists and i like to browse them to get the matchs and the difference but i don't understand why my index don't reach the end of list there is my code: recordedEvents=[u'/app//wakeup', u'/app/hdmi/state', u'/homepage/ws/view', u'/homepage//activate', u'/live//activate', u'/live//zap', u'/live/ctazap/view', u'/live/ppluspminus/zap', u'/app//keypress', u'/app//keypress', u'/app//keypress', u'/app//keypress', u'/app//keypress', u'/app//keypress', u'/live/virtualzappinglistba...

ادامه مطلب

Getting java.lang.NoClassDefFoundError: com/gargoylesoftware/htmlunit/WebWindowListener when using HTMLUnitDriver

Vote count: 0 I am trying to use HTMLUnitDriver in my selenium test to understand how HTMLUnitDriver works. Kindly help me with resolving the issue. I have added the below jars to the build path in eclipse selenium-java-2.53.0 jars TestNG jar Added the below jars as these were mentioned in other posts as a solution to the error I encountered. However, the issue remains. selenium-htmlunit-driver-2.52.0 jar selenium-server-standalone-2.53.0 Hi, I am trying to use HTMLUnitDriver in my selenium test...

ادامه مطلب

What is the correct css for the list of results to show correctly in this situation?

Vote count: 0 What is the correct css for the list of results to show correctly? Here are the steps to view the results: 1) Navigate to http://mypubguide.com/good-pubs/east-region 2) Type "Hull" in the search input on the navigation bar and enter 3) Check: You see a list of results but the styling is incorrect, e.g., the anchor tag is not showing the text correctly and other elements look badly formatted. How I resolve this? asked 40 secs agoCaotaurus Let's block ads!...

ادامه مطلب

Create dataframe of all rows AFTER varying amount of header data Python Pandas

Vote count: 0 I have dataframes with a varying amount of header data. I need to remove the header data, (ie. create a new dataframe containing only the data that comes after this header) I have used the following code to find the row where the header data ends. df = xlsx_file.parse('ActualSheet',header= None) value_list = ['var1','var2'] df_Header = df[df[0].isin(value_list) & (df[1].isin(value_list))] The above code works and creates a dataframe of the final row of header data. I am having trou...

ادامه مطلب

SWIG: How to pass list of complex from c++ to python

Vote count: 0 I have a function in c++ who retus a list of complex: #include std::list< std::complex > func(...); what should i do in the '*.i' file ? asked 34 secs agoxhao79 Let's block ads!...

ادامه مطلب

How to constuct a column of data frame recursively with pandas-python?

Vote count: 0 Give such a data frame df: id_ val 11111 12 12003 22 88763 19 43721 77 ... I wish to add a column diff to df, and each row of it equals to, let's say, the val in that row minus the diff in the previous row and multiply 0.4 and then add diff in the previous day: diff = (val - diff_previousDay) * 0.4 + diff_previousDay And the diff in the first row equals to val * 4 in that row. That is, the expected df should be: id_ val diff 11111 12 4.8 12003 22 11.68 88763 19 14.608 43721 77 ... ...

ادامه مطلب

How can I concatenate a big list of unique words once?

Vote count: 0 It is hard to explain what I am trying to say so I am best off giving an example. Lets say I had the following data - word1, word2word3, word4 What I would need is an output is the following - word1 word2word1 word3word1 word4word2 word1word2 word3word2 word4word3 word1word3 word2word3 word4word4 word1word4 word2word4 word3 So a complete mix of all the combinations of words. In total I have 300x300 rows and columns so I know it will be a big result but do not know the best way to g...

ادامه مطلب

Python exception "can't multiply sequence by non-int of type 'float'

Vote count: 0 My 12 year old is leaing python scripting. He is writing a very simple code to calculate the discount on a article. Following is the code and it throws the exception on the 3rd line in the code. The exception is: Traceback (most recent call last): File "C:/Users/basam/AppData/Local/Programs/Python/Python35/discounts.py", line 3, in discount=0.1*price TypeError: can't multiply sequence by non-int of type 'float' price=input('how much is your item?') if int(price)...

ادامه مطلب

How to know if a variable is in an attribute of an object in a list?

Vote count: 0 To check if a variable is in a list, I know that one can use if variable in list. In my instance, I have a list of objects, all of which have the attribute "id", I want to check if an object in a list has a specific ID, but I'm not sure how I would go about doing that. I already tried looking this up on google as well as here but I couldn't find any relevant results. That might be because I don't really know how to phrase my question correctly, so if my question doesn't make sense ...

ادامه مطلب

Python n elements from list by index

Vote count: 0 Question: I have a list of arrays such as: a = [array([0, 4]), array([1, 3, 2])] From another variable X, I want to take two subsets which are chosen by the index in each array in a. X = [0.1, 0.7, 0.9, 0.2, 0.3] What I want to have is now: result_1 = [0.1, 0.3] result_2 = [0.7, 0.2, 0.9] My solution would be to use a for loop such as: def getresult(X, indices): result = [] for i in indices: result.append(X[i]) retu result This works fine: getresult(X, a[0]) [0.1, 0.3] My previous ...

ادامه مطلب

How to find the index number of list that in dictionary?

Vote count: 0 The example list { 'date': array(['06/08/2016', '06/09/2016', '06/10/2016']), 'close': array([ 923.13, 914.25, 909.42]) } I try to get the Date of close is 914.25 that is list['date'][2] but i don't know how to get index 2 for close. Thank you. asked 3 mins agoBarbiyong 1 Answer Vote count: 0 You can solve it with zip() and next(): >>> d = { ... 'date': ['06/08/2016', '06/09/2016', '06/10/2016'], ... 'close': [ 923.13, 914.25, 909.42] ... } >>> a = 914.25 >>> next(date for date, am...

ادامه مطلب