« first day (3612 days earlier)      last day (1330 days later) » 

raf
3:26 AM
hi, I was told to ask my issue on code review and I hade done it. But I got two downvotes. Can anyone please check and tell me if there is anything wrong in my question and how can I improve it? Thank you in advance. :)
2
Q: Converting location names into country names in pandas dataframe

rafI have a dataframe df such that: df['user_location'].value_counts() >>> India 3741 United States 2455 New Delhi, India 1721 Mumbai, India 1401 Washington, DC 1354 ... Spa...

 
 
3 hours later…
6:29 AM
There is a 4 GB excel file and the RAM size is 1 GB. Is there any way to get chunk wise data into RAM to read the data?
Means is there a way to read directly from hard disk using Python and get a small amount of data from the excel file into the RAM?
 
 
4 hours later…
10:37 AM
@LordOfThunder It seems unlikely. If you only want the values, could you persuade Excel to write a CSV file, which could be processed serially?
@Janith It might help to remember that a function execution begins life by binding the parameter names to the argument values in the function-local namespace - those are the only names defined in that namespace as execution starts. Then again, it might not.
 
 
1 hour later…
12:07 PM
@LordOfThunder without more info, it seems like dask might be suitable
Its premise is to handle dataframes larger than RAM. At the same time, I've only had passing acquaintance with it and I've not liked it. Also, I hear similar feedback from others. Still, maybe worth a look
 
 
2 hours later…
2:07 PM
anyone knows Robot Framework?
 
I don't but what's the issue?
 
2:22 PM
how do I declare a variable inside an IF condition
 
That doesn't sound like it's bound to the particular framework. What is the relevant code?
 
Run Keyword If (CONDITION) Run Keywords (Keyword)
... AND Set Variable ${i} = 1
... AND FOR ${item} IN ${items}
${i} Set Variable ${i} + 1
want to do something like that, increment the variable in a loop inside an If
 
That isn't python
 
I know it's Robot Framework
just that their chat is inactive
 
So why are you asking in the python room?
 
2:30 PM
Robot Framework is implemented with Python
 
That's not a reasonable reason to be asking here. I assumed there was some python binding
 
ok sorry then
 
Ugh, I give up. My phone is taking a good 30 secs to post messages sorry; if you are trying to use a python wrapper to some library then it's fine to ask that. But the code you've presented isn't python
 
Here is my directory structure and I cannot package all the folders under cvplay-->cvplay but the individual scripts that are not in those folders get packaged, this is strange. Need help resolving this
 
Blueprints
 
2:38 PM
@AshwinPhadke by packaging you mean create a python package? Are you using setup.py or pyproject.toml? How do you specify the package content?
 
@MisterMiyagi yes python package, I am using setup.py wherein I am doing ` packages=find_packages(),` and using MANIFEST to recursive-include cvplay/static *.png like this to include filesin those subfolders
 
It's hard to see with that screenshot. Is setup.py inside cvplay or inside cvplay/cvplay?
Where do you execute this from? What's the current working directory when running setup.py?
Also, how do you check what gets packaged?
 
setup and manifest are inside the first cvplay
@MisterMiyagi I execute this from where setup py is
@MisterMiyagi I try importing the package and it says that the codes folder is nomodulefound, the setuptools desn't log to terminal what gets packaged if it is successful
 
"it says that the codes folder is nomodulefound" do you mean you cannot import codes or you cannot import cvplay.codes?
 
user12867493
Hi everyone, I've been given a problem and am stuck on it. Given a binary return the number of ways s can be split such that the number of characters '1' is the same in s1, s2, and s3. "1001" = 0 "0000" = 3 "100100010100110" = 12
 
2:49 PM
@MisterMiyagi cannot import codes
 
You should be able to use twine to inspect the built package, or setup.py build sdist.
@AshwinPhadke What makes you think that works? codes is a subpackage of cvplay.
 
@MisterMiyagi I am currently running sudo pip install .
 
user12867493
I've got that if there are 1 or 2 '1''s, it's 0 but not sure what next.
 
@MisterMiyagi I thought if I package cvplay it will also include subfolder right?
 
@AshwinPhadke yes, but with the fully qualified name, i.e. cvplay.codes not codes
 
2:50 PM
@MisterMiyagi Ah so I change the import statements only?
 
yes. You're likely using the "package" as a collection of packages, not as a package of subpackages.
Are you aware of relative imports?
@Daniil what are s1, s2, and s3?
 
@MisterMiyagi do you mean, packagename.subpackage?
 
user12867493
@MisterMiyagi The split parts of s. i.e. each of the split strings needs to have the same number of 1's.
 
@AshwinPhadke I mean from . import codes
@Daniil So do you always have to split into three?
 
