« first day (3968 days earlier)      last day (997 days later) » 

1:00 AM
Cabbage
 
 
2 hours later…
2:41 AM
cbg
 
 
1 hour later…
4:07 AM
Hello / Cbg
can anyone look into my question on main, been almost 2 days stackoverflow.com/questions/68915975/…
 
Cbg
 
4:31 AM
Cbg
 
4:52 AM
rbrb getting off for a few mins
 
5:09 AM
Cbg!
 
5:22 AM
cbg
 
Ya'll remember if there is some command to perform both a reshape and a reorder (on the last dimension, like some_array.reshape(new_shape)[...,last_dim_order] ?
 
Why are some of the outdated hashing algorithms still in hashlib? Only for backwardscompability?
 
6:19 AM
cbg folks, after a while... How's everyone doing?
 
6:35 AM
cbg
 
cbg
 
question now that I am working full-time in python is it worth while learning a statically typed language like Java to have it in my 'arsenal' or languages?
 
@inspectorG4dget cbg, Nothing much..Just woke up and going to start coding in Python.
 
@Kwsswart a good professional is always learning. Very worthwhile having a passable knowledge of other languages
@MalikHamza sounds like me every day ;] Working on anything fun today?
 
@Kwsswart I second what @inspectorG4dget said. Plus learning other languages can teach you a lot about programming in general and may help you see python in another light.
 
6:45 AM
Learning other languages to extend your knowledge of computer programming is a very good idea!
 
cheers I am wanting to get into a statically typed lanuage to get an idea of all the things python does for us automatically i.e memory management
 
@inspectorG4dget oh hey, how you doing doc?
 
IME, Java helped me with a lot of OOP concepts
 
@Kwsswart ummm don't confuse static typing with memory management
 
then there's also the argument that some libraries may only exist in certain languages. So if you need to use one, you could create a binary in that language just to use that library. You could then use python to call that binary... and just like that you've expanded your capabilities
@Kwsswart I second @JonClements's point. Java is garbage collected. C is not. Both are statically typed
@JonClements hey Puppy! It's been a while. Greetings from my parents' place in Chennai, India :)
 
6:47 AM
@JonClements I assumed Java had to handle it as does c and c++, no? i know statically typed is refering the the declarations of variables before actually assigning them etc....
 
false assumption
 
did not realize java was garbage collected
 
@inspectorG4dget lovely - everyone safe and well?
 
statically typed = my_var is of type int and will always be an int.
statically typed ≠I need to clean up the memory allocated for my_var when I'm done with it
@JonClements cabin fever's getting to people. But aside from that, people are doing well. How's you and yours?
 
missing going out for a steak and pint on Friday nights (the 2 years ago way...) :p But otherwise fine, business is booming so... can't complain
 
6:51 AM
Thanks for clearing up the misconception
 
@Kwsswart also C++ has very different ways of handling memory management than C does.
 
@JonClements good stuff! Very happy to hear. Keep raising the steaks until Johnson stops his stupidity and you can explore the "out side" again :P
 
Would you guys suggest starting with Java and then moving to either C or C++?
also considering any opportunities they may bring me careerwise in the future?
 
well, knowing many skills will only make you apply for more jobs ;), so more opportunities
 
@Kwsswart Do you have any prior experience with any of these ?
 
6:56 AM
@Kwsswart what kind of things would you like to go into? Different industries have different requirements? For instance - if you wanted to go into web development, you wouldn't want to focus on C++... you might want Python/Ruby etc... if you wanted to go into embedded stuff, you might want to look at C/C++/ASM or if you wanted to focus purely on a Windows based system then either VB/C# etc.. etc..
 
@AlexandreMarcq when I started learning to program the course i did was the CS50 introduction to computer science which starts you off in C and makes you do fairly basic things within them to learn about basics, before moving to python
@JonClements To be honest mate I am not certain just yet what main field would like to go into at the moment I am in data extraction, cleaning and process automation and enjoying it, however I also like the idea of web or application development
 
@Kwsswart sounds like the wrong way around of learning to me... I've always though the teach the higher level of "you can get this done", then the "this is how it's actually done"
 
