Skip to content

How to change column value with pandas .apply() method

I stumbled upon an issue while trying to take data from a CSV file, assemble a key and then creating a new CSV file with only the necessary data. Example data: ID1 Data1 Data2 Price1 Color Key ID2 Data3 Price2 12345/6 950/000 Pd950 996 G 4/20017/6 4/20017/6 950/000 1108 12345/6 333/000 Pd333 402 G 4/20017/6 4…

Merge two Lists of different size

I have an issue with some part of my code, I’m fetching two apis and then mixing the results in one array: Initialy the two arrays seems like this (although they can be empty or with more or less data): Their shapes are: So of course, when I try to append them in the 2nd dimension: I get this error:

Graphene Python class doesn’t recognize self

I have the following Python module that implements Graphene. The problem is that resolvers that call other methods of the class raise this error: The line that rises the error is: if self.validate_path(path): I don’t know why, if method validate_path() is in the same class that the method that calls it.…

Python ctypes behaviour with variable types

I’m using a third party python library, that is using ctypes (it uses a dll). I’m not very familiar with ctypes. The lib offers a type definition and a structure definition as given in the minimum example below. I’m trying to assign the member variable myClassInst.MSGTYPE the value of the co…

Python grading system using if and for

I have list of name = jimmy, carolin, frank, joseph and their score is = 100 , 90, 70, 65 The grades are : and I put it like this I need to make it like this: Can some one help me please? Thank you in advance! Answer I added everything in one print statement, hope you can understand. Your