« first day (3610 days earlier)      last day (1324 days later) » 

2:48 AM
@MisterMiyagi I am seeing this for the first time, how does this work without a being defined earlier? any links if this is some known concept I am missing
 
 
4 hours later…
7:01 AM
@python_learner Just exploiting regular assignment allowing multiple target lists: docs.python.org/3/reference/…
"An assignment statement evaluates the expression list (..) and assigns the single resulting object to each of the target lists, from left to right."
by the time the second assignment a[0] = ... is run, the first assignment a = [] is already done.
relying on the order of assignments is not something good code should rely on, though.
Multiple assignments can be useful to clearly show that multiple (distinct) terms really are meant to be aliases.
For example, storing a value as an attribute and local name allows to expose state without sacrificing the speed of local lookup.
 
so if it were possible to print the repr how would it be?
i understand python cant do that, but just so I can visualize so this will stick with me
 
7:18 AM
The "proper" repr is infinite. It cannot be printed.
 
so its like a cycle?
 
There is an infinite sequence of [ followed by an equally long sequence of ]
 
yeah that clears it, thanks
 
7:43 AM
How to use PACKET_MMAP in python?
I know there is socket option for setting PACKET_RX_RING circular buffers in C++ Really,I want to do them in python....,263 is the code of SOL_PACKET and 5 is the code of PACKET_RX_RING . but,how to pass the arguments?.....s.setsockopt(263,5,arg) that is for C++ https://www.kernel.org/doc/Documentation/networking/packet_mmap.txt...
any suggestion?
 
8:10 AM
The socket module directly wraps the underlying calls. If you can do s.setsocketopt in C++, try the same in Python.
 
 
1 hour later…
9:14 AM
df1.compare(df2) gives me AttributeError: 'DataFrame' object has no attribute 'compare'error
 
What version of pandas are you using?
 
0.25.2
Oh I have to update to 1.1.0
Didn't realize how old my pandas was
 