@Kwsswart All I have to add to Jon's detailed answer is that you can also try Rust for a friendly low-level language
 
@JonClements Thing is after the course focused alot on Python and feel I am fairly fluent with it and working in it every day, thus thought might be a good time to challenge myself and learn something that will help me in other aspects
 
@JonClements So you'd recommend techning high-level then low-level ?
 
7:02 AM
@AlexandreMarcq yes
 
teaching*
 
yeah... I got that :)
 
"Funny" enough over here the first thing we're taught is C
 
Not sure how they handle it in university here... Not been xD just sort of been trying to teach myself since the quarantine
 
@AlexandreMarcq and what did you learn from it now you're using Python that'd be useful?
@Kwsswart honestly, depending how long you've been using a language - don't keep trying and switching - focus on one for a bit - get to know it's ins and outs... and look to another if you know it can complete a task better in a way that what you know can't... (probably not making sense there but hopefully you know what I mean)
 
7:09 AM
@JonClements It was in my first year, so I got traumatized by pointers. When I though I was over with C, I had a OS course in Erasmus that traumatized me with linked lists, threads, processes, mutexes and semaphores. But I survived so I guess it helped understand how things are done and gave me some basic knowledge about low-level problems.
 
@AlexandreMarcq yup... but wouldn't it be better if a teaching approach was using high-level stuff of "hey folks, you can do and achieve this" first so you can actually get something happening and later on have a "so what you folks did looked easy, but under the hood - here's what's going on"?
 
I totally agree
Now that I'm used to python and programming in general, I'm more okay with those low-level concepts and ready to tackle them.
I think teaching C to young students as a first language is just a way of getting them to give up
 
agreed... but on the plus side, the less good programmers we have, the less chance there is of skynet :p
 
7:25 AM
Until they make a low-code tool for this too :P
 
you've just reminded me one of my nephews phoned me the other week about binary trees
 
That's actually pretty cool
 
asked him to send me the code - typical templated stuff and vague comments about traversal... so walked him through that and we got there, but he asked a pertinent question: "what would I use this for?"
 
asking MCVE even to your nephew :p
 
I imagine the answer : "Sorry but this a duplicated question. I'll close it now." hangs up
 
7:31 AM
lol
just got a gut feeling we've got people that can write algorithms they don't need to write as it's already been implemented in the most optimal way a language can provide - but they don't why you'd choose to use it
 
 
3 hours later…
10:12 AM
hi, i am trying to create and run a python script using docker. could i post this question here (im not sure if my issue is with docker or python)?
 
I think it's probably fair to ask here if you're trying to get Python running in Docker. If your Dockerfile is long though, please post on some off-site service e.g. dpaste or gist and link to it here
 
here is the dockerfile: dpaste.org/mMFy
but im getting an error no such file or directory test.py
 
10:27 AM
wild guess without knowing docker CMD [ "python3", "/app/test.py" ] works?
 
@ThelurkerLurker Are you using a multi-stage build ?
 
I have to get off pc now rbrb
 
rbrb
 
Bye
 
im not sure what multi-stage build is...
will try /app/test.py
 
10:33 AM
@ThelurkerLurker Then you shouldn't try to use two FROM commands
 
i wasnt sure how else to get both python and selenium together
 
each time you use RUN ..., another layer is created. This takes up space in your HDD. A multistage build is a way to tag each RUN directive so that it can be referenced later in a FROM. This reduces the footprint on your localhost and doesnlt make the image as large
 
but that is not why its not working is it?
 
@ThelurkerLurker Did this modification work ?
 
10:45 AM
ive read through the article but am not 100% i understand - it just says you can use 2 x FROM which i had. although i have moved the FROM selenium part to the top so that the ADD and CMD are after the final from... testing now
thanks that did seem to work.. now just need to try get selenium running correctly
 
Have you paid attention to the COPY --from=0 part ?
 
ye but i wasnt really sure what to put there: trying to add in : COPY --from=0 . /app
my current file looks like dpaste.org/LXhb
although this seems to take some time this line
 
