« first day (3539 days earlier)      last day (1392 days later) » 

12:26 AM
Hot massive water storage...that project totals ~5000 loc including tests, according to cloc.
 
@toonarmycaptain ......Guinness is beer......
@roganjosh This is why I love SQLite. This is why I hate SQLite
 
@LinkBerest Guinness is stout. I've had to clarify the distinction a few times. While it is a beer, using the generic often leads to being offered...undrinkable...things.
Cue quote about American beer being like sex in a canoe...[it's on topic in this room!]
 
@toonarmycaptain My family (on my mom's side) last name comes from the type of barrel they used to age Scotch and Ale - I understand not wanting lager that tastes like water ;)
 
@LinkBerest Yeah as far as beers, I'll really only drink Guinness, or Kilkenny or similar - but I haven't seen Kilkenny since I've been in the US.
 
@Aran-Fey tkinter does not, the modern ttk interface does have them with borderwidth & relief (which allows selecting a border pattern)
@toonarmycaptain If your in the Northern US they sometimes have it (Canadians love it so I know I used to drink it in WI) but yeah, because its the same maker as Guiness (and so close to Smithwicks) not many places in the US carry it
@ChrisP as you've been pointed to before read the docs on effbot for Label - specifically borderwidth & relief
^ the ttk & tk is the same there so if you try it and it doesn't work then ask with an MVE
 
1:20 AM
cbg
 
 
3 hours later…
4:03 AM
cbg, are these both the same in terms of encoding? are they both utf-8
>>> bytes('string','utf-8')
b'string'
>>> b'string'
b'string'
 
I don't know myself, but the docs might point you to a method that could return the encoding?
 
I was using terms like "how is b string encoded in python" and "get encoding of text"
stackoverflow.com/a/6273618/12502959, this answer shows b'\xE2\x82\xAC'.decode('UTF-8') so I am guessing b strings are utf-8
 
4:22 AM
No, b strings is an immutable list of bytes - it may or may not have any encoding
>>> b'\xf0\x00'.decode('utf-8')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf0 in position 0: invalid continuation byte
 
@python_learner Yep, that string has encoding UTF-8, another one might not. But if your b'string' and bytes('string', 'utf-8') show the same encoding, then they likely are.
 
as for your original question, the two b strings are equal, and if they can be decoded successfully as utf-8 then they would be a series of bytes that is valid utf-8
 
thank you for that, I will read what you linked
 
5:13 AM
can you please format your code properly and describe your issue more thoroughly, please refer to room rules which is also listed at the top right.
 
5:27 AM
import os
from pathlib import Path
root='/dbfs/mnt/datalake/../Internal/'
size = 0
for path, subdirs, files in os.walk(root):
  for f in Path(root).iterdir():
    if name in files:
      if f.is_dir():
        size+=os.path.getsize(os.path.join(path, name))
        dirSize = size/(1024*1024)
      print(f, "--Size:", dirSize)
print("Directory size=", dirSize/(1024*1024))
Here is the code formatted.
 
You still have not stated exactly what didn't work.
Also, you just posted your question onto the site, and someone linked a solution that may already solve your issue.
 
It gives immediate folder size but at the end total size doesn't display. And even if I change the path the code doesn't work.
 
 
2 hours later…
7:11 AM
similarity_score = [[text_similarity(item,item1)]for item in title for item1 in title2] how to figure out iteration result ending and starting in nested loop in python
 
@loving_guy I'm not sure what you mean. Are you asking for someone to "unpack" the list comprehension into a traditional nested for loop?
@Crime_Master_GoGo What does it print at the end? Your question wording suggests that nothing is printed, but I'm not sure that's the case
 
@roganjosh I am not asking for unpacking the nested list. I am saying how to find where the output of inner loop ends and outer loop starts so that I can make sense of results
 
7:27 AM
def seen(item, item1):
    print("seen {}, {}".format(item, item1))

a = [1, 2, 3]
b = [4, 5, 6]

c = [seen(item, item1) for item in a for item1 in b]
 
So which one is the "inner" loop and where does it "end", whatever that means?
 
I was kinda hoping to hand-wave the issue of me not really getting the question by having printed outputs :)
 
second one is inner loop
 
I suspect that they might want to chunk the end result based on the length of title
 
I have to sort the results for each inner loop iteration also so i wanted to see where the output of every inner loop ends
 
7:35 AM
So the question is really "this code doesn't produce the output I want. How can I make it produce the output I want?", isn't it? You probably want a nested list as output, no?
Like [[(item, item1) for item in a] for item1 in b] or maybe just zip(a, b)
 
If it is chunking, maybe something like:
def chunk(l, n):
    return [l[i:i + n] for i in range(0, len(l), n)]

list_1 = [1, 2, 3]
list_2 = [4, 5, 6]

c = [(item, item1) for item in list_1 for item1 in list_2]

chunks = chunk(c, len(list_1))
collated = {list_1[i]: chunk_result for i, chunk_result in enumerate(chunks)}
But at this rate, I think it's just open to guesstimation because I suspect the list comp is pulled from an SO answer and there's some cargo culting going on
@LinkBerest I wanted to elaborate on this but, actually, I think you've captured my sentiment exactly :P
 
@Aran-Fey i m trying nested loop but the it is taking too much time for large data
 
It takes the same amount of time as your code. It just creates output in a different format.
 
[sort([(item, item1) for item in a]) for item1 in b] will this sort the inner loop output results only right?
 
Not if the "inner" loop is the 2nd one
 
7:44 AM
@Aran-Fey i know with respect to my original code, your code is same but is there any alternative for nested loop in python
 
nope
 
@Aran-Fey where to use sort() in inner loop so that i can sort only inner loop results
 
@loving_guy Please can you pin your question down to one specific issue? You're meandering between different things
 
@loving_guy Exactly where you used it, you just swap the two loops
 
[sort([(item, item1) for item in a]) for item1 in b] where i am swaping loops here?
 
7:48 AM
[sort([(item, item1) for item1 in b]) for item in a]
 
NameError: name 'sort' is not defined
I am getting this
 
Replace with sorted. Also, you're aware that the examples have drifted away from calling text_similarity on the items in your lists?
 
sorry
 
I've got a terminology/API design question. When we do isinstance(x, Y), we intuitively understand that as "can x be used as an Y", right? If so, how do we make the connection to issubclass? Would you expect isinstance(x, Y) == issubclass(type(x), Y)?
My problem is that I interpret isinstance as "is compatible with", but issubclass as "is less generic than". These are incompatible, so isinstance(x, Y) is not necessarily the same thing as issubclass(type(x), Y)
Example:
def func(a: Union[int, str]) -> None:
    pass

assert is_instance(func, Callable[[int], None])
assert not is_subtype(Callable[[Union[int, str]], None], Callable[[int], None])
 
this... gets into some very weird places if you throw metaclass into the mix
 
8:00 AM
Evidently func is a callable that accepts an int parameter. But it also accepts strings, so while it is compatible with Callable[[int], None] it's not a subclass/subtype thereof
So I'm thinking of making two separate functions, is_subtype and is_compatible_with
Actually, this just boils down to variance again, doesn't it
The confusion stems from the assumption that is_subtype behaves covariantly, while callables actually behave contravariantly... I think. Maybe.
@metatoaster Does it? I don't think I need to concern myself with metaclasses. If issubclass(A, B), then that already guarantees issubclass(type(A), type(B)), right?
Disregarding __subclasscheck__ shenanigans
 
8:27 AM
@python_learner Only if the characters are restricted to the ASCII range. Compare bytes('ßtröng','utf-8') versus b'ßtröng'.
@Aran-Fey You should interpret both according to Liskov Substitution Principle – that's the only "hard" rule for OOP inheritance. So isinstance(x, Y) == issubclass(type(x), Y).
Subclasses being more "general" and "restrictive" is misleading. Usually, they are both.
A subclass can be "more general" in that it allows for additional functionality than the base. At the same time, it can be "more restrictive" as it will narrow down the existing functionality of the base.
 
Hmmm. That makes sense, I guess
 
Im looking for an example how to structure a dependencies file (modules etc)
 
On the other hand, the LSP doesn't really apply to things like TypeVars and Unions, does it?
 
Now it gets interesting...
I think it does. A TypeVar/Union basically has no functionality other than "isinstance"/"issubclass" is. So an int "is a" Union[int, ...] in that you can do isinstance(union_value, int) and get some well-defined behaviour.
You can only access the int-specific functionality once the Union[int, ...] is narrowed down to the "subclass" Union[int] == int.
The same way you could start with, say, an object and narrow it down to an int in a branch that is protected by if isinstance(object_value, int):.
@Amundsen what do you mean by dependecies file? a requirements.txt? a setup.py? a pyproject.toml?
 
8:45 AM
Right, so isn't it backwards? You're arguing that issubclass(int, Union[int, ...]), but what I have a problem with is issubclass(Union[int, ...], int)
 
@MisterMiyagi I guess a requirements.txt I need to list what modules, librarys I have used
 
pip freeze > requirements.txt if you're using a virtual environment. If you're using the base environment/installation then it's going to pull every module you have installed
 
@Aran-Fey I'm decently sure issubclass(Union[int, A], int) should be False unless A is int as well.
 
oh, right, it's only true in a contravariant context
 
Hey, soundcheck question, which book of algorithms and data structure you like most(no subjectivism please, I am asking about you)?[I googled exhaustively almost everyone recommends Introduction to algorithms by cormenn which is just]
 
8:55 AM
alright then, a single function will do. Now I just have to implement it. How hard can it be
 
@Aran-Fey That one bit me hard in the beginning. Couldn't wrap my head around it. :/
I've had a very well-written thesis explaining this entire subtype theory thingy, but I can't find it at the moment. Will shoot you a line if I can recover it.
 
@iaeliyen How could an answer to that be anything other than subjective if you're asking what we like personally?
 
@roganjosh ignore that part(I was pretty sure that I would get replies like "it depends on who you ask, what are their experience" --- defusing the answer in the gloom of mysticism)
 
import inspect

def _build_defaults(self):
    # First find where script is being executed
    stack_trace = inspect.stack()
    self.cur_dir = '\\'.join(stack_trace[1][1].split('\\')[:-1])
I've installed one of my packages locally with pip install -e . to play with. I want to bootstrap my app by creating a config file on a path relative to where the script is that imports my library. Is there a neat way to do this? I've found a way but it feels gross and possibly not workable across different OSs (though can't test that right now)
I've tried going through alembic to find how it bootstraps itself but searching for init is hopeless, I can't seem to find how it handles it, and surprisingly can only find os.mkdir as part of testing
 
I guess I need to add more background: Intermediate and non-proofy(unlike cormenn's)
(and with a special section of NP problem algorithms)
 
9:04 AM
@roganjosh It's not exactly the same thing, but you could make it relative to the location of the main script. I.e. import __main__; self.cur_dir = Path(__main__.__file__).parent
 
@Aran-Fey Let me give it a whirl. If it works, I need to dig up where ever I got my inspiration from for the monster I created because that looks much neater. Thanks!
 
isn't sys.path[0] always the top-script location?
 
I think python -m affects that
 
@Aran-Fey works perfectly in my case, thank you :)
 
9:21 AM
__file__ isn't always available - for instances, namespaces don't always have them
 
can __main__ be a namespace package?
 
@roganjosh if the target module is part of an installed package, do something like this
>>> import pkg_resources  # provided by setuptools
>>> pkg_resources.resource_filename('wheel', 'util.py')
'/tmp/env/lib/python3.6/site-packages/wheel/util.py'
 
@metatoaster but that will put the config file in the directory that the library is actually installed in?
 
I mean, it will resolve to any path, like so
>>> pkg_resources.resource_filename('wheel', 'some_new_config.conf')
'/tmp/env/lib/python3.6/site-packages/wheel/some_new_config.conf'
 
I don't want users to have to dig through site-packages. I want them to make a new directory called my_awesome_app, create a script that imports my library there, and have my library dump the config file in my_awesome_app
If that's what your suggestion actually enables then I have a huge blind spot in my understanding so you'd need to shove me in the direction of what I need to read up on :)
 
9:29 AM
backtrack a bit: what exactly are you trying to do here? Are you telling your users to write a Python script that imports your library and your library does magic that will write a config next to where the user saved their Python script? Or are you working on something that pokes at some Python package?
 
Give me 2 mins to pull it together in an MCVE
 
re-reading what you originally wrote, the import __main__ method and getting the __file__ of that may be actually what you are after
 
It's here. As I said, Aran's method works but I'm still open to potential issues
 
@Aran-Fey this section in PEP-3119 is what I was referring to when I mentioned issubclass vs isinstance in the context of metaclass
yeah, if you are requiring your user to import your library/package/module, that is the way to get to the entry point and I don't think the issues I raised will be an issue
for some reason I thought you were after writing a configuration file in your package and you need to get to the path, probably because I worked extensively with that use case (well, reading arbitrary files installed with Python packages).
 
9:47 AM
No worries. I guess my remaining issue is where import __main__ fits in with my import hierarchy and OCD :P
 
HI, I'm new to Python; I have some methods inside a py file outside class. when I call them inside a class, it returns just function objects and not the values
```
import datetime

def seven_days_ago():
return datetime.date.today() - datetime.timedelta(days=7)


def fourteen_days_ago():
return (seven_days_ago - datetime.timedelta(days=6)).strftime("%d")
```
 
@PrashanthSams Note that triple backticks won't work in chat. We have a formatting guide for chat
 
sure @roganjosh
 
In any case, you haven't shown how you call the functions. If you just get function objects then you presumably did something = seven_days_ago and not something = seven_days_ago() (note the () that actually calls the function)
 
Does anyone have any experience/knowledge of the simplest way of installing Python on a VM and using it for automation? Is the easiest way forward be to just install base Python from Python.org, and then just set it off?
 
9:55 AM
Actually, the problem is seven_days_ago - datetime.timedelta(days=6). You're just referencing the function name, so you'd need seven_days_ago() - datetime.timedelta(days=6)
Note that this is not good code. Why wouldn't you just have a function that can take the number of days as an argument?
 
@roganjosh You're right, I missed () and it works now :)
 
@roganjosh I would do a scope level import in that case, i.e. don't import it at the top level, import immediately before its usage
 
@PrashanthSams Something like this would be better:
import datetime as dt

def subtract_days(days=0):
    return (dt.date.today() - dt.timedelta(days)).strftime('%d')

seven_days_ago = subtract_days(7)
fourteen_days_ago = subtract_days(14)
print(seven_days_ago)
print(fourteen_days_ago)
@metatoaster I agree. Just for curiosity, is there something I would screw with by having the import at the top of the module if I never intend to run config.py directly?
 
@roganjosh yeah; much helpful :)
 
