back soft

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

Retrieving data from a yaml file based on a Python list

Vote count: 0 I have a Yaml file and a list of [thomas] ids corresponding to my Yaml file (thomas: -third row down on the file). Below is just a small snippet of the file. - id: bioguide: C000858 thomas: '00246' lis: S215 govtrack: 300029 opensecrets: N00002091 votesmart: 53288 icpsr: 14809 fec: - S0ID00057 wikipedia: Larry Craig house_history: 11530 name: first: Larry middle: E. last: Craig bio: birthday: '1945-07-20' gender: M religion: Methodist terms: - type: rep start: '1981-01-05' end: '19...

ادامه مطلب

How to get the exact zoom level knowing the centroid of a polygon defined by a list of longitude/latitude points?

Vote count: 0 I have a list of latitude/longitude points that form a polygon. After calculating the center of gravity of these points, is there a way to know the exact zoom level that can apply in moveCamera method? asked 2 mins agocarabinozza Let's block ads!...

ادامه مطلب

Is it possible list inside another list through a .txt file in Python

Vote count: 0 I have some questions about how can I read a .txt file and build one list inside other list through this file. look: I have this file: 1 2 3 4 5 6 7 8 9 Right now I'm using numpy to read the file: DataIn = numpy.loadtxt('jpegOut.txt') the retu is this: print DataIn [[1 2 3] [4 5 6] [7 8 9]] But I need this: [[1 2 3], [4 5 6], [7 8 9]] Could you help me? Thanks in Advance asked 1 min agogm-br Let's block ads!...

ادامه مطلب

Python Number of times a string is followed by another string

Vote count: 0 I have to complete a Python project which is asking me to define a function that will count the number of times that 'string1' is followed immediately by 'string2' in the same line. Unfortunately, I don't even have a clue. Any help? I'd appreciate. Thanks! asked 3 mins agoEmilio Zaidman This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers....

ادامه مطلب

Where can I find a list of all OrientDB SQL projections?

Vote count: 0 I'm looking for documentation about projects in OrientDB SQL syntax. I've seen various examples, but I'd like a comprehensive list. Examples of projections: SELECT out('my_edge') FROM Person SELECT expand(in('my_edge')) FROM Person SELECT max('my_field') FROM Person SELECT count(*) FROM Person There are obviously lots of other ones out there, but I'd love it if there were some complete syntax documentation for this somewhere. asked 36 secs agopdilyard This entry passed through the ...

ادامه مطلب

append names of pairwise combinations to a list

Vote count: 0 I have 3 lists indicating proximity between 2 animals during a given time. This was produced by using a pairwise approach (combn). Is it possible to take the actual animal IDs (eg A4116) and append it to the list? Here's the proximity output. list(structure(list(date = structure(c(1433653200, 1433682060, 1433682300, 1433682600, 1433682900, 1433683200, 1433683500, 1433683800, 1433684100, 1433684400, 1433684700, 1433685000, 1433685300, 1433685900, 1433686200, 1433686500, 1433686800, ...

ادامه مطلب

Python keeps overwriting argument, even when copied in or outside of function

Vote count: 0 my first question here. I hope I can make it as clearly and informative as possible. Currently using python, and new to it. I love the language though, alot of simplifications that keep your code very dense. I currently have a function that accepts an argument, that argument constantly gets overwritten even if I copy it to a local variable inside the function. Even when copied outside of the function (and the argument passed to the function) it overwrites the original argument here...

ادامه مطلب

Returning list from python method called from C++

Vote count: 0 I am trying to call a Python method from C++ code and the method I am calling takes a file name as an argument retus a list. My sample code currently converts PyObject* result of the method call to a double but I want to convert this to a list. #include "include.h" int main(int argc, char* argv[]) { double answer = 0; PyObject *modname, *mod, *mdict, *func, *stringarg, *args, *result; Py_Initialize(); PyRun_SimpleString("import sys"); modname = PyUnicode_FromString("module"); mod =...

ادامه مطلب

Generate List of IP Addresses via Command Line?

Vote count: 0 I'm interested in using command line (possibly Perl) to generate a list of all possible IP addresses. I've done similar with PHP in the past by using the long2ip function and creating a list from 0 to the interger 4294967295. Is there a way to do this in Perl instead though? I'm basically just looking for the quickest way to generate a text file that has a list of all 4,294,967,296 possible IP addresses. asked 1 min agoExecute Hosting This entry passed through the Full-Text RSS ser...

ادامه مطلب

Pseudocode for brute-force algorithm to find largest product of two numbers in a list