The thing would be to keep the first layout you sent here and just copy the files from the python image to the slenium image. Then have the CMD in the selenium image
Something among those lines, try to get more familiar with multistage or try to figure out if you really need both images
 
yes i like that idea - although ill have to ready about how to add python to the selenium image
 
Are you sure that this selenium image doesn't already have python ?
 
11:03 AM
no im not... let me try
 
Hi, does anyone here know PCA?
 
you got some responses yesterday for this
I am not suggesting to stop asking what you wanted to ask, if you have worked on the suggestions given to you here, or have some new bug or change then do feel free to ask
 
11:25 AM
@python_user Only one user actually engaged, and he ended by saying "I'm going to back off here, I don't know what I'm doing"
 
its pretty much the same bunch here everyday, but you can try
 
OK, Thanks
 
well Paritosh didnt actually tell those exact words for the record
 
"I shall probably back out of this conversation, i have no idea what's going on."
 
I know, I just wanted to make it clear in case it mattered, good luck
 
11:30 AM
Here's my problem: I don't understand why my PCA input and output is 36 by 36, if the whole point of the PCA is dimensionality reduction.
 
everything seems to work and i can launch selenium container seemingly but now im not sure how to get my script to execute... i have tried: docker-compose run chrome && docker run -it selenium-chrome python3 test.py but this just seems to launch selenium only
 
@rb3652 That doesn't mean they don't know what they are doing. That means they don't have sufficient information about your problem.
 
@MisterMiyagi I provided all my code, explained my problem, gave the error message, and explained my failed attempts. Anything I missed? I was never told that I didn't give sufficient information, otherwise I would have gladly done so.
 
Looking through the transcript I only found this code snippet. It doesn't have the imports to know what library you are using, nor any sample data to try ourselves.
 
11:45 AM
chat.stackoverflow.com/transcript/message/52906147#52906147: "Here's the notebook I'm coding on: colab.research.google.com/drive/…"
I provided my entire code, imports and all.
 
Hello all, I asked this earlier but I got no response, so one more time, can anyone look into stackoverflow.com/questions/68915975/…
 
Well, Paritosh exited stage left before that link, so...
 
any suggestions regarding the question is also welcome
 
Either way, "my entire code" is indeed a fitting description of the Colab notebook. It's huge, to say the least. You can of course try your luck in finding some willing to go through it, but my guess it's well beyond the volume that people are willing to put up with.
 
@MisterMiyagi Great, so the criticism used to be I didn't give enough code -- now it's too much. I already gave the small 6-line portion of my code that was causing the problem.
 
11:53 AM
I could try to place a bounty but I would lose essentially half my rep :D
 
@Alice I don't get your question. The issue underlying is a circular import; it's just failing in a way that the symptom leads to an error before the root cause does.
 
@rb3652 There's a difference between "Here is the more detailed information you asked for" and "This is all my code, read and tell me what's the problem"
 
Look, I'm not here to get into an argument. If you want to nitpick what I said, go ahead.
 
I shall probably back out of this conversation, i have no idea what's going on.
 
thank for responding MisterMiyagi, as I have pointed out in a comment, I was expecting an obvious error message, what you said clears things out for me
 
11:56 AM
@Alice Don't bounty the question! It's a textbook "needs focus" off-topic candidate – if you bounty it, you'll just get downvotes.
 
ohh, alright, I did provide working code, thought I would get better responses, but only one user bothered to comment even then
should I delete it?
one last question, can you please explain "Why does it work if I run from python module_a.py and not python module_b.py" if it fails in one how does it work in the other, circular imports are supposed to happen at either end right?
 
FWIW, I think you could edit it into shape with some effort – the issue that import * just silently leaves you with nothing is indeed a tricky case. You would have to drop the many, many subquestions though and focus on the core issue: "How come that a circular from module_a import * just silently imports nothing?"
@Alice Your module_a doesn't actually use anything from module_b, so there is no error if the import pulls in nothing.
In other words, module_b requires the import of module_a.fun_a1 to work but module_a does not require the import to "work".
 