raf
10:06 AM
Hi, I am quite new in StackOverflow. I am not sure if it's the right place to ask about my problem.
I just found out that I am banned from asking new questions. Can you please tell me how to get rid of this issue? My one question (https://stackoverflow.com/q/63095658/7673979) is closed and another question (https://stackoverflow.com/q/63057954/7673979) has got -1. I have tried my best to write my question properly.
This page (https://stackoverflow.com/help/question-bans) says I have to wait for 6 months to ask new question! This is really disappointing to me. :(
What can I do to get out from this block? Any help or suggestion is appreciated!
 
@raf Sometimes you can ask a moderator to re-open the question and you can improve on it. If it gets a better feedback it may lift the ban. But i'm not too sure on the entire process.
Well that's what happened to me in Superuser anyway
 
Your question record doesn't look too bad, I'm surprised that's enough for a ban. Do you have any deleted questions?
 
Is there a way to get the variables in the debugger and use them in the console for pycharm?
 
raf
@Aran-Fey No, I don't have deleted any question. To be honest, I am quite new in coding.
 
I can't seem to copy the resulting dataframe from debugger and try to run some code in the console on it
 
10:15 AM
what debugger?
 
raf
And I need help with different problems nowadays. I found Stackoverflow so helpful. But then I found I am banned :(
 
@Janith There is a debugger feature in pycharm where you can step through code and stop at a breakpoint
I just wanted to get a few rows from the loop and use it as a sample data set in the pycharm console
There is a console in the debugger itself but when I try to type stuff it just seems like a string is being printed so I can't seem to play around with it there
 
@raf You may want to raise the issue on Meta. The question-ban algorithm is not public, but your question history does not look bad to me at all.
There are also some moderators frequenting this channel, so you might also want to wait a bit for them to look into it.
 
@raf To be honest, SO isn't exactly the right place to ask beginner questions. Things like finding the most common list element or doing case insensitive string comparisons have all been asked hundreds of times already. So while I don't understand why the algorithm banned you, I agree that you would be better off asking somewhere else. Maybe try reddit?
 
10:20 AM
@raf The question with the -1 is not questions you can ask in SO but the one that was closed looks a bit better
 
raf
@Pherdindy Where should I ask that question (-1), should I delete it now?
 
@raf stackoverflow.com/help you can check this link to see how to structure questions here
 
I've just renamed "Type hinting a list of a specified type" to "Type hinting a collection of a specified type" to be more suitable as a dupe target: stackoverflow.com/questions/24853923/…
 
Sometimes the criticism is unavoidable depending on the people who views the questions but generally following guidelines and making sure to check if it was asked before would prevent most issues. But i'm not the best user as well so you can also ask others for tips
 
Can this be added to the canonicals?
 
10:27 AM
 
raf
@Aran-Fey Okay, thank you. I will remember that from now on. But I didn't ask questions if the exact solution to my problem is already available on previous threats. I always search for solutions before asking new questions. :(
 
@MisterMiyagi in C++ ,it takes a struct memory address and size of the contents as arguments.but,in python, if I pass a memory address using _ctypes as argument,it will work?
 
@raf there is a lot of noise in the forums it cannot be screened as there is too much. So there is usually a good chance you miss something and ask a duplicate
 
raf
Yes, I understand.
 
@Janith See the docs on socket.setsockopt. This should correspond to what you are trying to do.
@raf Take note that your question is very, very likely not due to that single duplicate question. SO is full of duplicates, they are not bad per se.
 
raf
10:31 AM
@MisterMiyagi kindly give me the link of Meta. Did you mean the chatroom meta or meta.stackoverflow.com ?
 
The latter. But as said, you can also wait a bit for a mod to show up here.
 
raf
@MisterMiyagi Yes, I understand that my problems are not unique and many many people have faced these problems and asked in different angles earlier, I haven't yet become such pro that I search for my solution among them.
 
You should also take a look at this thread if you haven't already.
@raf No worries, it is fine. The StackOverflow search is notoriously bad anyways.
 
raf
@MisterMiyagi Then I should better wait. What if I asked in meta and got banned there too! 😶
 
@MisterMiyagi it takes 3 arguments ...(if value is none,4 arguments),in C++,it wants to pass 4 arguments.....? I want to implement zero-copy networking in python....that is why I am asking....but,I didn't find any useful links... I can only tracking sys calls using strace...Idk other ways...that is the syscall...setsockopt(3, SOL_PACKET, PACKET_RX_RING, 0x7fff5fcb00b0, 28)
 
raf
10:36 AM
@MisterMiyagi Thank you, I will take a look there.
The sad thing is my account reputations on other StackExchange sites are quite good. The lowest is here and also got banned for silly questions! 😓😓😓
 
Ok found how to use the console in the debugger have to press Show Python Prompt this is cool
Used to always modify the code and copy paste into the pycharm console
 
@Janith Well, you will have to do some trial and error, then. I don't have an appropriate Linux to try for myself.
 
ok
 
From my local man page, the syscall is setsockopt(int socket, int level, int option_name, const void *option_value, socklen_t option_len), so the appropriate Python call is probably sock.setsockopt(SOL_PACKET, PACKET_RX_RING, <value>). Python will automatically compute the option_len as long as a non-NULL value is passed.
 
 
2 hours later…
1:01 PM
Hi guys, just started OOP and i had a small doubt, is self supposed to mean something like global but for OOP? Sorry, if the Q is lame but i just had a feeling it did.
 
self is just a name commonly used for an instance. it is not technically different from other names. global is different, in that there is only one global scope (per module), and global will always refer to that one.
In other words, self is a variable, global is not.
In fact, instances (and thus self) are often used to avoid the problems of global. A method is parameterised by the instance (self is "passed in") whereas a function using global will always use the same namespace.
did that... kinda answer your question?
 
1:32 PM
no MCVE, example code is malformed and incomplete stackoverflow.com/questions/63702716/…
 
2:04 PM
morning cabbages, all
I haz a question about "they" pronouns. I work with a gender non-binary person who prefers to use "they pronouns". I have no problem with this (nor should I), but I'm somewhat curious about the grammar. "They (third person plural) know that python is the best programming language" sounds right. "They (third person singular) know that python is the best programming language" sound like the "know" should be "knows". Does anyone have any thoughts on this?
 
2:18 PM
My thoughts: "they knows" makes you sound like Gollum (:
 
My native language uses third person plural as a formal form of address. Using plural-they for individuals doesn't make me flinch.
 
@inspectorG4dget as far as I know, singular they has the same verb declination as plural they
 
Def. "they know", but "themself"
And just ask the person for their preference :)
 
oh I'd totally ask about preference. I was just curious about the grammar mungling
thanks for the wiki article. I didn't know it existed. It was quite helpful
 
on a related note resources such as A Guide to Being an Ally to Transgender and Nonbinary Youth can be useful
That's of course about being nice, not just grammar
 
2:40 PM
I like the idea of custom pronouns being able to hack the rules of adjacent words.
My pronouns are he/him, plus you have to reverse the spelling of "its" and "it's" in all sentences following my pronouns for the rest of the day
None of this "all possessive words get an apostrophe except for this one" nonsense
I've been trying to get into the habit of using first-person "they" for Internet strangers that haven't stated a preference, but it's a work in progress. I'll end up writing things like "OP posted their code, but they messed up the indentation. Is he mixing tabs and spaces?"
 
@Kevin And also except for his, hers, yours, ours, and theirs.
 
there is a query in the chat trascript somewhere to check how often we use "he" in commencts on stackoverflow
 
Good point, I'll add those into my pronoun privilege escalation exploit
hi's, her's, your's
 
=(
 
Or perhaps his' or his's
 
2:50 PM
Hello !! :) Need suggestion for integrating service now (ticketing tool )and a web application search palette using python and webdriver selenium. guide me with a direction.
 
What's a search palette? I'm not familiar with the term
 
I mentioned wrong , I should say searchbox
 
How do you want to integrate them?
 
Integration has to be done in terms of automation, I want to create an script which can auto close the tasks of Service now by searching any user id or its email address, that does not identified in the web application's search
 
Ok. So the script opens the service's task page, and for each task present, it opens the search page and searches for the task's author's user id. If the results page has no results, you open the task's page and close the task. Seems easy enough.
 
3:04 PM
anybody here have much experience using vagrant and virtualbox to practise hosting a python app the laptop?
 
yes most of this way only, Let me explain what I have done till yet, using selenium webdriver I have achieved the authentication to all the web application which I want to hit for the search. Now I am not getting how to integrate these application with Service now. I lack with API knowledge, I started to dig up in to get a clue but not sure If doing it through API is the solution.
 
Usually if you have the choice between an API and interfacing with the service some other way (for example a web browser), the API is faster and more reliable
 
@MisterMiyagi after searching several times... I got something.gist.github.com/gteissier/4e076b2645e1754c99c8278cd4a6a987
 
alright , great I was no the right direction. @Kevin thanks. I will learn more for this.
 
3:13 PM
@ruchiyadav Good luck :-) Sorry my advice is fairly generic. If you have any specific problems and can provide an MCVE, I'll be happy to look at it
 
dpaste.com/CXUCDQ7YT whenever trying to start up a vagrant server for a python app i am receiving this any idea as to what I should do to sort it out? I have tried turning off the hypervisor in my system but that turned to be a bad idea as many problems came up... any assistance would be great
 
I am sorry MCVE stands for!
It would for more explaination, let me share the image form atleast, to take a glance on it
 
mcve -- in other words, code I could run on my own machine and see the problem
Obviously it can be quite difficult to make one if you're trying to access an intranet site or the API you're using needs username/password authentication, which is why I didn't ask for an MCVE right out of the gate. Sometimes it's just not feasible.
 
3:28 PM
@Kevin, Sorry for the specific ping (& for bothering ya as well ), If you remember our convo about itertools.combinations where you suggested using generators, I posted that as a question on SO with a lot more details & discussions. Can I share that question link here for everyone to have a look?
 
Sounds good to me
 
Alright :)
0
Q: Iterating through a generator of itertools.combinations object takes forever

P S SolankiI'm using itertools.combinations on an array so first up I tried something like aList = [list(x) for x in list(cmb(arr, k))] where cmb = itertools.combinations, arr is the list, and k is an int. This works totally good for len(arr) < 20 or so but this Raised a MemoryError when len(arr) became 50...

Also have a look at the only answer by fusion which works well but it seems like that doesn't account for all the possible combinations.
 
yeah thats true, here I am sharing the images to have you a look ruchi789.imgur.com/all
hope this helps a bit
 
@ruchi I'm unable to see the image for some reason.
 
The suggestions I made the other day about replacing the list comprehension with a generator has two benefits: it reduces the memory required to store the results, and it amortizes the expense of calculating the result across the whole iteration. In other words, rather than taking an hour to show you the first element and then being able to view all other elements instantly, you can view the first element in a second, and then the next element takes another second, and so on.
 
3:35 PM
how to upload image over here, , need to learn this too. kindly help
 
But amortizing the cost doesn't reduce the cost. If constructing the list comprehension takes an hour, then iterating completely through the generator will also take an hour.
 
okay, got it my bad, I dont have 100 reps :(
 
This is an inherent quality of itertools.combinations. The existing answerer is on to something when they suggest skipping itertools entirely and trying to construct the output you want by rearranging the input
 
Exactly Juanpa told me the same. He said that generator actually doesn't create those combinations at that very moment. It just creates a generator object which later generates the combinations on the fly, Right??
 
Yeah
You have input samples and expected output, right? I'm interested in seeing those, especially whichever ones don't work with fusion's code
I can't promise much because I'm not entirely familiar with the concept of variance, but maybe I can pick it up on wikipedia
 
3:42 PM
Alright. How can I share those with ya?
 
pastebin.com is my preference for sharing largeish pieces of code/text. dpaste.org is also fairly popular.
 
@Kevin That's alright. Or maybe use statistics.variance() to find variance of a list.
Alright doin' it now.
 
@PSSolanki you're right that fusion doesn't do an exhaustive search of all the combinations of the list elements. However, the ones they do consider are provably better than the ones they don't
 
Not exhaustively searching is good because 50 choose 8 equals half a billion
 
@inspectorG4dget That's an insight. But it gives me a wrong answer.
Yeah juanpa's calculations estimated it to take 140 hours to complete :O
 
3:47 PM
I have a feeling that fusion's code is close to being correct, but there's a corner case nobody considered, or the problem statement isn't quite what it appears, etc
 
Kevin'd by Kevin
 
@Kevin @ps
@Kevin @PSSolanki how should I show the image :-|
 
It is one of hard algorithmic challenges on hackerrank.com
 
@ruchiyadav imgur usually works here, so it's strange that your earlier message didn't work. Maybe the url got scrambled somehow? Try uploading it again.
 
sure
 
3:50 PM
https://ruchi789.imgur.com/all doesn't look like a typical album url to me, but maybe things work differently for private albums, idk
@PSSolanki Coding challenge sites love to give problems that are easy to misinterpret :-)
 
Success 👍
 
yeah :)
 
