I need an Object Pool, and rather than implement it myself, I thought I would look around for a ready-made and tested Python library.
What I found was plenty of other people looking, but not getting many straight answers, so I have brought it over here t...

Asked By Oddthinking

I have a list of dictionaries and want each item to be sorted by a specific property values.
Take into consideration the array below,
[{'name':'Homer', 'age':39}, {'name':'Bart', 'age':10}]
When sorted by name, should become
[{'name':'Bart', 'age':10...

Asked By masi

What's the difference between the list methods append() and extend()?

Asked By Claudiu

When should I use a dictionary, list or set?
Are there scenarios that are more suited for each data type?

Asked By Blankman

I am trying to construct a general tree. Are there any built in data structures in Python to implement a tree?

Asked By vishnu

Which is the best data structure that can be used to implement Binary Tree in Python?

Asked By Bruce

Which is the best data structure that can be used to implement Binary Tree in Python?

Asked By Bruce

Like a Max-heap and Min-heap, I want to implement a Median-heap to keep track of the median of a given set of integers. The API should have the following three functions:
insert(int) // should take O(logN)
int median() // will be the topmost element of ...

Asked By Bruce

Like a Max-heap and Min-heap, I want to implement a Median-heap to keep track of the median of a given set of integers. The API should have the following three functions:
insert(int) // should take O(logN)
int median() // will be the topmost element of ...

Asked By Bruce

Like a Max-heap and Min-heap, I want to implement a Median-heap to keep track of the median of a given set of integers. The API should have the following three functions:
insert(int) // should take O(logN)
int median() // will be the topmost element of ...

Asked By Bruce

I am trying to do a pandas merge and get the above error from the title when I try to run it. I am using 3 columns to match on whereas just before I do similar merge on only 2 columns and it works fine.
df = pd.merge(df, c, how="left",
left_on=[...

Asked By lathomas64

I am trying to implement a simple stack with Python using arrays. I was wondering if someone could let me know what's wrong with my code.
class myStack:
def __init__(self):
self = []
def isEmpty(self):
return self == []
...

Asked By user2687481

No offence, if the questions is too basic. Let me know if you need more information.
I am looking for an idea to convert square-form tuple of tuples to pandas.DataFrame in a clean/efficient/pythonic way,
i.e. from
s =((1,0,0,0,),(2,3,0,0,),(4,5,6,0,),(...

Asked By Oleg Melnikov

No offence, if the questions is too basic. Let me know if you need more information.
I am looking for an idea to convert square-form tuple of tuples to pandas.DataFrame in a clean/efficient/pythonic way,
i.e. from
s =((1,0,0,0,),(2,3,0,0,),(4,5,6,0,),(...

Asked By Oleg Melnikov

Any help on this problem will be greatly appreciated.
So basically I want to run a query to my SQL database and store the returned data as Pandas data structure.
I have attached code for query.
I am reading the documentation on Pandas, but I have probl...

Asked By user1613017

Any help on this problem will be greatly appreciated.
So basically I want to run a query to my SQL database and store the returned data as Pandas data structure.
I have attached code for query.
I am reading the documentation on Pandas, but I have probl...

Asked By user1613017

Any help on this problem will be greatly appreciated.
So basically I want to run a query to my SQL database and store the returned data as Pandas data structure.
I have attached code for query.
I am reading the documentation on Pandas, but I have probl...

Asked By user1613017

What is the best way to declare a variable of type "uint8_t"* in Python?
uint8_t pipe_num;
line 182 of
https://github.com/maniacbug/RF24/blob/master/examples/starping/starping.pde

Asked By Alex Alves

I had an interview with a hedge fund company in New York a few months ago and unfortunately, I did not get the internship offer as a data/software engineer. (They also asked the solution to be in Python.)
I pretty much screwed up on the first interview p...

Asked By its.david