« first day (3680 days earlier)      last day (1282 days later) » 

5:31 AM
cbg :)
 
user14596741
Guys is it ok , if i make a python package and i didnt write a test or pytest for it.
Im making pacakge by looking alot of tutorials.
Would my package would look professional and good when recruiting me by recuters.
 
5:47 AM
non tech advice, its about how you explain, I know a few of my classmates can explain 25% as 50%
 
user14596741
@python_learner Thank you.
one last question:
If is it ok to convert all functions into classes to make it professional look. If i make a python package consisting all functions not classes, because i feel it easy to do than using classes,
Is it possible
 
6:04 AM
I mean if you want to use classes then use classes, if there is a state needed, I think classes is more of a Java thing
 
 
1 hour later…
7:07 AM
@edward Converting functions to classes just for the sake of appearances? Doesn't sound very pythonic to me.
 
7:22 AM
code.activestate.com/recipes/204297 there is no longer an alternative for this? I get KeyError: '_[1]' on py3.9
 
@python_learner thank goodness, no. And the fact that you want to do that means you're doing it wrong.
 
I stumbled upon it when trying to answer a question, curious thats it
 
It's rarely a good idea to rely on the implementation details of a 17-year-old interpreter ...
 
I read "rarely" as "really" and thought you were being sarcastic for a moment :D
 
8:14 AM
@edward Consider that you are asking whether adding useless boilerplate will make your code look more professional. That should be enough to answer the question yourself.
 
I'm sure it would fool some kinds of people, in which case it would be a perfect match
 
9:11 AM
I once had a mentor at a place I interned, he insisted on making everything classes and adding @classmethod one such case is a script that mails using SMTP
 
user14596741
9:31 AM
Thanks, that means sometimes it is useless
but it would work to fool some kind of recruiter to be professional package look, adding classes and things.
 
user14596741
MisterMiyagi , I got it , useless boiler plate is bad but sometimes it would work.
 
@python_learner they did you a disservice. I do code reviews on tasks by applicants at arne_corp, and seeing someone use classes everywhere is a strong indicator for me that that person doesn't really have a clue about python
this opinion was brought to you by one of my all time favorite python talks, stop writing classes
 
user14596741
Hi , when writing a module or python package ,
Is it ok to put if i have both classes and functions in same file.
 
"ok" by what standard?
 
user14596741
9:46 AM
I didnt get standard means,but thankyou,It is ok put in there.
 
will give that a watch @Arne
 
 
1 hour later…
user14431079
11:05 AM
@roganjosh it give the PIL module but when I read the documentation it was about image filter and image extension and more image editing
 
1:52 PM
I getting error "TypeError: unhashable type: 'list'" with this code `data[data.isin({'Tags':tuple(pd.DataFrame(data.Tags.values.tolist()).stack().value_counts()[:600].index)})]
` Here data is pandas dataframe and Tags is the column with with each row as list
`('python',
'javascript',
'java',
'c#',
'android',
'php',
'html',
'reactjs',
'python-3.x',
'r')`
this is the output of tuple(pd.DataFrame(data.Tags.values.tolist()).stack().value_counts()[:600].index)
i have just given top 10 results
Any help guys
 
2:22 PM
I don't know pandas, but it looks like you're trying to use a dataframe to index into another dataframe, and I doubt that's a valid operation
 
but it get me the tuple results which i have printed
moreover it is tuple not list
but still unhashable list error
 
yes. tuple(pd.DataFrame(...)[:600].index) is a tuple. But data.isin(...) is a dataframe, as far as I know
 
you might want to split that up into several statements to find out which part triggers the exception.
There are about a dozen operations in that one single line.
 
You want them to write readable pandas code? Unthinkable! The universe can't handle that! Reality as we know it would be destroyed!
 
wow
 
2:34 PM
Destroying reality as we know it is the point!
 
@Aran-Fey Laurel
 
@Aran-Fey i am trying to look for these words in tuple in dataframe column 'Tags' to select those rows which matches... and I have tried checking individually no error there
 
@loving_guy yyyyeah
 
errors don't magically come out of thin air
 
2:45 PM
:(
 
3:03 PM
@cs95 Standards are standards and conventions are conventions. Google can ignore the convention to establish their own standards. I wouldn't recommend that for most of us. And "not much" > "not at all" ...
@python_learner I try to avoid sarcasm, particularly with learners, because of its tendency to undermine self-esteem. But I don't mind taking the piss now and then.
@edward You perhaps misunderstood the rather terse question. '"ok" by what standard?' == 'Whose values and tastes are authoritative on this matter".
But you inferred the correct answer anyway, which is that classes and functions are often mixed in the same module/package.
@loving_guy As a last resort, you could try following the advice you've been given ...
[by which sarcastic response holdenweb reveals himself to be a hypocrite and a liar]
 
wow, you guys are throwing around some crazy ideas today
 
it's freaky Thursday! All drinks $1€ off!
 
To maintain cosmic balance I will compensate by being subdued and boring for the next fifteen minutes
How bout that weather?
 
3:26 PM
Video coding interview in 1/2 an hour. Actually put on a shirt and pants today (and shaved!).
@JonClements - I bought that little RaspberryPi keyboard computer, its very cute (using it right now to chat). Keyboard is a little bouncy, but otherwise okay.
 
@PaulMcG ooo... jealous :)
 
