Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~15.8K People Reached
Favorite Forums
Favorite Tags
Member Avatar for Niner710

I want to convert a Pandas DataFrame series to a List. In [63]: bayFails Out[64]: 0 [0, 1, 4, 5, 6, 8, 9, 12, 13, 14] In [63]: type(bayFails) Out[64]: <class 'pandas.core.series.Series'> Can someone show me how to convert bayFails into a list?

Member Avatar for dashing.adamhughes
0
1K
Member Avatar for Niner710

I have a question on how to slice a dataframe. Below is a row in my dataframe. I just want to get the list under column C. I saw that I could use df.get_value(), but I'm not sure what to put for index. Is this the right way to return …

0
54
Member Avatar for Niner710

Hi, I have a python array that is either a list or numpy array. I want to do a bitwise inversion of all the elements and was wondering what the easiest way would be. a = [0xFF,0xFF,0xFF,0xFF] invert to.... b = [0x00,0x00,0x00,0x00] What is the easiest way to do this? …

Member Avatar for TrustyTony
0
77
Member Avatar for Niner710

I have a large dictionary and want to filter the dictionary by values, which is in Hex. dataDict = { ('apple':0,'orange':0):0x8000, ('apple':0,'orange':1):0x0001,('apple':0,'orange':1):0x0010 } What I want to do is filter out the values of the dictionary according to a match. For example, one of the filters I would print out …

Member Avatar for TrustyTony
0
170
Member Avatar for Niner710