Vote count: 0 I am trying to come up with a pseudocode brute-force algorithm that finds the largest product of two numbers in a list a[sub1] to a[subn], with n greater than or equal to 2. Right now, I have for ( i = 1 to n -1) a[subi] = a[subi-1] * a[subi+1] for (j = a[sub j+1] to n) a[sub j] = a[sub j-1] * a[sub j+1] end for end for retu a[sub i] retu a[sub j] However, this is not correct. I feel like there's something simple I'm missing here, but I can't figure it out. Any ideas? Thanks in adv...

ادامه مطلب

vb.net listviwe add tow array of strings to tow column

Vote count: 0 i geting tow string from htmlcode using html-agility-pack here is how i get the first string Dim links = htmlDoc1.DocumentNode.SelectNodes("//*[@id='listone']") and then get the Attributes Dim Attributes = links.Cast(Of HtmlNode).Select(Function(x) x.GetAttributeValue("href", "")) and Dim linklist1 As String = String.Join(Environment.NewLine, Attributes) Dim string1 As String() = linklist1.Split(New String() {Environment.NewLine}, StringSplitOptions.None) the same thing for the sec...

ادامه مطلب

How to pass `params` of a `Func` List with dynamic return?

Vote count: 0 I need to call a method that receive a list of Func, the problem is that the retu of the Func is not the same for all the items of the list. For example: //Having the following method: public void DoSomething(params Expression list) { //do something } //and the following object public class Foo { public long Id { get;set; } //LOOK: ITS A LONG PROPERTY public string Name { get; set; } // ITS A STRING PROPERTY } //I would like to pass these two expressions of DIFFERENT retuing types....

ادامه مطلب

Python string with dashes to be placed in list

بخوانید I have a string like this: Home-Garden-Flowers-Nature I need to parse this string and put each of those words into a list. This operation will happen many times in my program, so I need it to be efficient. One solution I have thought of is to search for the dashes to signify where the word stops. However, I think there is a more elegant and efficient way to do this in Python?...

ادامه مطلب

List of List, want to output variable, not value

Vote count: -3 I have a list of lists like so: a = [1, 2, 3] b = [2, 3, 4] c = [a, b] I currently am doing: for x in c: print(x) and it is outputing [1, 2, 3]. How would i get it to output 'a' instead? asked 2 mins agojgree157 This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers....

ادامه مطلب

R: Subset list of data frames by row content? lapply/sapply

Vote count: 0 I have a list of data frames: d1...

ادامه مطلب

Running TestNG's RetryAnalizer on a List of tests

Vote count: 0 I am using TestNG as the Test framework. I would like to achieve the following: Once the Test Suite completed, let's say 100 tests were run (where 80 passed, 15 were skipped and 5 failed). In the onExecutionFinish method i start to run the (5) failed tests. I can get list of failed tests, but how can I make them run once again? RetryAnalyzer can retry a test after it fails, but I need to retry a bulk of tests after the whole suite has finished. asked 2 mins agoMichael This entry pa...

ادامه مطلب

How to get list of URLs From Chrome Browser

Vote count: 0 I want to get All URLs from google chrome browser using C#. some methods are available for IExplore and firefox browser. but I want to grab chrome URLs. is it possible asked 1 min agoMubashir Qureshi This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers....

ادامه مطلب

Reliably convert comma/semi-colon separated list of "last, first, last, first," names

Vote count: 0 I have a large list of thousands of names, with the entries that contain multiple names being separated by either comma or semi-colon, or even occasionally not. For instance: Last, First, Last, First A., Last, First, Ph.D, Last, First, M.D., Last, A. B, Last, First Middle plus other names, Last, First, Jr., Last, First Sr. Last, First; Last, First A.; Last, First Middle, … First Last, Jr. I'm trying to create a function that would reliably retu a list with everything properly order...

ادامه مطلب

Binning variable length lists in python

Vote count: 0 I have a dictionary d with 100 keys where the values are variable length lists, e.g. In[165]: d.values()[0] Out[165]: [0.0432, 0.0336, 0.0345, 0.044, 0.0394, 0.0555] In[166]: d.values()[1] Out[166]: [0.0236, 0.0333, 0.0571] Here's what I'd like to do: for every list in d.values(), I'd like to organize the values into 10 bins (where a value gets tossed into a bin if it satisfies the criteria, e.g. is between 0.03 and 0.04). What'd I'd like to end up with is something that looks exac...

ادامه مطلب

C# Sort list of class properties based on another List strings

Vote count: 1 I loop through the list of properties using reflection and assign the table cell that value. My header titles for the columns are in the wrong position at the moment though. How do I sort the dataList properties based on the header list? I would rather do it this way than sort header list based on properties. dataList type will always be a class with properties. public void SetTableStrong(List dataList, List header) { // Define our columns Column c = null; foreach (var item in head...

ادامه مطلب