not directly, no, but making __main__ available from your config module (as a global) means some other Python code/module can patch it with something else, so if that is intended then you might want that, but if you don't want that to be that easy, then keep it at local scope.
Though like most things in Python usually something can be done to brute force that to something else (e.g. messing about with sys.modules)
 
10:24 AM
@roganjosh How you can embed code to chat?
 
@VictorVosMottorthanksMonica I'm not sure what you mean by "embed"? If you want to post code then we have a guide for that (we also have rules including how long snippets should be). If you're asking how I linked both of those, I'm using [thing I want to say](url_of_thing)
 
 
1 hour later…
11:28 AM
@JamesMcIntyre I missed this on a first-pass sorry. I have installed python on VMs, and had virtual environments on those VMs. What's your concern, exactly?
 
11:46 AM
cannot extend enumerations :(
 
12:26 PM
@roganjosh thanks! I meant it is good formatted ;)
 
12:37 PM
Thanks for the responce. To be honest I'm not really sure where to start:

I currently have automation running on a physical machine in my office. I need to migrate from this to a VM as I don't have access personally to the phiscal machine and so can't develope on it to see what works in production. The way I have had this set up on the pysical machine is by using auto-py-to-exe to create an exe file which is then triggered by an exe schedular on the machine.

This is a slow way to develop and auto-py-exe doesn't support all of the modules I want to use. Also, I've created a Run() function
 