I am trying to use the mechanize module to automate a task on the web. I am able to get the first form to submit correctly. After I submit the first form I would like to take the data from the second website(or form) I am taken to(after I enter …

Member Avatar for Lucaci Andrew
0
667
Member Avatar for Niner710

I am interested in using a PanDas dataframe to manipulate data. Can anyone tell me how to append **b ** into **df** so that I get **7 8 9 10 5 6 7 8** as my **df** dataframe. from pandas import * a = [ [7,8,9,10], ] b = [ …

0
69
Member Avatar for Niner710

Hi, I would like to parse the following line and store all the values into an array. The values are separated by commas. I am unsure of how to do this without having a super long parsing string(i.e if(/.*/). At first, I was thinking of some type of loop, but …

Member Avatar for 2teez
0
170
Member Avatar for Niner710

Hi, I have a dictionary with the key as a tuple. x = { ('AA',1,3):0.56, ('BB',0,3):0.70, ('AA',1,3):0.10, ('CC',1,3):0.60 } I would like to get all the values where the key is equal to... ('AA',1,3) However, when I use it only returns the last value where ('AA',1,3) is found. x.get( ('AA',1,3) …

Member Avatar for TrustyTony
0
3K
Member Avatar for Niner710

Hi, I have a dictionary with the key as a tuple. x = { ('AA',1,3):0.56, ('BB',0,3):0.70, ('AA',1,3):0.10, ('CC',1,3):0.60 } I would like to get all the values where the key is equal to... ('AA',1,3) However, when I use it only returns the last value where ('AA',1,3) is found. x.get( ('AA',1,3) …

0
57
Member Avatar for Niner710

Hi, I am interested in trying to make a cumulative distribution function in Python. I have a set of data in a numpy array and just want to plot that data. numpyArray = [0.4, 0.3, 0.6,1.2,1.8, 0.5] I would also like to have a vertical line on the x-axis at …

Member Avatar for Niner710
0
241
Member Avatar for Niner710

Hi, I created a numpy matrix(1 row, 3 cols) with the following values [4 6 8]. What I want to do is to concatenate all these values into a single entry of binary values. So instead of [4 6 8] I would want to have a numpy matrix of just …

Member Avatar for TrustyTony
0
131
Member Avatar for Niner710

I am new to Python and am looking for something in Python that is equivalent to parsing files in Perl. I have a text file as follows. [CODE] Blah.txt vcc = 2.6, clock = 1.5 Mhz vcc = 2.7, clock = 1.6 Mhz vcc = 2.8, clock = 1.7 Mhz …

Member Avatar for TrustyTony
0
181
Member Avatar for Niner710

I have a simple question with Python numpy. I have a numpy array as follows. [CODE]a = [ [1000 2 3] [4 5000 6] [7 8 9000] ] [/CODE] I want to be able to print 3 slices of the array to a txt file so that the elements in …

Member Avatar for vegaseat
0
544
Member Avatar for Niner710

I have a function called read() that interacts with some hardware and sometimes it returns the value very quickly and other times it could be very slow. I would like to have a timeout associated with my function read() so that if it takes over maybe a second then the …

Member Avatar for nbaztec
0
2K
Member Avatar for Niner710

I have an function in which I want to make a copy of an object. [code] ClassBase { public: Tblk myTblk; private: }; void ClassBase::CopyObject(const ClassBase &test) { TblkPtr_t myTblk = TblkPtr_t(new Tblk); //TblkPtr_t is a typedef shared pointer *myTblk = *test.myTblk; } [/code] For some reason that doesn't work. …

Member Avatar for mrnutty
0
110
Member Avatar for Niner710

Hi, I have a simple question on trying to set shared ptr to NULL. I get an error(binary '=': no operator found which takes a right hand operand of type 'int') when I do this... [code] typedef std::tr1::shared_ptr<A> A_smrt; A_smrt = NULL; [/code] Why is this wrong?

Member Avatar for abhi_elementx
0
104
Member Avatar for Niner710

Hi, I am trying to understand the concept of clone with respect to making a deep copy of an object. The class Bmapfile is an abstract class in which other subclasses will inherit from. I am not sure what to put into the doObjCopy function in Class BaseClass. I want …

0
90
Member Avatar for Niner710

Hi, I was just wondering how to convert a vector<string> to vector<int>. I am using the transform function from <algorithm> but I am not sure what the format is. [code] vector <string > string; vector <int> int; tranform(string.begin(), string.end(), int.begin(), atoi); [/code] Get a compile error. Could anyone tell me …

Member Avatar for Tom Gunn
0
4K
Member Avatar for Niner710

Hi, I was curious if I could return a vector from a virtual function. I keep getting an error for this. [CODE] Class A { public: virtual vector<int> getSomeStuff(); private: } .cpp File vector<int> A::getsomeStuff() { return; } [/CODE] Can anyone tell me what I am doing wrong?

Member Avatar for jencas
0
178
Member Avatar for Niner710

Hi, I am struggling with the best way to twiddle a large number of bits. What I have is a large amount of binary files(~100) in my directory that I need to do post processing on. I want to compare all the bytes in each file and see when the …

0
46
Member Avatar for Niner710

Hi, I am a newbie to C++ and want to know how to parse thru a binary file. I am having some trouble with some simple code. I have a sample binary file(test.bdb) that has "0069 0045 0089 0090" in the file. Here is my code for the file. [code] …

Member Avatar for Dave Sinkula
0
2K
Member Avatar for Niner710

Hi, I am new to Visual Studio 2005 and wanted to package up my code into a .EXE file. I also have other code not specific to Visual Studio that I want to package(LabWindows CVI). Can anyone give me instructions or point me in the right direction.

Member Avatar for ArkM
0
122
Member Avatar for Niner710

Hi, I am writing output to a file and am using ostream. I wanted to format my output and not sure how to do it. Here is some simple code. [code] int var1; int var2; ofstream out("blah.txt"); out << "Name " << var1 << endl; out << "NameofAnotherPerson << var2 …

Member Avatar for Ancient Dragon
0
112
Member Avatar for Niner710

Hi , I am trying to use a Boost shared ptr with a map template. I have a bunch of subclasses that will be derived from class TestSuperClass. I will then used a shared_ptr to point to the class and will use a map template so that depending on the …

0
57
Member Avatar for Niner710

Hi, I am trying to parse a txt file in C++. I usually use perl to parse thru text files but need to do it in c++. Here is my text file. [code] NAME BITMAPVBIREFE MESSAGE VirginBitMapiIrefE VCCVALUE 3.000000 VIHSELECT 1 VIHVALUE 3.000000 WPSELECT 1 WPARGSELECT 0 WPVALUE 2.600000 [/code] …

Member Avatar for Lerner
0
206
Member Avatar for Niner710

Hi, I keep getting an error in Visual Studio C++. I am trying to create a copy constructor but keep getting this error. "Windows has triggered a breakpoint in test.exe. This may be due to a corruption of the heap, and indicates a bug in test.exe or any of the …

Member Avatar for skatamatic
0
167
Member Avatar for Niner710

I am a little confused with class scope. Lets say that you have a class. [code] //file.h struct B { int BB; char CC; }; class A { public: struct B *getStructure(); private: int number; }; [/code] I dont understand what is the difference between putting struct B inside the …

Member Avatar for ArkM
0
119
Member Avatar for Niner710

If I have a bunch of structures defined within a class header file but outside the scope of the class how would I set a SETTER function to change the values. [code] struct VoltageValues { float Vcc; int TblkLoopEnb; double Blah; }; class TblkArray { public: TblkArray(); ~TblkArray(); struct VoltageValues …

Member Avatar for mcriscolo
0
154
Member Avatar for Niner710

Hi, I am new to C++ and trying to write a function that returns a pointer to a structure. I have a header file as follows. [code=cplusplus] class Blah { public: struct Values *getValues(); struct Values { int A; int B double C; } } My class file is as …

Member Avatar for ArkM
0
126
Member Avatar for Niner710

Hi, I was wondering if anyone knew of a good 5 day C++ class in the bay area or southern california. My company is looking to send a few of us to a week long training. The only one that I found was Hands on Training. Anyone know if this …

Member Avatar for Salem
0
247