Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: The difference between two functions
Post: RE: The difference between two functions

Yes. You can always use the type function to test that. Examples (Out[10] is the output for the line of code above it): from decimal import Decimal 2/5 Out[10]: 0.4 type(2/5) Out[11]: float Decimal...
midarq General Coding Help 2 2,884 Dec-03-2019, 12:57 AM
    Thread: Getting attributes from a list containing classes
Post: RE: Getting attributes from a list containing clas...

Fantastic explanation, thank you!
midarq General Coding Help 2 2,170 Dec-03-2019, 12:42 AM
    Thread: Multiple Line Input
Post: RE: Multiple Line Input

(Dec-01-2019, 11:13 PM)helenaxoxo Wrote: (Dec-01-2019, 10:49 PM)Gribouillis Wrote: Start with a simpler program that reads any number of lines until it meets a line containing only 0.how would i d...
midarq General Coding Help 4 2,946 Dec-02-2019, 08:19 AM
    Thread: type of object as a string
Post: RE: type of object as a string

Try type([]).__name__
midarq General Coding Help 1 2,294 Dec-02-2019, 08:01 AM
    Thread: Getting attributes from a list containing classes
Post: Getting attributes from a list containing classes

Hi! I have a small problem: I defined a class Tone which inherits from the class Recorder. (i.e. a recorder is an instrument which has many notes). Each Tone has certain attributes like frequency, f...
midarq General Coding Help 2 2,170 Dec-02-2019, 06:55 AM
    Thread: Most efficient way of reshaping a list-array structure
Post: RE: Most efficient way of reshaping a list-array s...

Much faster, thank you!
midarq General Coding Help 2 2,073 Sep-25-2019, 09:32 AM
    Thread: Keras: Time series classification
Post: Keras: Time series classification

Hi! I am designing a Neural Network for a classification of time series. I have 4 classes of functions and around 50000 samples for each class. The functions have a length of about 500 points normali...
midarq Data Science 0 2,005 Sep-25-2019, 09:03 AM
    Thread: Most efficient way of reshaping a list-array structure
Post: Most efficient way of reshaping a list-array struc...

Hi! I'm dealing with huge data and I'm looking for an efficient way to reshape my list of arrays. Here is my solution which I find to be slow #x is an input of shape [file,measurement, array(n,r)], i...
midarq General Coding Help 2 2,073 Sep-25-2019, 08:47 AM
    Thread: Instances sharing attributes
Post: RE: Instances sharing attributes

This is much more compact! Thanks! class my_data(): def __init__(self, mn=None, r=None, x=None, y=None): self.x = x or [] self.y = y or [] self.mn = mn or [] ...
midarq General Coding Help 4 2,493 Sep-20-2019, 11:13 AM
    Thread: Instances sharing attributes
Post: RE: Instances sharing attributes

Thank you for your solution. I wonder however if there is a more elegant way of achieving the same results. My code so far looks like this: class my_data(): def __init__(self, mn=None, r=None, x=N...
midarq General Coding Help 4 2,493 Sep-20-2019, 10:30 AM
    Thread: Instances sharing attributes
Post: Instances sharing attributes

Hello, I have the following problem: Why is the instance B updating and how do i prevent that? class myclass(): def __init__(self, x=[]): self.x = x def append_to(self): sel...
midarq General Coding Help 4 2,493 Sep-19-2019, 04:26 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020