« first day (3047 days earlier)      last day (2126 days later) » 

00:40
hello i need some pandas help
@ex080 ask away
00:57
I'm looking at this solution stackoverflow.com/questions/13659881/…
and I want to convert the return of the size method into a list that I can pass to another function.
list of tuples like so [('192.168.0.1', 'a', 2), ('192.168.0.1', 'b', 1), ('192.168.0.2', 'b', 1)]
where each tuple is (itemA, itemB, count)
i know i can do series.to_list() to get the values
 
2 hours later…
03:26
When are functions worth using? Other than when the function will be called on multiple times. I just rewrote some of my code from earlier and in order to exit a deeply nested for statement I needed to move the code into a function. Is that okay?
def signup():
for i in range(3):
email = input('Email: ')
if email not in userlist and "@" in email:
for i in range(3):
username = input('Username: ')
if username not in userlist:
for i in range(3):
password = input('Password: ')
password2 = input('Confirm Password: ')
if password == password2:
return True
print('[Failed: Passwords Do Not Match] [Attempt ' + str(i + 1) + ' of 3]\n')
else:
print('[Failed: Username Not Available] [Attempt ' + str(i+1) + ' of 3]\n')
else:
print('[Failed: Email either already tied to an account or invalid] [Attempt ' + str(i+1) + ' of 3]\n')
oops
 
6 hours later…
09:54
im quite sure you already know the answer. Its why you did it.
functions are great for wrapping up "things that belong together". One action so to speak.
makes the code flow much easier to manage.
So yep, tl;dr its a good call.
10:18
dupe re: package_data, exactly what I was asking Antii the other day. --> stackoverflow.com/questions/54743905/…
10:32
i have array as

R = np.array([
[5, 3, 0, 1],
[4, 0, 0, 1],
[1, 1, 0, 5],
[1, 0, 0, 4],
[0, 1, 5, 4],
])

i want to split it as 25% and 75%.
i am doing matrix factorization and so i need 25% data for testing
can any body help me?
these all are ratings
by user to some movie
@ParitoshSingh it's good to use the reply button since it also "pings" the user and provides them with the context of the ping, specially when conversation is dragged out over / after a few hours, else, they may not even see / know what you've posted.
Simple tagging (@) also is sufficient if all you want to do is alert them
Monday cbg :)
@sunil Do you want to separate individual arrays (e.g. [5, 3, 0, 1]) or you want to separate individual elements (e.g. 5, 3, etc.) from within those arrays?
i want separate array but not individual
simply two array
The keyword is "sample"
ok let me see thanks
:)
11:40
cbg
cbg
Can someone help me explain what i am looking at in this dis? Was trying to see if it would show me how mod 2 is calculated.
import dis
dis.dis("2913453453 % 2")
  1           0 LOAD_CONST               0 (1)
              2 RETURN_VALUE
The result is surprisingly "empty".
This is caused by constant folding
When the result is calculated during compilation
Aah i see, thanks! til
dis.dis("x = 2913453453; x % 2")
  1           0 LOAD_CONST               0 (2913453453)
              2 STORE_NAME               0 (x)
              4 LOAD_NAME                0 (x)
              6 LOAD_CONST               1 (2)
              8 BINARY_MODULO
             10 POP_TOP
             12 LOAD_CONST               2 (None)
             14 RETURN_VALUE
yep, much more beefy.
12:42
I am studying python exception handling. When I execute the following code,
class B(Exception):
pass

class C(B):
pass

class D(C):
pass

for cls in [B, C, D]:
try:
raise cls()
except D:
print("D")
except C:
print("C")
except B:
print("B")
I get the following result,
BCD