user12867493
@MisterMiyagi Yes.
 
user12867493
2:54 PM
Always three.
 
And they must be non-empty?
 
@MisterMiyagi oh yeah I have added that in the init.py script as a single line which includes entrypoint python script only. Do I add all the scripts in init?
 
@MisterMiyagi i guess yes
 
user12867493
@MisterMiyagi Yes.
 
And they must be consecutive, i.e. not [::3], [1::3] and [2::3]?
@AshwinPhadke Nah, just checking. You might want to prefer relative imports for internal use. External modules should still use absolute imports.
 
user12867493
2:57 PM
@MisterMiyagi Yes.
 
Yaaay @MisterMiyagi it works thanks for the help, I just packaged my first python project
 
You can do re-importing, e.g. cvplay/__init__.py doing from .codes import * but I recommend against it for a first project.
 
@AshwinPhadke congratulations :)
 
It's one of those house-keeping tricks for advanced layouts.
 
@MisterMiyagi Are relative imports more preferrable? I mean you wouldn't understand the full length of the path of the package right?
@MisterMiyagi there are a lot of modules in codes so * would just be abstraction I guess, but I will keep that in mind.
Thanks for your help.
 
2:59 PM
I prefer relative imports inside a package, yes. Makes refactoring easier, and more clearly communicates that you are not extending some package but the current one.
 
Now I need to figure out how to build packages out of it
@MisterMiyagi Yeah that's one thing to note too, as a beginner I am still at the stage where I want to know the entire path of the package
 
@Daniil first check if number of ones is divisible by 3, then find the one thirds and two thirds of the ones
 
@MisterMiyagi So now I run this to build wheels right?
 
@Daniil Have you tried a brute-force approach, then? It seems like you need to split on some 0 < i < j < len(binary). A nested for loop should work.
 
Brute force could work too. I bet it would be a timeout in the code challenge.
 
3:01 PM
@AshwinPhadke No worries. Packaging is a feat, with lots of room for preference. Gratz on getting your first package working. ;)
 
user12867493
@AndrasDeak What do you mean by "then find the one thirds and two thirds of the ones"?
 
@Daniil if you have 12 ones then 4 falls in the first third, 4 in the middle and 4 in the last one
Multiplicity comes from putting zeros back and forth between thirds
 
@AndrasDeak I fear not the man who has solved 10,000 challenges once by room/6, but I fear the man who has solved one challenge 10,000 ways by themselves.
 
With 12 ones you know that anything before the 4th one is in the first substring
@MisterMiyagi urgant plz halp :P
 
@AndrasDeak Don't mind me, I'm just spewing canned wisdom until my Wine wrapper is done. :P
 
3:07 PM
ah, a connoisseur
 
Always up for a good bottle from the winery. Plus, my reading material turned from a guilty pleasure into "Π 􏰁 e : [∆]τ iff [∆pr]τpr 􏰄∀ [∆]τ". Might as well blow up some 'Mechs.
 
too many grey boxes...
 
There's at least one character missing, but I do not even know what it is called, much less what it means. :/
 
Is that some formal logic?
 
Yeah.
 
3:09 PM
rip
 
@MisterMiyagi Thanks
If I want to add requirements, can I add specific versions of it or I just put package names in install_requires[]?
 
you can, but probably only should for a good reason (known incompatibility or bugs)
 
Okay
So running setup.py build sdist creates only zip files and other files but not .whl files?
python3 setup.py sdist bdist_wheel this is the command
 
3:58 PM
Sorry to ask, but can anyone repro a certificate error for www.jpilkington.com? It's not throwing a cert error for me. Specifically, the case was with firefox. My next stop is seeing if they now distrust letsencrypt
 
Loads fine for me, with firefox
 
Thanks. It looks like the issue might be by dropping www but I've been told about if while I can only test on a phone
 
Hi, guys is there a way to shuflle bunch of code in python like if i have print('hello') in one line and print('hey') in the next line, how can i change their orders everytime i run the code
print('hello')
print('hey')
then later it should be something like
print('hey')
print('hello')
This is for something like a 9 lines of code, so i want to shuffle them each time i run the code. Any ideas?
 
You mean each time you fire up a new interpreter? Or just call a function inside the same interpreter?
 
4:13 PM
@AndrasDeak each time i fire up the interpreter
 
@AshwinPhadke You can, but as Andras said only do so when you have to. Note that ~= can be used to mean "at least this version and compatible". So ~= 1.0 means >= 1.0, < 2 for example.
 
@Aran-Fey thanks. It looks like I need to re-visit nginx
 
@CoolCloud So you want to randomly shuffle then? winks suspiciously
 