@PaulMcG I got a Pi 400 to drive a MEMs nanoprojector. Working well so far.
 
Takes me back to the Timex Sinclair days. Might also draw parallel to C64 (as a whole computer in the keyboard), except that system was not nearly so svelte. I put in a 64GB MicroSD card, so it should be adequate for a while.
 
Very impressed by the dual display capability.
I'm currently just using the 16MB one that came with it. Got python3-qt5 working nicely, but sadly pyqt5 isn't pip-installable.
 
Purely nostalgia but I quite like the look of kickstarter.com/projects/spectrumnext/zx-spectrum-next-issue-2 as well...
 
3:35 PM
@PaulMcG THe shirt and shaving I can relate to... :P
 
If I had a nanoprojector, I'd do sommething like this: youtube.com/watch?v=lX6JcybgDFo
I guess I would need some robots too
 
Gotta google nanoprojectors
 
4:03 PM
@PaulMcG Glad you linked to that one. Impressive!
Man, YouTube is becoming painful to use, though. Google must need money ...
 
4:53 PM
I heard that the popular software Youtube-dl got taken down from Github. Gotta get those ad dollars I guess.
 
Oct 25 at 17:20, by Božo Stojković
Microsoft took down youtube-dl GitHub repo on DMCA takedown notice by RIAA (if anyone uses it and is interested).
 
I'm late to the party I know ;-)
Their website is still up and kicking though, which is nice
 
Just giving out the link :P
 
Links are good. The world needs more citations.
 
They can rename it to NotAYoutubeDownloader and it'll be fine
They're complaining that example usage of youtube-dl includes downloading a bunch of copyrighted videos. Seems there is no true legal ground for DMCA, though software itself might be illegal per-se. But many people supposedly don't use youtube-dl for downloading copyrighted videos/music. Making a backup of one's videos is being mentioned somewhere as one such usage.
 
user14596741
5:30 PM
Microsoft does all these things of terrible things, they are in monetizing any softwares, making closed source,

Although looks they are helping linux, GNU community but they are doing not on GPL journey but Money.
 
user14596741
5:41 PM
guys it is pretty strange when we add some dataframe in function it is updated system wide
when i apply to dataframe df, then original df is also getting 't' column
def g(data):
data['t'] = data['a']*5
return data
 
I don't use pandas, but this is from pandas docs:
> All pandas data structures are value-mutable (the values they contain can be altered)
You should copy a dataframe if you don't want to change the original.
But don't listen to me, I might be pointing you in the wrong direction if there are caveats.
 
user14596741
Thank you. I've got knowledge about pandas immutability.
 
user14596741
5:57 PM
Im making package which i am working on pandas Dataframe, taking it and do multiple things with it, but this is becomming barrier
 
@edward you clearly do not
@edward read and understand nedbatchelder.com/text/names.html before touching another line of python
@BožoStojković no, you're right
 
user14596741
OH, thanks its is great article.
 
@AndrasDeak Most salient quote: "Fact: Assignment never copies data"
 
@AndrasDeak That's awesome. Thanks :)
 
Names are held in namespaces, and reference objects on the heap (which I sometimes call "object space" in contradistinction).
 
Cryptic!
 
user14596741
These companies specially apple, microsoft like they are creating own programming or conservative language, like c# , asp, also apple on closed source programming turicreate, so does google.
 
Ok...
 
user14596741
6:20 PM
Hey guys, I am removing all my showcase to recruiter hard classes instead using pure function, because of simplicity.
I am hoping, interviewers and recuiters wouldnt judge me, not seeing classes instead all functions in my python package. again bit worried, if they judge me
 
Look, the entire point of the recruitment process is to be judged.
 
user14596741
im interested in machine learning
 
I'm not.
 
user14596741
Have you ever worked as recuiter or hiring manager,
 
user14596741
or what you think of me if i write this way
 
6:28 PM
@edward please stop with the frequent weird questions. They are becoming too much.
Don't write code for a recruiter. Write good code instead.
there, all your questions answered
 
user14596741
Thank you , means functions instead of classes if it is good , is also file.
 
Means write good code. You were already pointed to great resources about writing classes.
 
user14596741
ok
 
user14596741
I've found no use cases for classes, so i used functions in all :) .
 