ok I kind of understand this, I will read it again to fully comprehend
is there an existing question that explains "How come that a circular from module_a import * just silently imports nothing?"
 
There's a question about the same issue, but it's not really about explaining it. The answer's aren't great either, TBH.
 
thanks again MisterMiyagi, I will read this to understand more
I have edited the question to what I understood from this discussion, is that ok now?
so much emojis on the star board :D
 
12:35 PM
MM's clever reply got unnoticed I believe :D
 
1:23 PM
I think Python's approach to quietly handling circular imports is silly, so rather than try to follow its twisted unlogic I just try real hard to never let it happen in the first place
Apply moderation when examining the mysterious lever
 
2:04 PM
I proceeded to ignore my own advice and pull the lever for thirty minutes
 
That makes you a dedicated scientist
 
I would have stopped after five if my first test code had produced output that matched my expectations, but it surprised me
 
Was it because of the lever or the test code ?
 
My rule of thumb was "circular imports can make statements execute in seemingly nonlinear order, but you can at least be sure that every statement will execute exactly once". But my test program had duplicate output.
#x.py
print("x begin")
import y
print("x end")

#y.py
print("y begin")
import x
print("y end")

#result of executing x.py
x begin
y begin
x begin
x end
y end
x end
 
imports like a stack?
 
2:12 PM
I don't feel comfortable making any statements of fact about it. All I can say is what my eyes have seen
 
Is it the two middle lines that are the "problem" ?
 
cbg. i wonder what happens if x is invoked via a different py file
 
After this I wrote prototype 2, which produced output that matched my expectations. The code is the same as prototype 1, except there is a third file, main.py, which contains only import x. Running main.py gives the output "x begin", "y begin", "y end", "x end", exactly as I thought prototype 1 would do
 
makes cute puppy eyes at kevin, also, kevin'd
 
@ParitoshSingh You're a step ahead of me :-) I suspect that only the file that is directly executed is in danger of being run more than once
 
2:14 PM
indeed, that's my hunch right now :)
 
Is it because main.py "oversees" what's happening compared to x.py?
 
Perhaps the module caching system doesn't consider the main module a module until something tries to import it
 
Hm nevermind I'll stay in the shadows
 
no, i think it's as simple as python only seeing imports to cache when main invokes it upfront, whereas when you invoke x directly x isnt a module to cache yet.
or to phrase it in an even simpler manner, python only sees import x and realises x is a module at that point. when you run main, this is seen upfront, when you run via x, this isn't seen till y is imported which contains this line.
 
I don't 100% follow your explanation but it has a pleasing truth-like shape
 
2:19 PM
im not sure whether that is a good thing or a bad thing, considering i think what i said makes sense in my head... which is a dangerous place to put my trust in.
 
Well at least one person here knows what's happening
 
Maybe I'll try to summarize my findings in a bit
 
2:37 PM
I forget, does the stdlib have a convenience function that prints the stack trace of the currently running code? It's easy enough to show one during an exception, but I want to see it for my non-exceptional code too.
 
Currently looking at traceback.print_stack, which shows some interesting info, but more fluff than I need
The hard part is that what I think I need is changing every time I think about it
trace has some promising options, will definitely take a look. thanks
My first attempt at using it created a 31kb report file for my five line program... Perhaps the default verbosity is a tad high
 
yeah should have mentioned htat, I just blindly ran that on a python file and just had to stop it midway, so much info
 
2:53 PM
laurel, what are you folks up to
oh, still related to that import behaviour?
 
Debugging, tracing, hooting at the black box and banging a femur in the dirt, the usual
Yeah it's still the import thing. I'd like a nice concise and objective visualization of which modules have been imported and which lines have executed etc
Devil's in the details as always
 
3:22 PM
@Kevin Would be a nice slogan for LaTeX
 
3:35 PM
Just use a debugger, stepping into every line and inspecting stuff like sys.modules along the way?
 
That, too, is useful. Admittedly I use the debugger less often than I should
The crystal ball gets jealous when I use other tools for scrying
 