@MisterMiyagi no mention of random though...
 
yes random is fine too
im dying over my answer on this Q stackoverflow.com/questions/63755220/…
 
4:22 PM
@AndrasDeak Seen too many people misunderstand ordering of executing processes. Just cutting a few corners.
 
it would've been way more fun with an alternating requirement
 
user13415013
4:46 PM
Guys , i am getting error
ValueError: Unable to determine SOCKS version from socks://localhost:9050/
when using tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
 
user13415013
I tried to search using stackoverflow.com/questions/39906836/… which didnt solved the problem
 
user13415013
I am using tor proxy because of blocked internet , Help!!
 
Looks like i'm the only one online at this time and i' don't really know about socks.

So you might wanna wait for more opinions.
 
user13415013
yes,
 
is that a python library (i'm almost sure it is), because i might pick it up from the documentation though?
 
user13415013
4:53 PM
it is from bert
 
i'ma make an attempt though
 
user13415013
oh it is solved now,
 
user13415013
I have to reset jupyter notebook and used command line to use that command.
 
@nerd I feel good about that but bad that i won't know about socks.()although there is no reason why i shouldn't, but i doubt myself xD.
 
user13415013
thank you
 
4:56 PM
Anyways good to know you got that working.
 
user13415013
:)
 
user13415013
which os are you using
 
@nerd I'ma take that even though i didn't do anything.
@nerd windows for now. will have dual booted linux in some days.
 
user13415013
:), trying to help is way bigger than other
 
user13415013
No dont use windows, stop it now .
 
4:58 PM
@nerd I have to agree :)
@nerd I have to. it's just a notebook with 28GB of disk space.(may sound unreal but it's true)
 
user13415013
using linux feels more better, opensource, more privacy
 
I know. I have used linux a lot before. I actually prefer dual boot so i can load what ever i want :)
 
user13415013
That socks is using tor proxy directly to os, so that all connections would go through Tor and people may not track us.
 
user13415013
ok , nice to meet you @PSSolanki, see you someday, i have alot of work to do . Bye take care :)
 
@nerd I see. I have been using TOR for a long time now, never used socksactually (or shall i say never had to ;))
@nerd Good Luck. Bye
 
5:16 PM
@MisterMiyagi Thanks,released the package in testpypi .
 
@Ashwin This one right

https://test.pypi.org/project/cvplayground-ashwin-phadke/

?
 
@PSSolanki Yep, geez that was fast
 
@AshwinPhadke Hehe. both testpypi and pypi have the latest packages published on their homepage. You were indexed at 4, i guess
that's 3 actually, not 4
 
@PSSolanki testpypi was supposed to be for test only xD, anyway yeah I just saw that, I need to make changes to the old readme and stuff now that it is installable
 
@AshwinPhadke Yeah. would be one of your beta users ;)
 
5:26 PM
@PSSolanki that's great to hear, keep checking the space, i am planning to release beta very soon.
The documentation is confusing https://packaging.python.org/tutorials/packaging-projects/ it says to add username to the package name but all it does is add it to the published package too which should not happen.
 
 
2 hours later…
7:22 PM
@AshwinPhadke The point is to avoid having all the proper package names taken by test packages. So test packages should include the author name to avoid name clashes.
On pypi, lots of good package names are already taken by junk/test/demo packages.
 
7:57 PM
what?
 
 
1 hour later…
9:04 PM
Hello, I'm looping through a list of hardcoded commands which runs subprocress.run(). However, this is causing a race condition where one command is running while the prior command has not completed, causing the next command to fail. How can I wait until the prior command is completed before continuing to the next? Thank you for your help. =o)
def execute(commands):
    for command in commands:
        run(command, shell=True)

execute([
    'someprocess1',
    'someprocess2',
    'someprocess3',
])
 
9:25 PM
It's easier to test it with the type of commands you're using because I don't know any commands to use that can take long. I've done it with sleep terminal command which waits for a certain time and it did wait without executing other commands till the wait was finished
---
import subprocess as sb

def execute(commands):
for command in commands:
sb.run(command, shell=True)

execute([
'echo 1',
'sleep 2',
'echo 2',
])
---
So what commands were you using exactly to make it easier?
 
Running some npm and pipenv commands, which includes also running some commands in the "scripts" sections for their respective config files. Like for example I am trying to copy some vendor files after npm installs my packages, but if npm takes too long it will error because the files of course don't exist yet.
I can't use sleep since I really don't know how long it will take. It could take 5 minute, it could take 5 seconds. Trying to see if I can know the status of the previous command before it moves to the next.
 
10:30 PM
hi everyone
 

« first day (3612 days earlier)      last day (1330 days later) »