7:06 PM
I've got half way through that "stop writing classes" talk again with a fresh pair of eyes and it leaves me pretty baffled
The main hurdle my brain can't get over is why he was even using a 3rd party library of 600 lines in the first place if he can reduce it to less than 20 lines. We all know what relying on miniature libraries for simple tasks can lead to (at least in JavaScript) - crashing half the internet overnight
 
There's some wisdom about re-inventing the wheel, which often leads to buying an ox-cart, an ox, and an ox-cart-driver, when all you wanted was a wheel.
 
So when should you use classes? I don't know how to feel about that talk
 
@BožoStojković when you need state
 
@BožoStojković when you need heapq D:
 
Typical example from roughly my domain: integrators (of differential equations and physical simulations) that have a .step() method. All the state is contained in the class instance. Doing the same with functions would lead to a lot of global names storing the same state.
 
user6568562
7:19 PM
Cbg everyone
 
user6568562
Hey @AndrasDeak, how are things ?
 
@MisterMiyagi Haha :)
 
@randomhopeful Cbg, fine, thanks. How are you?
 
user6568562
Also fine, thank you
 
user6568562
@roganjosh I believe I saw the same video you're talking about. People seem to have taken the video's title too litterally
 
7:21 PM
Glad to hear that :)
 
@randomhopeful I was about to say almost that; I think I find the title a tad too inflammatory to not start picking apart the example
 
user6568562
Also the fact that he had to obfuscate the real names makes it more of a fun talk than a guideline
 
user6568562
@roganjosh Oh yeah, and for his defense, if he needs any, he just wanted a funny title. I don't believe he really had issues with the whole concept
 
I'm not too fussed about the name of the library as such, but 600 lines --> 20 lines is either a lie or ineptitude that's beyond the general day-to-day examples of OOP gone wild
In other words, I can't really get behind the message when it's delivered with an extreme example
 
user6568562
He also did explain what it was supposed to do, if I recall correctly. It didn't even need Python to begin with. I remember thinking : "There's a query for that."
 
user6568562
7:27 PM
@AndrasDeak I keep remembering the article we read together. It's funny how we got way past that.
 
At work we have teams within the Data Science department and we get allocated a certain number of hours to work on tooling. I may have convinced my team to build our tool's API around a Java library that works in a similar domain.... Oh god, I'm the problem <runs away crying>
 
user6568562
Haha, that's another dimension of what we're facing
 
user6568562
I find myself trying to hire a couple of " "programmers" " I can afford, from time to time, and I almost always end up micromanaging just a step behind writing code myself
 
I mean, the C# guy agreed with me.... and that's a totally different language :P
 
user6568562
Still, it always boild down to : state and computation, so the variety of languages should not be a problem.
 
7:38 PM
To be fair to myself, I do have 5 years of experience behind me to know that the only way to make this tool work is to be able to maintain state ad infinitum for a single problem. Still, I did quite a lot of soul-searching before suggesting it :)
 
user6568562
I hear that, some got stuck at the gates of self-awareness to do any soul-searching
 
user6568562
@holdenweb Happy that you're up to it ( : Keep well
 
9:06 PM
I am getting this error error: multiple repeat at position 86 on using python contains method for searching` substring in pandas dataframe column` using data[data.tags.str.contains('|'.join(mylist))] where data here is dataframe and tags is column and mylist is list of strings to search in column and return the rows of dataframe
 
MCVE please
 
one of the values in mylist isn't a valid regex pattern
 
mylist is list of string
 
and one of those strings isn't a valid regex pattern
 
@loving_guy That's not an MCVE
 
9:12 PM
it looks like this 'python|javascript|java|c#|android|php|html|reactjs|python-3.x|r|node.js|angular|sql|c++|css|pandas|mysql|jquery|ios|swift|arrays|django|typescript|excel|json|laravel|flutter|sql-server|react-native|c|spring-boot|vba|vue.js|docker|dataframe|amazon-web-services|firebase|wordpress|regex|spring|postgresql|mongodb|linux|azure|.net|tensorflow|kotlin|asp.net-core|database|asp.net|api|list|windows|numpy|dart|selenium|string|oracle|bash|git|express|android-studio'
after '|'.join(mylist)
 
use '|'.join(map(re.escape, mylist))
 
And what does data['tags'] look like?
Because there may be absolutely no need at all to be using regex here and, instead, using set membership
 
@Aran-Fey it works can you explain me?
what might be wrong earlier
 
I'm... not sure which part of this needs explanation. The contains method expects a regex pattern as input, so you have to make sure your pattern is actually valid. Do you know regex?
 
yes
 
9:16 PM
Then you should know that "c++" isn't valid regex
 
but i m not sure mylist need escape char
@Aran-Fey ohh
thanks @Aran-Fey
 

« first day (3680 days earlier)      last day (1282 days later) »