i've got myself into a proper rabbit hole trying to demonstrate this behaviour.. and so my question is this: is it possible to run some python code before running python x.py that injects stuff in the builtins? (...i feel rather silly typing this out)
 
Maybe. I will retreat to my prototype cave
 
Is the cave a prototype? Or is it where you make prototypes? I need some disambiguation.
 
okay. i think i've got "something".. but i'll admit, this also slightly surprises me
 
3:46 PM
Yes to both. Creating my prototypes inside a structure that is itself a prototype, imbues my prototype with additional power. As above, so below
 
@Kevin __main__ is always distinct from it's "named" module, since it may (and usually does) have different content.
 
Hmm. i can think of plenty of scenarios where __main__ has more content than its named module. Are there times when it has less?
 
@Kevin wait...this doesn't error out because of the circular import?
 
@Kevin Depends on whatever the if __name__ == "__main__" guard does
 
A narrower question: has anybody ever seen an if __name__ == "__main__": guard that has an else: block?
 
3:51 PM
here's what i think could be a decent demo. link
 
@Kevin 🤚
 
@Code-Apprentice As far as I know, a circular import is never the direct cause of an exception in Python. You might get a NameError down the line, but that's one degree of separation away.
My example code won't crash with a NameError because I don't reference any variables.
 
@ParitoshSingh you can probably hack something with site
 
@Kevin There's apparently a special AttributeError for modules-currently-being-imported that takes a guess at the cause being cyclic imports.
 
Hm! I would like to see that
(not incredulous)
 
4:01 PM
# a.py – run as python a.py
import b
b.foo
# b.py
import a
AttributeError: partially initialized module 'b' has no attribute 'foo' (most likely due to a circular import)
 
@AndrasDeak that's pretty amazing. i wonder if theres something you can't do in python :P
 
Cool. I wonder what criteria it uses for guessing. "AttributeError on a module object" is a safe bet. Maybe there's a not_done_being_imported flag too.
Possibly of general interest: github.com/python/cpython/blob/… shows the desired outcome of various import-related scenarios, although you'll have to dig through test_import/data/circular_imports/ to see the actual details
But just knowing that some tests expect to see the output "cannot import name 'b' from partially initialized module ", tells you that there's some circular import detection going on
 
what is strange to me, is the fact that imports seem to deliberately "set" the package even after fetching it from the cache
what's even more strange is that this setting doesn't happen all the time.
so it really makes me wonder what black magic is actually going on
 
setting as in, binding the module object to a name? Or something else
 
as in putting it into the cache again
oh, may i interest you in deviating from your prototype cave for a sec and running the demo i shared
 
4:11 PM
ok
 
looking at import docs, it seems like sys.modules is the cache. so, i just hijacked it
 
IIRC "the modules attribute of sys" isn't where the cache is defined, it's just where you can access it. If you rebind the attribute, the original cache is still used, you just cannot access it.
 