so like the task appearing , there the termination tasks get created. once I click on task manually it gives the all details of the user . I hope its bit clear now
 
3:58 PM
@PSSolanki Ok, so far so good. Do you know what output fusion's code produced, and what output hackerrank expects? I know coding sites can be secretive about their test cases...
 
expected o/p for n = 20 is 5958, and for n=50 it's 9293.
The code by fusion produces around 8k (not exact) fir n=20 (surprising for me).
 
Ok, cool
 
Couldn't agree more xD
i hate the corner cases tbh :/
 
Hmm, why does fusion's myvar function define a variable m, and then never use it? Is that a typo?
Wouldn't it be funny if everything suddenly worked if you changed the last line in the function to return sum((i-m)**2 for i in arr)/l
 
I think that is a typo
No its not. the typo is in the return statement and yeah that's gonna be crazy + funny.
 
4:08 PM
If I correct the typo I get a min variance of 205037.75999999998 for the n=20 case, which doesn't match your desired output, so no easy win for us there :-/
 
No that works fir us actually.
 
Oh, it works? Cool. I guess I entered the test data wrong or something.
 
the expected output is not the minimum variance's value. it's sum of the absolute differences of the combinations (of 2 elements) in the sub array having minimum variance.
 
Oh, I was wondering why the expected output was an integer. That explains it.
I should have read the question more closely :-)
 