recbg
 
cbg
 
cbg
 
cbg
 
@roganjosh yeah, SQLite is one of my favorite tools and works so well on a small scale. So sometime I over use it and immediately regret it
 
12:42 PM
what is recbg and cbg?
 
@JamesMcIntyre Salad
 
@JamesMcIntyre cbg is "cabbage" and recbg is "cabbage" with dictionary.com/browse/re- prefix
 
ahh so cbg is "Hello / Hi, I'm back"
 
@JamesMcIntyre I'm still not quite sure I follow. Firstly, what Operating System?
 
Windows, unfortunatly
 
12:47 PM
Hey All! I'm looking for a 3D scatter plot visualisation tool for N-Dimensional data. I'll have a feature which allows users to switch between dimensions intuitively.
 
Well, I tend to just rely on APScheduler and not rely on Windows scheduling of tasks. It also takes cron-type arguments. You could install Anaconda and just make sure it's added to PATH when you install it (it's an option that pops up and IIRC it says it's not recommended - not sure why)
 
@newkid hello. Good luck :) Creating comprehensible 3d scatter plots is a huge challenge in data visualization.
 
@AndrasDeak no kidding...
 
in an interactive plot there's more hope to convey depth information
 
I use D3 for that type of dashboard or chart
 
12:49 PM
something like a stem plot helps a bit with depth info
 