this one states "The first place checked during import search is sys.modules. This mapping serves as a cache of all modules that have been previously imported, including the intermediate paths."
as for sys.modules itself, it states
> This is a dictionary that maps module names to modules which have already been loaded. This can be manipulated to force reloading of modules and other tricks. However, replacing the dictionary will not necessarily work as expected and deleting essential items from the dictionary may cause Python to fail.
im not quite sure how to interpret that last sentence.
but it does seem a bit more tightly coupled just a view into the cache (at least, that's how i interpret it and the behaviour in the demo above)
 
Yeah sys.modules gets mentioned enough times in that document that I'd consider it "effectively" the original cache. Maybe there's some layers of indirection under the hood, but the abstraction shouldn't leak and do something unexpected
Confidence that I'm not about to get proven wrong by a trivial counterexample: 65%
I interpret "replacing the dictionary will not necessarily work as expected" to mean, sys.modules = entirely_new_dict_instance might have surprising behavior if there's code in Python's guts that still have a copy of the original dict. But sys.modules["foo"] = bar should propagate into all those holdouts, since the dict reference is still the same
 
I originally had a method that can plot a route between a pair of locations (which could either be a pair of postcodes or a pair of lat/longs) which had another bool argument called is_postcodes (the reasons it needed to be explicit at the time are not important). Point is, it now doesn't need to be explicit and I want to remove it. I'm tempted to just put **kwargs in the function definition to keep back-compatibility but is this the reasonable approach?
Or would you, the hypothetical user, expect a deprecation cycle?
 
4:22 PM
@ParitoshSingh So, this is again IIRC since my last venture into the depths... Basically when Python starts it creates a dict to store all modules. This is then bound to sys.modules and some C variable. Various Python level functions, like those in importlib, will access the cache via sys.modules. However, various interpreter internal objects just directly access the cache via its internal variable. So rebinding sys.modules doesn't fully replace the cache.
 
ah, i see, that makes sense
 
@roganjosh My gut says I should expect a deprecation cycle
 
@roganjosh just to clarify, if you were to write this from scratch, would you have **kwargs at all?
 
@roganjosh I've been rather disillusioned by deprecations recently. I think it's the Right Thing To Do™, it's just a mess how to do it right.
 
@ParitoshSingh No, I would not. That's a great question for levelling this out. The fact it had to be explicit at all was annoying to me, and probably baffling to users too, though
 
4:27 PM
This may be a distraction from the core issue, but I'm curious what ought to happen if you keep back-compatibility and I try calling plan_route(my_pair_of_postcodes, is_postcodes=False). Now that you have the power to determine the first argument's postcodeness without a flag, are you going to verify that the parameters are consistent?
 
yeah, i'd say that if you want to nuke it from orbit, depreciate it and nuke away. no half compromises just for backward compat. though take my word with a grain of salt, i dont maintain softwares and provide awesome services and stuff.
 
@roganjosh IMO using **kwargs is a bad idea because it will prevent obviously incorrect code like your_function(yaurfhtoyui3h=True) from crashing like it should. I would leave the function signature as-is, and emit a DeprecationWarning if is_postcodes is passed. (You may have to change the default value of is_postcodes for this, but that's the only change to the signature I'd make.)
 
yep, seconded.
 
@ParitoshSingh Oh, I always want backwards compat unless it's really serious, it's just that I don't think a user would have wanted to set it in the first place: "what, you can't tell the difference between a string and a list of floats?"
 
if you squint hard enough, a list of floats is just a bunch of floats strung together. ;)
 
4:31 PM
@Kevin I can push that verification elsewhere
 
oh, offtopic, but hey Aran, have you seen an anime called my hero academia? I ended up picking that as my next anime, really enjoying it so far
 
@MisterMiyagi What's the pain point you've now seen? The consensus seems to be that the deprecation cycle is the way to go
 
@ParitoshSingh Yup, good pick!
 
My server is running RoganJoshLib, and I accidentally got gum in all its I/O ports except for its internet hole, so it can still pip install update automatically every morning but I can't edit any of my code
If is_postcodes ceases to be a valid argument, I will go out of business
 
oh noes
 
4:37 PM
Is there some consensus regarding how much time/how many versions should pass before a deprecated feature is actually removed?
 
@Kevin is this more than hyperbole, though?
This is what I haven't quite got a grip on. I've found plenty of methods in the past that take **kwargs for inexplicable reasons to me, but maybe it's for precisely that, or it's just sloppy design?
 
@roganjosh Sorry, been thinking way too far. I was hung up on the string escape sequence deprecation which went through several rounds. Your case should do fine with deprecations.
 
Python's deprecation schedule feels about right to me. Like 2ish big versions, with each version taking several months to come out
 
Ok, the input is much appreciated all. Thanks :)
 
Now that I think about it, I remember a deprecation-related frustration I had in my day job. Our project depended on libraries A and B. Both libraries depended on WidgetLib v1.0. Everything was good for a long time.
A new version of A came out with some features we wanted, so we upgraded. But the new A required WidgetLib v1.1. Now, when B interfaced with WidgetLib, it would occasionally get functionDeprecated warnings and/or crashes.
"Surely you could organize your project so that A and B have separate copies of WidgetLib with different versions?", you suggest. I tried, it didn't work ¯\_(ツ)_/¯
 