Annybody able to assist me with setting up a vagrant server? dpaste.com/CXUCDQ7YT whenever trying to start up a vagrant server for a python app i am receiving this any idea as to what I should do to sort it out? I have tried turning off the hypervisor in my system but that turned to be a bad idea as many problems came up... any assistance would be great
 
4:13 PM
It works perfect for len(arr) upto 10k.
Still it doesn't pass on 8 out of 15 test cases because of execution time limits. The minimum of them has len(arr) = 100k. Damn these coding websites.
 
The runtime is approximately O(n log n + n * k), which shouldn't be too slow for n=100000. Assuming k is also small.
k = n/2 would be the worst case scenario
 
Yeah the time complexity is not that huge for the values but idk how much time do they allot for a test case. Anyways the expected output for n=100k is 161895840188550 :O
they must be those crappy 'Corner Cases'
 
Now I'm inclined to say that while fusion's approach is clever, correct (after fixing the typo), and faster than anything I could have written, the approach that hackerrank is looking for has to be even more clever and fast
 
it would help to have the actual problem description
 
problems at the hard rank can demand an unreal amount of algorithm design skills
 
4:22 PM
@kevin I'm still happy you spotted that typo in myvar function by fusion to at least clear out 5 more test cases xD
 
usually, there's a catch that you must identify and exploit
 