Hmm!
 
but that's less sparkly and fancy :)
 
Yeah, I have data which has ~11/12 dimensions...
having it sparkly, interactive etc can be a very good pitch for selling it ...
Just for fun I thought I'd use the AR tool kit to project things in space. But I'm realising as a novice - there is no 'just for fun' when it comes to visualising N-D data
*~11 dimensions
 
1:04 PM
I've been finding that less clients are wanting the sparkle (when data is large) because they end up only using a small part of the drilldown
Meeting time, rbrb
 
@LinkBerest Huh, I find the opposite. It's nice to say "we have a team looking into this" and show the sparkly things than actually understand what on Earth it shows or why they asked for it
I always regress back to the time I just caved and gave them what they asked for; a geo-fenced map of a country with a blob in the center of each geofence scaled to the size of how many people used our product. I understood nothing from it. I thought that got me off-the-hook but then they asked me to build a model that would take any lat/long (of any country, and no other info) to predict our market penetration.
It... hurt
 
 
2 hours later…
3:46 PM
Hello! I could need some help to find a good pattern for multiple for loops
 
@winklerrr Can you clarify what you mean? Usually, one just nests for loops. What other pattern do you need?
 
I'm writing the same code over and over again, because in every nested for loop I'm doing the same two things (get links, open links)
So I thougth about using map ...
 