But If I move the except B: clause to first, It gives me the result as,
BBB
why?
@SmithDwayne Use a code dump service for long posts. Also, see this wiki post for code formatting in chat.
@ParitoshSingh nice. Good to know.
12:59
@shad0w_wa1k3r: Thank you for your suggestion and the wiki link. Thank you. I didn't aware of it before.
you're welcome
if we use a minheap to sort an array would that would be On(logn)?
or O(n)
hello all
i have a problem with dim in array
someone can help me?
13:25
@BossShell welcome to the room :-) Please go here to get a bit of info about us!
satck overflow always the same
No need to ask about asking a question, just go ahead and ask the question
I have an array of arrays
all the elements of my array have same legth
so, python automatically see it as a matrix (2 dim)
but i want it as array of arrays
1d
list = [np.array([12353., 12386., 12420., 12646., 12670., 12704., 12748., 12777.,
12808., 12873., 12900., 12934., 13000., 13038., 13070., 13255.,
13290., 13317.]), np.array([13909., 13935., 13969., 14198., 14227., 14250., 14297., 14328.,
14362., 14433., 14467., 14489., 14561., 14591., 14617., 14812.,
14837., 14864.]), np.array([15854., 15889., 15917., 16142., 16176., 16209., 16247., 16279.,
16296., 16373., 16409., 16450., 16507., 16540., 16568., 16762.,
16793., 16818.]), np.array([17059., 17087., 17127., 17353., 17376., 17400., 17453., 17480.,
This is the list
If i convert it to nparray
it become 2d
how can avoid it?
13:31
I'm not a numpy guy so I can't help, but if you don't get an answer soon, you might just post as an SO question. Many more people monitor and answer question posts than hang out here.
ok thank you
Be sure to be clear about what you are getting vs. what is desired, and that you are referring to np.arrays. Many people post questions in Python talking about arrays when what they are really working with are standard Python lists, and this tends to slow things down a bit.
Also (and I mean no offense here), are you sure what you are getting is just being displayed in an unexpected manner? Sometimes people ask "how do I remove the brackets and commas from my list of ints?" not realizing that the brackets and commas aren't really part of the list, just part of the output when displaying the list.
ok man, the fact is that the list i posted above is of 2 dim
you can check yourself by using ndim
it is 7, 18
And lastly (again I'm not a numpy guy), perhaps numpy is doing what you want under the covers? What do you get if you make your 2d matrix, and then retrieve the [0]th element?
i want to be (7, )
13:37
Sounds like what you want is a single array of ints then?
Flatten all into one long array?
i want array of arrays
[array, array, array]
in column
I see
My bad - you were showing the dimension, not the values
Do you want the arrays to no longer be arrays, perhaps lists?
stepping away
13:56
stepping back (or "cbg")
My guess is that if you keep it as array of arrays, numpy will assume 2d. Perhaps an array of lists will suffice?
14:11
Array of arrays is possible but why would you want that?!
it defeats the purpose of using numpy for efficiency!
100% this is an XY problem, so perhaps you should tell us about your use case
Wagh; sign back in, get facefull of np.array. Happy Monday morning! XP
you're saying that as if that were a bad thing
TIL to not Google Image Search "face full of pillows". Actual pillows being the only thing my face wants to be full of, right now. ;^P
Speaking of Google… was it here that had the link to the most epic user submitted issue complaint of all time? :D Every time someone pops into the web development Freenode IRC channel asking for help integrating ReCaptcha, everyone present pounces on the "you don't really want what this gives you" user experience side. XP
14:26
---
^ strikethrough...
Huzzah! Thanks!
"It's Markdown, Jim, but not as we know it."
if you're on desktop there's a "faq" link in the bottom right
14:43
is anyone here using Ubuntu? I am an undergraduate and I'm told to install Ubuntu 16.04.X, but I'm not sure what that means as I checked my version and it says 16.04.5, cant seem to find the installation link for "16.04.X"
this is the python room on chat.SO
ask in a relevant room on chat.SE
 
1 hour later…
15:48
@PrashinJeevaganth On the gripping hand, "X" is a placeholder for "any" or "variable", with some interesting history as to why that's the default symbol used.
16:36
cabbage
16:52
cbg
17:32
@amcgregor note that it's not that I can't answer, it's more about teaching someone to fish
@AndrasDeak ^_^ Indeed; one of the reasons I took so long to reply, wanted to let "the right approach" sink in / get tried first. OHOH, practicality beats purity, no? ;)
I like to teach fishing, while simultaneously stuffing students faces full of fish.
Tasty, tasty fishes.
 
3 hours later…
20:27
how should I proceed if I have my full website developed in PHP but I want to integrate one chat application in that as well?But I prefer django channels, So is it possible?If yes how should I proceed?
stackoverflow.com/questions/54743905/… --- dupe, same Q I asked Antii the other day. Posted this late last night but don't think many people saw it.
*Antti
@AndrasDeak and I even looked at the answer Antti gave to make sure I spelled it right! oof.
suppose I could've just @'d the name to see the spelling. silly me.
I'm pretty sure I'd get his last name wrong without looking in a couple of places
21:02
@NimishBansal You can use your front-end load balancer (Nginx, Apache, etc.) to direct requests for specific sub-paths of your domain at one application, and everything else at another. E.g. <Location /chat>… — as a minor note, requiring Django for "chat" may be excessive. It can be done entirely with Nginx + nchan (or NHPM). This being an example group chat with no server-side application.
22:00
recbg

« first day (3047 days earlier)      last day (2126 days later) »