4:46 PM
Aug 11 at 11:26, by roganjosh
@Aran-Fey In honour of both your suggestion here and also for bringing the HTML code to my attention some time back, you'll be pleased to know that this is now handled by the server responding with a 418 if it sees a version mismatch in the payload
I'm trying to get 5 different repos to talk properly to each other :'(
Finally got round to cleaning everything up. The is_postcodes flag just saved a headache against time pressures
 
I imagine that there are a variety of stories like mine, where the right solution is to clean up the mess that I made myself instead of asking the WidgetLib maintainers to bandaid the problem for me. But if the WidgetLib maintainers consistently say "sounds like a 'you' problem" to everybody on their issues page, it's maybe not a good look
I'm feeling quite conflicted about this as a library writer and library user
I want to deny responsibility for extra work in all possible roles and scenarios, is that so much to ask
 
5:20 PM
@Aran-Fey the only pattern I've seen recur is "at least two versions". Sometimes they are just floated around as the Sword of Damocles, like collections(?!\.abc). Sometimes the deprecation warning itself specifies "two versions from now". Although now I'm realising that I don't usually pay attention to DeprecationWarning vs PendingDeprecationWarning (although the latter is invisible by default)
 
All deprecated functions in KevinScript are phased out stochastically. They call random.random(), and if the result is lower than 0.1, the process segfaults. Otherwise, the function executes normally.
The 0.1 factor grows in size with each version release until it hits 1. Then I remove the function on the next release.
 
I'd leave it in with factor 1. A segfault is much more motivating than some random attribute error.
 
 
2 hours later…
7:05 PM
New review queue workflow i.stack.imgur.com/gH5x7.png
 
Hmm, yes, I know exactly what this flowchart is trying to convey... you close the tab 0.5 seconds after opening it.
 
7:41 PM
Hey people!
I ran this:
import numpy as np; import pandas as pd

array1 = np.array([10,20,30])
array2 = np.array([100,200,300])
array3 = np.array([-10,-20,-30,-40])

dFrame5 = pd.DataFrame([array1, array3, array2], columns=['A', 'B', 'C', 'D'])
print(dFrame5)
this was the output:
     A    B    C     D
0   10   20   30   NaN
1  -10  -20  -30 -40.0
2  100  200  300   NaN
Why is the -40 having a decimal?
 
Because column D contains floats
 
NaNs are floats?
 
yes
 
Any documentation which I can refer to please?
and if I am not wrong, all the elements in a column in a pandas DataFrame must have the same datatype..
 
Documentation for what? Floats? (Not that I can refer you anyway, I know neither the float docs nor the pandas ones)
 
7:48 PM
@Aran-Fey ok..
documentation relating to datatype of NaNs
 
@RandomPerson What, exactly, do you want documentation on? If you have a NaN, it's going to be a float, unless you use the new nullable-int type
 
Is there any article which mentions that NaNs are float? Because I had no clue that NaNs were float.
 
The wiki on this, maybe?
 
8:09 PM
NaN transcends pandas and numpy and python. It's part of the IEEE floating-point standard.
 
@AndrasDeak ok.
Is there any post about this in SO? and is it advisable to post one if it is not there?
 
i dont really see the purpose right now. you had a question, you got an answer, what are you now after?
 
@RandomPerson no, it's not advisable. What would the question be?
you can look at some of duckduckgo.com/… for inspiration
 
You could just search for "pandas why is nan float" in Google and you'll find all the answers you need
 
Thanks!
 
8:21 PM
don't forget to check out roganjosh's very crucial tip about nullable ints
that's the X for your likely XY problem
 
8:43 PM
cbg
 
@AndrasDeak Ah. I guess that's got something to do with the fact that Community has started posting comments on new questions.
 
 
2 hours later…
11:02 PM
As long as I hash a password like 1 million times with salt and pepper of course, is it useful to hash each password a different number of times like 1 million + 1-1000? Or would that be unnecessary?
 
11:59 PM
cbg
 

« first day (3968 days earlier)      last day (997 days later) »