you could probably construct a generator that you loop over once
 
Please give a MCVE
 
without a more specific example there's no way to tell
 
3:50 PM
But I'm working with Selenium and the get_links and open_links are based on the current state...
 
a generator has state
 
Should I open a new question on SO?
 
Not if you want to have a quick answer here
 
Not necessarily, but you need to get us up-to-speed on what you're asking here too :)
 
@winklerrr so the difference is that the for loops iterate over, but not what they do with each element?
are you aware of map?
 
3:53 PM
For specifics, here are our rules. Discussion of a problem should either be on the main site or here, but not both in parallel.
 
@MisterMiyagi Seems they are
 
So, let's say I have three sites that I need to loop over: a, b and c
For each site, I need to visit 3 subpages: 1, 2 and 3
On these three subpages I need to visit 3 sub-sub-pages: x, y, z

On all pages I'm doing the same actions
 
is there any way to increase the width of the bar when using sns.catplot
 
@winklerrr there will eventually be code, right?
 
https://seaborn.pydata.org/generated/seaborn.catplot.html
unable to see if it has arguments for it, maybe im missing something
 
3:58 PM
@winklerrr Doesn't work for me. In the back of my head, I want to try async requests with a callback. No idea if it applies here
 
grr... formatting doesn't work here?
 