@Kevin I would agree
@MisterMiyagi forgive me if that's not the case but Is that message intended for me?
 
yes
sorry if you already posted it, the transcript is a tad long
 
I agree that it's valuable to share the exact problem description. There might be some easily missed sentence that reduces the problem space in some offhanded way that we can exploit
Like, if every element in the array is an integer between 0 and 1000, maybe the problem becomes easier to solve, compared to if it could contain integers of any size
 
No i didn't post it. I just added it as a question on SO. Let me share the actual problem statement. I am starting to think that my approach of going with variance thingy won't work for every case.
That's True.
although all the integers in array can be as long as they want.
@Kevin @MisterMiyagi Here is the problem statement.

https://hackerrank-challenge-pdfs.s3.amazonaws.com/1049-angry-children-2-English?AWSAccessKeyId=AKIAR6O7GJNX5DNFO3PV&Expires=1599153877&Signature=MFcyD0iwE2giBk5VROhW2ePTmK0%3D&response-content-disposition=inline%3B%20filename%3Dangry-children-2-English.pdf&response-content-type=application%2Fpdf
 
4:30 PM
@Kwsswart I think it's a good idea to keep your hypervisor on, yeah. Other than that, I don't know what might be causing the problem... Are you on Linux? The guys at chat.stackexchange.com/rooms/26/dev-chat might have some ideas. Or maybe chat.stackexchange.com/rooms/118/root-access?
 
Note that the problem defines the varianse as abs(x - x^), not sqrt(x - x^)
 
If you can replicate that error without using vagrant, just by executing that startvm command, that should help narrow things down
 
no, not even that...
it's just the pairwise difference
no average needed
 
Hmm! Surprising, then, that the variance we've been using has given correct answers for half the test cases. Must be some mathy thing I don't understand.
 
@MisterMiyagi Yes it's the pairwise difference. I went with variance approach because variance tells how spread the data in a list is (square of standard deviation from statistics).
 
4:35 PM
I'm worried that variance and unfairness are strongly but not perfectly correlated, so any variance-finding approach will fail on any test case that Hackerrank deviously composed for the purpose of tripping up people like us.
If you can prove that the combination with minimum variance is also always the combination with minimum unfairness, that would be ideal
 
@Kevin It must give correct answers. Because it is a measure of spread of data. the less the spread, less will be pairwise differences' sum. And it will actually give correct answer for other cases if it can be executed in time limits.
 
I don't entirely get it but I believe you
 
I'm decently sure that variance is more biased against outliers.
 
