« first day (4163 days earlier)      last day (1009 days later) » 

00:00
This was previously working and until I upgraded to the latest version of Python. It might be the activate.bat is not set up the environment properly
Bytecode can change between versions.
@Andras_deak, I agree. I have generated the new bytecode using the current version of Python on the machine
At some future point, we are going to release the scripts on the deployment machine where we don't have to deal directly with the bytecode
00:30
@WayneWerner technically you could still compile python script to ELF binaries, but instead of directly wrapping it inside a ELF header, using cython to compile it might work better. (it'll compile to a .C source file, which you can then compile a last time to a binary file)
see here
obviously if you know RE or ASM/machine code, it's still possible to get something out of it, but as long as you delete the original reference to your code inside (or if you use the right flags with cython) you're probably fine
(and you also get a decent speed up by doing that, but your mileage may vary)
 
1 hour later…
01:44
Wish Python tuples had a built-in .replace(self, index, value) method (see here). Maybe someone can make a feature request?
(And I mean returning a new tuple with the element at index replaced with value.)
I wouldn't be surprised if someone already mentioned something related to this/similar feature in one of the PEP proposals
Haven't found one, but maybe I missed it.
Currently, tuples have 2 public methods: index and count. I think replace would be a good addition, since it's similarly simple and similarly useful.
It's also analogous to the ._replace method for NamedTuples.
02:50
How to find orientation and location of a particular feature in SIFT algorithm, OpenCV.
 
4 hours later…
06:31
For using selenium and looking at the "elements" tab of "inspect element" in Chrome I cannot seem to find exactly which identifiers to use to get the item of interest. Some fields seem to appear/disappear depending whether the dropdown is opened/closed such as <div class="next-overlay-wrapper opened"></div>
<button aria-haspopup="true" type="button" class="next-btn next-medium next-btn-primary next-btn-text next-menu-btn" role="button" aria-expanded="false" data-spm-anchor-id="a1zawj.21881959.tab_0">Download <i class="next-icon next-icon-arrow-down next-xs next-btn-icon next-icon-last next-menu-btn-arrow" data-spm-anchor-id="a1zawj.21881959.tab_0"></i></button>
This is the button that is pressed before the previous field appears/disappears but the issue is the class seems to appear 10 times within the html. So i'm not sure how to tell selenium to get a specific one. Is there a simpler way to automate my file downloading task or should I approach it in a different way
 
1 hour later…
07:49
Is your goal downloading a file only ?
Yeah just downloading a file mainly but unable to use requests
And there's several download buttons per page and I have to download them regularly
Why can't you use requests ?
There doesn't seem to be a pattern in the URL that I can make sense of like an API
Are you talking about the download page URL or the actual URL of the file ?
08:09
Referring to the download link itself of the file
Yeaah I suppose I have to save this for another day
It's quite complicated after spending 2 days and not really getting anywhere
Never worked with selenium but there must be a way to get the files
Couldn't you get all buttons that have Download as text ?
I can try i'm actually quite new to selenium it's my first time using it but all the tutorials are pretty straight forward where there is an obvious identifier
What I know if they have the same name/identifier they get the first one they stumble upon according to the reference
I also had to read a new topic on CSS selectors as advised by a friend but the stuff I see in the elements panel of the dev tool in chrome is not so obvious to me even when I try to isolate the containers. And to authenticate the program to log in to my account is also another issue which I feel is a little complicated
It's not such an important program anyway just something to automate me from clicking the download button everytime on several pages
Probably just gonna do it manually
08:26
Can we see the website? Otherwise I don't see how we can possibly help here
08:44
@Aran-Fey you won't be able to open the page as it requires authentication to an account to get to the page of interest. Gonna read more on selenium and its features more on my free time will hold it for now hah thanks
@AlexandreMarcq yeah this seems like one of the things I might need in the future thanks i'll just include this in my list to read
@Pherdindy back to the basics of scraping things you shouldn't, I see
It's just my financial reports from my seller account I think it should be fine it's just a lot. They don't have a "Download all" button :/
Sounds like my uni accounting system
you have to type in your password for each file you download one at a time
09:44
Does a bare -- have special meaning for argparse? I seem to have accidentally put it into the docs of some script as script --foo bar -- pos1 and, surprise, it works and I don't know why.
It seems to behave like "end of optional named parameter list", but I can't find anything in the docs.
in bash and co that's what -- means... but can't say for sure about argparse
(I'd kind of expect it to do the same though)
# run as `script.py --opts a b c -- bar`
import argparse
CLI = argparse.ArgumentParser("Dash Dash Em Arr Eeh \o/")
CLI.add_argument("pos")
CLI.add_argument("--opts", nargs="*")
print(CLI.parse_args())
Hey all :) Long time no see
@JonClements Seems to be the case. Not sure if I can rely on it, though.
@BadgerCat wow yes... how's things?
09:51
Good, guess where I work now. Starts with D and has a whale as a mascot :)
errr... Docker?
Yes :)
What have you been up to? ^^
Oh... same old stuff... mostly just being a cute yellow puppy :p
cbg folks :)
09:55
cbg
@BadgerCat curious as to what you do at Docker?
help with docking ships, i presume. right, right?
I do Community :)
sounds like that could be fun albeit it challenging :)
Time to shake the old fist again
shakes fist
11:32
Hello
Linux or Windows?
12:07
Oh wow, super fancy coloured progress bar in pip. Truly we live in the future.
Do they have jetpacks as well now? I was promised there would be jetpacks...
And still Numba conflicts with NumPy 1.22...
have we got hoverboards yet?
@AndrasDeak--СлаваУкраїні Just upgraded pip and all I can say is... That's some wicked witchery!
Pitchtorches are 50% off today!
who needs sane packaging anyway
12:12
Joking aside, I feel nothing but gratitude for the brave souls that keep the Python ecosystem running.
@JonClements Wasn't impressed by what I saw on youtube. :(
Looks like humanity has to solve reliable packaging first.
@AndrasDeak--СлаваУкраїні Is that a numba issue or a pip issue?
youch... Back To The Future was 1985?
I like to think of it as "pre 2000" and just pretend that wasn't too long ago.
@MisterMiyagi numba
it still sours my fancy coloured progress bar experience
I'm sure fixing the issue is in progress.
but 1.22 has been out for a bit more than 2 months so it's fine
I don't even normally use numba, I just want to have a local setup where it works, should I need it on occasion
I also don't need newest numpy other than that sweet new car smell
12:19
@MisterMiyagi yeah... let's go with that one :p
 