@SaiAstro you probably can pass kwargs onto the underlying plotting function, something that constructs the bar plot
 
I'm moving that message because it also clarified nothing
 
I'm only guessing because that would be reasonable behaviour, but I don't use seaborn
 
for . in a, b, c:
  do_action("1.level")
  for . in 1, 2, 3:
    do_action("2.level")
    for . in x, y, z:
      do_action("3.level")
 
@roganjosh Thanks for the heads up. I'm up to my elbows in segfaulting OpenSSL calls, not the best situation stay aware of the discussion. :/
 
So, this is what it looks like.
I'm doing the same actions over and over again, but in every level one string is changing
Is there a better pattern for such a nested for loop?\
 
is do_action("1.level") different from do_action("2.level")?
 
same action, just another string that I need to pass over
 
4:03 PM
I highly doubt that those strings don't depend on the actual loop variables
 
But they take a, 1, x as parameters, yes?
 
As presented it doesn't check out, so I'm out
 
they dont depend on the loop variables
nope
@MisterMiyagi nope
 
...do you have a lot of globals?
 
I have just three hard coded strings
 
4:05 PM
OK
 
So you run do_action("1.level") three times, do_action("2.level") nine times, and do_action("3.level") 27 times? That's it?
What's the deal with a, b, c, 1, 2, 3, x, y, z then? Where do sites, pages and subpages come into the picutre?
 
Yes, but I'm doing all of this in selenium (on a web page, clicking buttons)
So I first need to visit page `a` and click buttons there, I then need to go to the subpage `a1` and do the same action there. After that, I need to visit `a1x` an so on
So the order is important
 
Ah. Frankly, I'd stay with the nested loop. It seems to accurately express what you want to do.
 
hmm
 
@MisterMiyagi I'm going to nod knowingly and proceed to have nightmares about segfaults on OpenSSL :P
I'm slightly relieved that the first answer sounds right up your alley
 
4:26 PM
Might be of interest; PEG's letting us get pattern matching syntax, like in Rust, with PEP 622
 
@AndrasDeak thanks,
cld anyone help me understand my chart looks weird like this
oops how to show pic?
 
Use the "upload" button to post as a message
 
i dont see (._.)
 
Are you on mobile?
 
nope, work pc
 
4:32 PM
It unlocks at what, 50 rep? 100? 150?
 
Upload it to imgur and post a link here as [here is my screenshot](the_imgur_url) or something
 
imgur blocked lol
anyway tinyurl.com/wassup11
lmk if image accessible, thanks
my code : plt.plot( 'oppor_cls_yr_num', 'peid', data=final_df_500, markerfacecolor='blue', markersize=12, color='skyblue', linewidth=4)
 
There's always the "fun" approach of creating a MCVE such that we don't need off-site pictures. We could experience it in reality
 
4:54 PM
@Peilonrayz Smells like ruby. Strange to see this when knowing PEP 3103...
 
@SaiAstro code as a picture is pretty much useless for answering questions. I often need to be able to run the code which I can't do from a pic.
@MisterMiyagi The Abstract for PEP 622 specifically states it is addressing a different problem...or at least proposing a different solution...than PEP 3103
 
@MisterMiyagi Never seen this in Ruby, and searching only comes back with regex. It's quite a lot different to a basic switch statement.
 
@Peilonrayz The idea of having a special operator for this seems close to Ruby's === operator.
 
Ah, I see what you mean now
 