I may not be able to prove that, but based on my math classes, i guess it should be true. (not entirely certain again, the guys at hackerrank may have known this before me xD)
 
Coding challenge sites love to pull the football away from users that make reasonable guesses :-)
 
4:40 PM
@MisterMiyagi umm. that statement could actually lead to a good research.
Hehehe I'm more of a cricket guy but i have to agree xD
 
Do we have a canonical "ModuleNotFoundError because package not installed" question for dupes?
 
My guess is no, since a ModuleNotFoundError has a good chance of being closed as non-reproducible. (whether it should be closed is another matter, I'm just going by trends of what people actually do)
 
On an unrelated topic, I liked the KevinScript :) @Kevin
@SuperStormer I would also guess no
 
KevinScript is my precious baby that I leave unattended for long periods of time
 
4:46 PM
Yeah, I saw that. contributions from david as well.
That could actually turn out to be a good precious baby :-)
anyways what do you think could be a good approach to find that minimum unfairness sum?
 
I am deliberating on that now
 
:-)
 
@MisterMiyagi I've never seen an inappropriate linux...is the prompt three eggplant emojis?
 
I need some duping help. This Q is technically a mutable-default problem, but accessing it through User.__init__.__kwdefaults__ makes this quite non-obvious. Is hammering with a canonical appropriate?
@toonarmycaptain Pardon?
 
It appears I installed brew on my Ubuntu system two years ago and forgot about it. I just typed brew install hello and it said Updating brew then was silent for eight minutes before spewing about two thousand lines of error messages. Think I might just reinstall ...
 
5:01 PM
perfect situation to try how good brew doctor really is ;)
 
@Kevin Thanks mate will look there
@Kevin Would that be within the git bash terminal?
 
@Kwsswart Although I don't have much idea but according to kevin's suggestions, i would guess in the system terminal or where ever that's configured to be at (might be git bash)
 
@Kevin I tend to close as such just because it's impossible to repro. It's a safe bet that it'll just deteriorate to them saying "I definitely did install it" and you replying with "no, you definitely didn't" and then, well, the hammering tool of choice is whatever implement is closest to you
 
@PSSolanki ive been using git bash as I am on windows trying to setup a linux server and need to have access to OpenSSH
 
5:44 PM
Ugh. Defeated on the crossword by one word; "chalcedony". a_a_e.
(I know the answer now but that seems a bit rough)
 