3 hours later…
14:50
Hello, how can I extract from my column of the form datetime64[ns] ( 2022-02-02 10:08:50 ) ONLY the yyyy-mm-dd (( 2022-02-02 )?
My column with datetime64[ns] is called "Date(UTC)" and I'd like to have a new column "DAY" with yyyy-mm-dd
@MisterMiyagi thanks a lot
15:12
Another short question concerning this post:
ou can double check the exact number of common and different positions between two df by using isin and value_counts().

Like that:

df['your_column_name'].isin(df2['your_column_name']).value_counts()
Result:

example isin

True = common
False = different
Does someone know how i can print out all the FALSE results here?
Test_Rec['_id'].isin(Test_B['count']).value_counts()
False 14
True 8
Name: _id, dtype: int64
Same here.. How can I print out all the FALSE rows?
Have you tried googling something like "pandas find rows that match condition"?
Yes.. But unfortunately I can't find what I am looking for. Apparently; true and false are 1 and 0 respectively. But I don't want to print out 1 and 0, but I want to print out the mismatched between the two dfs..
15:32
I have no idea what you're doing with a piece of code that counts the rows you want. You want to filter out rows that match the condition df['your_column_name'].isin(df2['your_column_name']). You have the condition figured out. All you need is a piece of code that selects rows based on a condition.
I'm noticing this a lot. Even though you've already figured out a part of the problem, you have no idea how to apply this knowledge. It was the same thing with your question about last names and currencies. They were practically identical problems, but you still struggled with the 2nd one after you figured out the 1st. You really need to start understanding what you're doing so you can effectively (re-)use the code you find.
@Aran-Fey I just don't manage to understand python.. I'm struggeling so much with it, and I just don't know HOW I can understand it. It's always the same and it's driving me crazy. I don't know what I'm doin wrong
I don't know either. But something needs to change.
15:52
You might want to take a step back from "I don't understand Python". That is not what you are struggling with, but it will subconsciously keep you from facing the challenge. What you are struggling with is subdividing a task into smaller tasks, and figuring out which of these are specific to a problem and which ones are generic.
It's also possible that you need to understand some pandas basics. For example, if you don't know that df['your_column_name'].isin(df2['your_column_name']) returns a boolean mask, and you just think of it as some sort of magic incantation, then, well, you'll have a hard time doing anything useful with pandas.
@Baobab en.wikipedia.org/wiki/Cargo_cult Reading this has definitely helped me become a better programmer
 
4 hours later…
20:10
@smci no need to be rude about it
I'm not being rude...! I'm suppressing reaction
 
4 hours later…
23:52
I want to subset two dataframes with same column names (drop the ones that don't match in each). I have been googling and testing but have yet to find something. So if df1 has columns A,B,C and df2 has columns B,C,D; I want to get df1_1 to have only columns B,C and df2_1 to have only columns B,C.
Just intersect the columns and use that to index both dataframes?
>>> import pandas as pd
>>> df1 = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})
>>> df2 = pd.DataFrame({'b': [5, 6], 'c': [7, 8]})
>>> df1.columns
Index(['a', 'b'], dtype='object')
>>> df1.columns.intersection(df2.columns)
Index(['b'], dtype='object')

« first day (4163 days earlier)      last day (1009 days later) »