5:10 PM
@roganjosh Sorry for the late reply and thanks for your help RoganJosh. I might well use that Scheduler thanks.
 
I am trying to solve this problem statement with the following code:
import itertools

for case in range(int(input())):
    n,x = map(int,input().split())
    array = list(map(int, input().split()))
    array.sort()
    l = -1
    for i in range(len(array), -1, -1):
        for combination in itertools.combinations(array,i):
            if int(sum(combination)%x) != 0:
                l = i
                break
        if l != -1:
            break
    print(l)
 
@JamesMcIntyre No need for apologies. I'm still not sure why the VM is significant at all in your question btw
 
However I am not able to understand where the approach is wrong
Its passing the trial cases
Please help
 
5:26 PM
@d4rk4ng31 "An array 𝑎 is a subarray of an array 𝑏 if 𝑎 can be obtained from 𝑏 by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end." Your solution doesn't agree with this definition from the problem statement.
 
In what way? I'm simply bruteforcing
I mean am I supposed to have permutations instead of combinations?
But even then, as only the length is requested, and addition is associative, it won't matter
 
You are testing every combination of i elements. When the test clearly states the i elements must be contiguous.
so for the array [1, 2, 3], the problem allows [1, 2] and [2, 3] as subarrays, but not [1, 3].
 
But don't all 3 have same length?
 
that doesn't matter
read the part I quoted again
 
Hmm.... You're right. Thanks :)
 
 
2 hours later…
7:23 PM
@roganjosh yeah....lol. I should have said good clients. I have plenty of the other type too
 
Making shiny graphs is fun, though. I never did the PCA that Andras suggested, or the violin plots (shame on me). I did play with D3 to get a 3D graph but failed :( (and for context, I actively asked for pointless stuff to plot for my situation)
@PaulMcG I really want to jump-the-gun on what you deleted, and potentially save you some time
I'll say this; the default integer type for numpy arrays is 32 bit on Windows, regardless of the Python installation
So, overflows are my bane
 
8:43 PM
Have a nice night.
Bye!
 
@ChrisP Rhubarb
 
 
2 hours later…
10:31 PM
Guys how do you cope sitting in a chair long hours? Sometimes i really want to read or work on the computer (and i have a good chair) but my whole body is telling me> Please stop sitting! To much sitting is hard
good night and cabbage
 
I sit on an exercise ball
 
11:00 PM
not MCVE/debugging help/needs details, unless the (13-rep) OP fixes that quickly stackoverflow.com/questions/62565116/…
 
11:21 PM
@ExoticBirdsMerchant Sometimes stand. High desk/counter or standing desk is good (your employer might reimburse, or tax-deductible). Do stretches (esp.wrists, arms, shoulders, back, hamstrings) while standing or on phone, or walk around house, or yoga/pilates/rows/light weights. Go for a walk to take/make phone calls/confcalls or download a podcast to listen to or an audiobook. Look for good advice videos on web. ...
...Use one of the many good apps to set timer tell you to get up for a stretch/walk/wrist stretches. Useful stuff to keep near home desk: resistance band/tubing, roll-up exercise mat, light weights (3lb/5lb), light body bar, pillow/towel (support neck during exercises lying flat), etc.
19
Q: numpy array dtype is coming as int32 by default in a windows 10 64 bit machine

PranaI have installed Anaconda 3 64 bit on my laptop and written the following code in Spyder: import numpy.distutils.system_info as sysinfo import numpy as np import platform sysinfo.platform_bits platform.architecture() my_array = np.array([0,1,2,3]) my_array.dtype Output of these commands sho...

Can we not at least override the np defaults to force int64 as default type?
 
11:36 PM
@smci closed PR from 16 days ago github.com/numpy/numpy/pull/16535
something like that might happen soon
or "soon", because it's quite a bit tangled with other issues
the main issue is that np.int_ means long (for python 2 historical reasons) which is 32-bit on windows, if I understand correctly
 

« first day (3539 days earlier)      last day (1392 days later) »