When I was a kid, this word ^^ was our term for an oversized marble.
When kids still played marbles. (I've since lost many of mine.)
 
Oh, we just had "dobber" for the bigger marbles :P
 
I had this word pop in my head last week: "desuetude". I remembered the word, thought I remembered what it meant, but looking it up I had it wrong (I think I was confusing it with "lassitude"). The definition I found was the obsolescence of something due to disuse - mostly in a legal context, of laws that become discarded from lack of enforcement. But I think that there is a good parallel in software, esp. open source.
Not really having any law background, I've no idea where I picked that up.
 
hi, I want to make members of a row in a matrix or list to be multiplied by zero, this is the MWE but the result is not what I want. could you help me understand what the problem is?

def someFunc (myList):
[0*x for x in myList]

a = [[1, 2, 3],[4, 5, 6], [7, 8, 9]]
b = [someFunc([1, 2, 3]),[4, 5, 6], [7, 8, 9]]

print (a)
print (b)


results:

[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
[None, [4, 5, 6], [7, 8, 9]]
 
@EnthusiasticEngineer - your function has to return its value using the "return" statement.
(@Kevin - note, no ' ^^)
 
5:56 PM
@PaulMcG I guess I'll tuck that word away, though, for future challenges :)
 
@PaulMcG thank you paul, solved. sorry, I am a beginner in programming and thought this is too easy to be posted in the main website.
 
user13415013
guys, How can i import outside conda libraries inside virtualenv without installing libraries to virtual env
 
Why would you do that?
 
user13415013
I have made virtualenv, but installing those huge tensorflow packages from scratch is messy, instead i could use my local conda (base) packages import inside virtual env
 
It's not messy if you use conda to create the venv in the first place. I'm smelling an XY problem
 
user13415013
6:05 PM
:D not xy problem ,
 
Very reassuring. I guess I'm off the mark
 
user13415013
My question is I want to install those conda(base) libraries to venv without installing again to venv.
 
Err. What part of this isn't an XY problem?
 
user13415013
ok then I will again download large libraries to venv
 
user13415013
see you guys later.
 
6:17 PM
@nerd half the time I'm tethered to my phone, so I can appreciate limiting bandwidth. I think you can create conda environments without re-downloading but you'd need to configure that when you create the environment to copy the libraries over
 
whats the downside to turning off the hypervisor?
 
@nerd is that what you're asking? Once I'm on unrestricted interwebs, I don't really care if it has to re-install on separate virtual environments
 
@nerd Set PYTHONPATH to point at the libraries.
@Kwsswart hypervisor as in "virtual machine hypervisor"?
 
@MisterMiyagi yeah from applications and feature > Programs and features > turn on off features of windows > windows hypervisor platform
this is the only way i can get vagrant to work along with enabling VT-x in bios
 
6:38 PM
@MisterMiyagi Is there any danger as it is the only way I could figure to work this lol
 
6:49 PM
@MisterMiyagi yes mate, thanks a lot !!
so if i say def __init__(hey): then this hey is actually same as self?
 
It's functionally equivalent, but your coworkers will want to stab you if they see that
 
Cool Cloud think so I believe you can customize it but it's not convention unless certain specific cases
 
 
2 hours later…
8:56 PM
Cabbage
Anyone can help me with this pandas question? I posted it 5 days ago
https://stackoverflow.com/questions/63642173/pandas-apply-merge-operations-from-a-column
 
9:08 PM
Wow, 5 Days and no answer? Put a bounty
 
@AadityaUra umm... any reason you've got lists in a DF?
 
9:25 PM
@JonClements Yes, so I have to do data cleaning and other preprocessing which depends on other columns values, If I am storing in numpy array or dict, it's hard to maintain the mapping sequences conditions, here I can drop and do multiple operations based on different columns.
 
okie dokies - if I remember, I might get around to having a look tomorrow - no guarantees though
 
Welcome back, @DarkRunner. Please don't flag things that don't need flagging.
 
You deleted that question.
 
Nope. And if I had, would that merit a flag on my chat message? Of course not.
 
9:42 PM
@AadityaUra not really. It's an inappropriate format to store the data
Dataframes work best (at all) if you are using things like ints or floats. Not python structures like lists
You might not like the responses but isn't that better than just helping you botch something?
 
@AndrasDeak Would you mind reviving the question?
 
@DarkRunner Yes, and I can't. But it's not yours so don't worry about it.
 
10:03 PM
@JonClements You are absolutely correct, What would be a better solution if I have NumPy float values with nth dim and there is another column which I am using as a condition value selector?
how I can maintain the mapping if NumPy matrix depends on multiple columns conditions?
 
@AndrasDeak At the moment, I can't ask questions on my account either. Can you lift that please?
 
@DarkRunner nope
 
@AndrasDeak Something like this :
`data = {'data_a': np.random.uniform(-1,1,[1000,10]), 'data_b': np.random.uniform(-1,1,[1000,10]), 'labels': np.random.randint(0,2,[1000]), 'flag': np.random.randint(0,2,[1000])}`

So here I want to filter numpy rows based on flag and labels values, for example if label is 1 and flag == True take that particular row of data_a matrix
What is a better solution to store all these four objects while I can do filtering without looping over all four?
 
What are you actually trying to do?
 
@roganjosh I am trying to filter matrix rows based on different conditions.
 
10:13 PM
Nah,I need something higher-level than that to understand the problem :)
As I already said, it's pointless having lists in a dataframe
 
@roganjosh It's an actual sound signal, I am trying to filter single signal using different filter conditions.
 
I don't know what it is, but I feel sure that something is missing before you get to for i in range(len(dataframe)):
I can't connect the dots, sorry
 
@AadityaUra why ping me?
 
@AndrasDeak I am sorry for that, It's a mistake.
 

« first day (3610 days earlier)      last day (1324 days later) »