workspace
stringclasses
1 value
channel
stringclasses
1 value
sentences
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
sentence_id
stringlengths
44
53
timestamp
float64
1.5B
1.56B
__index_level_0__
int64
0
106k
pythondev
help
You want to give something `join` can use easily, but I think if you give it multiple tuples, it will not convert them to strings in the format you would like. So you should have another step after zipping to format them into something that will work well with join
2019-03-22T09:14:58.324600
Ashley
pythondev_help_Ashley_2019-03-22T09:14:58.324600
1,553,246,098.3246
14,421
pythondev
help
```In [9]: [f'{column[0]}={column[1]}' for column in zip(columns, merge_columns)] Out[9]: ['ID=Source.ID', 'CreatedAt=Source.CreatedAt', 'Note=Source.Note'] ```
2019-03-22T09:16:54.324800
Hiroko
pythondev_help_Hiroko_2019-03-22T09:16:54.324800
1,553,246,214.3248
14,422
pythondev
help
then you can join on that to create a string
2019-03-22T09:17:03.325100
Hiroko
pythondev_help_Hiroko_2019-03-22T09:17:03.325100
1,553,246,223.3251
14,423
pythondev
help
Hello everyone I am trying to create a function that sorts out players from collection into a collection of teams. So far, i have been able to get to the point where all players go in all three teams in a dict. But i need 6 per team. On my track of thinking, i know i can accomplish this with an ` if ` statement. Can someone help me with this part?
2019-03-22T09:19:37.325200
Juliana
pythondev_help_Juliana_2019-03-22T09:19:37.325200
1,553,246,377.3252
14,424
pythondev
help
This is all getting put into a dict with the teams as keys and the players as the values.
2019-03-22T09:20:15.326000
Juliana
pythondev_help_Juliana_2019-03-22T09:20:15.326000
1,553,246,415.326
14,425
pythondev
help
<@Juliana> I think this would be a good area to practice OOP. You can make a Team class and a Player class. You can make instances for each team and player, and allow both the player to track what team they're on and the team to track the players on it
2019-03-22T09:23:45.328400
Ashley
pythondev_help_Ashley_2019-03-22T09:23:45.328400
1,553,246,625.3284
14,426
pythondev
help
I have not gotten to the OOP unit in the class i am taking yet, we are reviewing the concepts learned so far. Is there any way to do it with an if statement? <@Ashley>
2019-03-22T09:26:55.329500
Juliana
pythondev_help_Juliana_2019-03-22T09:26:55.329500
1,553,246,815.3295
14,427
pythondev
help
thanks guys
2019-03-22T09:27:18.329800
Dawn
pythondev_help_Dawn_2019-03-22T09:27:18.329800
1,553,246,838.3298
14,428
pythondev
help
I'm not sure you need to
2019-03-22T09:31:04.330200
Ashley
pythondev_help_Ashley_2019-03-22T09:31:04.330200
1,553,247,064.3302
14,429
pythondev
help
How are the players supposed to be divided up?
2019-03-22T09:31:17.330600
Ashley
pythondev_help_Ashley_2019-03-22T09:31:17.330600
1,553,247,077.3306
14,430
pythondev
help
Is it to just grab the first 6 and put them on the first team, then grab the next 6 and put them in the next team, and so on?
2019-03-22T09:31:56.332100
Ashley
pythondev_help_Ashley_2019-03-22T09:31:56.332100
1,553,247,116.3321
14,431
pythondev
help
They are being sorted by experience in a separate function. And yes^
2019-03-22T09:32:18.332500
Juliana
pythondev_help_Juliana_2019-03-22T09:32:18.332500
1,553,247,138.3325
14,432
pythondev
help
So you want one team with the 6 most experienced players?
2019-03-22T09:32:39.333400
Ashley
pythondev_help_Ashley_2019-03-22T09:32:39.333400
1,553,247,159.3334
14,433
pythondev
help
I need them placed like how they do fantasy football picks, if you know how that goes.
2019-03-22T09:33:23.334300
Juliana
pythondev_help_Juliana_2019-03-22T09:33:23.334300
1,553,247,203.3343
14,434
pythondev
help
like: 1,2,3 6,5,4 7,8,9
2019-03-22T09:33:55.334800
Juliana
pythondev_help_Juliana_2019-03-22T09:33:55.334800
1,553,247,235.3348
14,435
pythondev
help
Thats more even teams id say
2019-03-22T09:34:16.335200
Juliana
pythondev_help_Juliana_2019-03-22T09:34:16.335200
1,553,247,256.3352
14,436
pythondev
help
or just putting them in one by one, i don't think it has to be that even. <@Ashley>
2019-03-22T09:35:08.336100
Juliana
pythondev_help_Juliana_2019-03-22T09:35:08.336100
1,553,247,308.3361
14,437
pythondev
help
You're basically looking to add them in one by one, until you have no more. You don't need to worry about checking if a team has more than 6 members unless you have more players than 6*number of teams and the assignment says you can only have exactly 6 players
2019-03-22T09:51:44.338300
Ashley
pythondev_help_Ashley_2019-03-22T09:51:44.338300
1,553,248,304.3383
14,438
pythondev
help
there are 3 teams and 18 players. So what would that if statement need to look like? <@Ashley>
2019-03-22T09:53:15.339100
Juliana
pythondev_help_Juliana_2019-03-22T09:53:15.339100
1,553,248,395.3391
14,439
pythondev
help
Why would you need an if statement?
2019-03-22T09:53:50.339600
Ashley
pythondev_help_Ashley_2019-03-22T09:53:50.339600
1,553,248,430.3396
14,440
pythondev
help
Because when i run it like this, it adds it like this {team1 = [all players], team2 = [all players], team3 = [all players]}
2019-03-22T09:56:26.339900
Juliana
pythondev_help_Juliana_2019-03-22T09:56:26.339900
1,553,248,586.3399
14,441
pythondev
help
this is the way i need it to use later on in the function: {team1 = [1,4,7], team2 = [2,5,8], team3 = [3,6,9,and so on]}
2019-03-22T09:57:37.341300
Juliana
pythondev_help_Juliana_2019-03-22T09:57:37.341300
1,553,248,657.3413
14,442
pythondev
help
It puts all of the players into each team, it doesn't count them out <@Ashley>
2019-03-22T09:58:19.341900
Juliana
pythondev_help_Juliana_2019-03-22T09:58:19.341900
1,553,248,699.3419
14,443
pythondev
help
<@Juliana> try and read your loops in plain english
2019-03-22T10:02:26.342600
Carlo
pythondev_help_Carlo_2019-03-22T10:02:26.342600
1,553,248,946.3426
14,444
pythondev
help
it'll help you see the issue here
2019-03-22T10:02:34.342900
Carlo
pythondev_help_Carlo_2019-03-22T10:02:34.342900
1,553,248,954.3429
14,445
pythondev
help
"for each player in the sorted players, go through all the teams and their associated players, and add the player in"
2019-03-22T10:03:48.344100
Carlo
pythondev_help_Carlo_2019-03-22T10:03:48.344100
1,553,249,028.3441
14,446
pythondev
help
Then i would just need to adjust that ` for ` statement? but what am i missing? <@Carlo>
2019-03-22T10:06:34.345100
Juliana
pythondev_help_Juliana_2019-03-22T10:06:34.345100
1,553,249,194.3451
14,447
pythondev
help
think of what you're trying to do right now - you have a list of players, you have a couple of lists of teams
2019-03-22T10:07:11.345700
Carlo
pythondev_help_Carlo_2019-03-22T10:07:11.345700
1,553,249,231.3457
14,448
pythondev
help
right
2019-03-22T10:07:33.346300
Juliana
pythondev_help_Juliana_2019-03-22T10:07:33.346300
1,553,249,253.3463
14,449
pythondev
help
what <@Ashley> told you actually makes a lot of sense and would be my approach too
2019-03-22T10:08:26.347000
Carlo
pythondev_help_Carlo_2019-03-22T10:08:26.347000
1,553,249,306.347
14,450
pythondev
help
the OOP?
2019-03-22T10:08:48.347800
Juliana
pythondev_help_Juliana_2019-03-22T10:08:48.347800
1,553,249,328.3478
14,451
pythondev
help
nope second solution
2019-03-22T10:08:54.348100
Carlo
pythondev_help_Carlo_2019-03-22T10:08:54.348100
1,553,249,334.3481
14,452
pythondev
help
&gt; You're basically looking to add them in one by one, until you have no more. You don't need to worry about checking if a team has more than 6 members unless you have more players than 6*number of teams and the assignment says you can only have exactly 6 players
2019-03-22T10:09:00.348300
Carlo
pythondev_help_Carlo_2019-03-22T10:09:00.348300
1,553,249,340.3483
14,453
pythondev
help
for each player, assign them to the "next" team
2019-03-22T10:09:53.349100
Carlo
pythondev_help_Carlo_2019-03-22T10:09:53.349100
1,553,249,393.3491
14,454
pythondev
help
you basically want to be "dealing" players like cards until you don't have any to deal
2019-03-22T10:11:11.350400
Carlo
pythondev_help_Carlo_2019-03-22T10:11:11.350400
1,553,249,471.3504
14,455
pythondev
help
right i know that but i just dont know where or how that snipit of code would work in that fucntion
2019-03-22T10:11:48.351500
Juliana
pythondev_help_Juliana_2019-03-22T10:11:48.351500
1,553,249,508.3515
14,456
pythondev
help
right now you're iterating through every team and adding the player
2019-03-22T10:11:57.351900
Carlo
pythondev_help_Carlo_2019-03-22T10:11:57.351900
1,553,249,517.3519
14,457
pythondev
help
This is the situation that enumeration and mod logic are helpful
2019-03-22T10:12:03.352200
Clemmie
pythondev_help_Clemmie_2019-03-22T10:12:03.352200
1,553,249,523.3522
14,458
pythondev
help
instead of that, just push to one team
2019-03-22T10:12:13.352400
Carlo
pythondev_help_Carlo_2019-03-22T10:12:13.352400
1,553,249,533.3524
14,459
pythondev
help
<@Clemmie> just gave you a hint of how to keep track of the team you need to push to
2019-03-22T10:12:25.352900
Carlo
pythondev_help_Carlo_2019-03-22T10:12:25.352900
1,553,249,545.3529
14,460
pythondev
help
.enumerate()
2019-03-22T10:12:37.353300
Juliana
pythondev_help_Juliana_2019-03-22T10:12:37.353300
1,553,249,557.3533
14,461
pythondev
help
you want to loop through players with `count, player = enumerate(players)`
2019-03-22T10:12:39.353400
Clemmie
pythondev_help_Clemmie_2019-03-22T10:12:39.353400
1,553,249,559.3534
14,462
pythondev
help
since you know how many team you have `count % teams_count` (or something similar, not looking too close at the code) will give you which team to put a player on
2019-03-22T10:13:24.354400
Clemmie
pythondev_help_Clemmie_2019-03-22T10:13:24.354400
1,553,249,604.3544
14,463
pythondev
help
no `enumerate` wraps a list and gives you a tuple of `index, item` in a for loop
2019-03-22T10:14:09.355300
Clemmie
pythondev_help_Clemmie_2019-03-22T10:14:09.355300
1,553,249,649.3553
14,464
pythondev
help
so i need to take out that second line in the function and replace it or a new line under that
2019-03-22T10:14:52.356100
Juliana
pythondev_help_Juliana_2019-03-22T10:14:52.356100
1,553,249,692.3561
14,465
pythondev
help
(0 indexed, so take that into account)
2019-03-22T10:15:00.356400
Clemmie
pythondev_help_Clemmie_2019-03-22T10:15:00.356400
1,553,249,700.3564
14,466
pythondev
help
I would rewrite the function, not try to shoehorn new code into it
2019-03-22T10:15:12.357100
Clemmie
pythondev_help_Clemmie_2019-03-22T10:15:12.357100
1,553,249,712.3571
14,467
pythondev
help
you only need one for loop
2019-03-22T10:15:20.357400
Clemmie
pythondev_help_Clemmie_2019-03-22T10:15:20.357400
1,553,249,720.3574
14,468
pythondev
help
its the whole ```for team, players in teams_with_player_rosters.items(): players.append(player.get('name'))```
2019-03-22T10:15:34.357700
Carlo
pythondev_help_Carlo_2019-03-22T10:15:34.357700
1,553,249,734.3577
14,469
pythondev
help
that needs a bit of rethinking
2019-03-22T10:15:44.357900
Carlo
pythondev_help_Carlo_2019-03-22T10:15:44.357900
1,553,249,744.3579
14,470
pythondev
help
None
2019-03-22T10:16:26.358000
Juliana
pythondev_help_Juliana_2019-03-22T10:16:26.358000
1,553,249,786.358
14,471
pythondev
help
None
2019-03-22T10:16:34.358300
Juliana
pythondev_help_Juliana_2019-03-22T10:16:34.358300
1,553,249,794.3583
14,472
pythondev
help
Data is getting pulled from another file called constants.py so thats why i have to call on the 'name' <@Carlo> <@Clemmie>
2019-03-22T10:17:27.359500
Juliana
pythondev_help_Juliana_2019-03-22T10:17:27.359500
1,553,249,847.3595
14,473
pythondev
help
that's alright
2019-03-22T10:17:37.359700
Carlo
pythondev_help_Carlo_2019-03-22T10:17:37.359700
1,553,249,857.3597
14,474
pythondev
help
as <@Clemmie> and I said, that function needs a bit of work, and he basically gave you the logic you have to implement
2019-03-22T10:18:17.360600
Carlo
pythondev_help_Carlo_2019-03-22T10:18:17.360600
1,553,249,897.3606
14,475
pythondev
help
<@Juliana> I want to rewrite it for you, but I also want you to understand the concepts we are focusing on
2019-03-22T10:18:42.361400
Clemmie
pythondev_help_Clemmie_2019-03-22T10:18:42.361400
1,553,249,922.3614
14,476
pythondev
help
can't speak for him, but I won't write the code for you however, that part is where you learn
2019-03-22T10:18:43.361500
Carlo
pythondev_help_Carlo_2019-03-22T10:18:43.361500
1,553,249,923.3615
14,477
pythondev
help
we hit on the same feeling at the same time
2019-03-22T10:19:24.362300
Clemmie
pythondev_help_Clemmie_2019-03-22T10:19:24.362300
1,553,249,964.3623
14,478
pythondev
help
right i know thats why im paying alot for this class lol
2019-03-22T10:19:39.362800
Juliana
pythondev_help_Juliana_2019-03-22T10:19:39.362800
1,553,249,979.3628
14,479
pythondev
help
How about this - I will write you the snippet, but I want you to type back what it is actually doing
2019-03-22T10:20:09.363700
Clemmie
pythondev_help_Clemmie_2019-03-22T10:20:09.363700
1,553,250,009.3637
14,480
pythondev
help
that works
2019-03-22T10:20:27.364300
Juliana
pythondev_help_Juliana_2019-03-22T10:20:27.364300
1,553,250,027.3643
14,481
pythondev
help
ok, give me a minute
2019-03-22T10:20:38.364800
Clemmie
pythondev_help_Clemmie_2019-03-22T10:20:38.364800
1,553,250,038.3648
14,482
pythondev
help
Im just trying to think how that line of code would still call on the data i need
2019-03-22T10:21:05.365700
Juliana
pythondev_help_Juliana_2019-03-22T10:21:05.365700
1,553,250,065.3657
14,483
pythondev
help
which is 'name'
2019-03-22T10:21:25.366200
Juliana
pythondev_help_Juliana_2019-03-22T10:21:25.366200
1,553,250,085.3662
14,484
pythondev
help
I'm using pyodbc with the latest sql server odbc driver. When trying to commit a merge statement in sql server with cursor.executemany and fast_execute=True, pyodbc throws a MemoryError. That's literally the only feedback it gives. The weird thing is that it's only trying to load 25 rows. Any ideas? Running the latest pyodbc and the latest sql driver. Edit i found it works with fast_executemany = False...
2019-03-22T10:22:12.366600
Dawn
pythondev_help_Dawn_2019-03-22T10:22:12.366600
1,553,250,132.3666
14,485
pythondev
help
This will work for any number of teams
2019-03-22T10:25:27.366800
Clemmie
pythondev_help_Clemmie_2019-03-22T10:25:27.366800
1,553,250,327.3668
14,486
pythondev
help
ok hang on and let me explain it with comments
2019-03-22T10:27:26.367700
Juliana
pythondev_help_Juliana_2019-03-22T10:27:26.367700
1,553,250,446.3677
14,487
pythondev
help
```current_team = TEAMS[idx % len(TEAMS)] teams_with_player_rosters[current_team].append(player.get('name'))``` would be how I'd split it, purely for readability, but maybe that's just me
2019-03-22T10:27:37.367800
Carlo
pythondev_help_Carlo_2019-03-22T10:27:37.367800
1,553,250,457.3678
14,488
pythondev
help
Yeah, I like one liners - but that is more readable
2019-03-22T10:28:01.368000
Clemmie
pythondev_help_Clemmie_2019-03-22T10:28:01.368000
1,553,250,481.368
14,489
pythondev
help
I grew up on having to allocate everywhere, so If I can get away without a temp var I do
2019-03-22T10:28:35.368300
Clemmie
pythondev_help_Clemmie_2019-03-22T10:28:35.368300
1,553,250,515.3683
14,490
pythondev
help
hah makes sense!
2019-03-22T10:28:46.368600
Carlo
pythondev_help_Carlo_2019-03-22T10:28:46.368600
1,553,250,526.3686
14,491
pythondev
help
So why are devs so intense about only coding few lines and not separating it all out like i had?
2019-03-22T10:29:17.368800
Juliana
pythondev_help_Juliana_2019-03-22T10:29:17.368800
1,553,250,557.3688
14,492
pythondev
help
hmm because at some point you just get what you're reading and don't _need_ to split it out to understand
2019-03-22T10:29:46.369000
Carlo
pythondev_help_Carlo_2019-03-22T10:29:46.369000
1,553,250,586.369
14,493
pythondev
help
Some of it comes from historical language requirements, some about maintainability - it is all logically related to that operation, and I don’t need any of the values there for any other operations
2019-03-22T10:30:29.369300
Clemmie
pythondev_help_Clemmie_2019-03-22T10:30:29.369300
1,553,250,629.3693
14,494
pythondev
help
Do i need to return anything in that function?
2019-03-22T10:34:13.369900
Juliana
pythondev_help_Juliana_2019-03-22T10:34:13.369900
1,553,250,853.3699
14,495
pythondev
help
That is a very deep question
2019-03-22T10:34:45.370400
Clemmie
pythondev_help_Clemmie_2019-03-22T10:34:45.370400
1,553,250,885.3704
14,496
pythondev
help
For readability you should probably return teams_with_player_rosterss
2019-03-22T10:35:13.370800
Clemmie
pythondev_help_Clemmie_2019-03-22T10:35:13.370800
1,553,250,913.3708
14,497
pythondev
help
Strictly speaking, you don’t have to, but that is because dicts are mutable and how python passes parameters - fairly advanced stuff
2019-03-22T10:35:59.371000
Clemmie
pythondev_help_Clemmie_2019-03-22T10:35:59.371000
1,553,250,959.371
14,498
pythondev
help
everytime i run the file it has a syntax error at the end of line 2 inside the function
2019-03-22T10:36:42.371200
Juliana
pythondev_help_Juliana_2019-03-22T10:36:42.371200
1,553,251,002.3712
14,499
pythondev
help
that is surely possible - i typed it in textEdit. show me the error?
2019-03-22T10:37:06.371400
Clemmie
pythondev_help_Clemmie_2019-03-22T10:37:06.371400
1,553,251,026.3714
14,500
pythondev
help
nm - fixing it in the snippet
2019-03-22T10:37:34.371700
Clemmie
pythondev_help_Clemmie_2019-03-22T10:37:34.371700
1,553,251,054.3717
14,501
pythondev
help
None
2019-03-22T10:37:46.371900
Juliana
pythondev_help_Juliana_2019-03-22T10:37:46.371900
1,553,251,066.3719
14,502
pythondev
help
None
2019-03-22T10:38:11.372300
Juliana
pythondev_help_Juliana_2019-03-22T10:38:11.372300
1,553,251,091.3723
14,503
pythondev
help
hmm, can’t edit snippets.
2019-03-22T10:38:12.372700
Clemmie
pythondev_help_Clemmie_2019-03-22T10:38:12.372700
1,553,251,092.3727
14,504
pythondev
help
add a `]` before `.append`
2019-03-22T10:38:28.372900
Clemmie
pythondev_help_Clemmie_2019-03-22T10:38:28.372900
1,553,251,108.3729
14,505
pythondev
help
and also your return statment at the end
2019-03-22T10:38:54.373100
Clemmie
pythondev_help_Clemmie_2019-03-22T10:38:54.373100
1,553,251,134.3731
14,506
pythondev
help
So now when it runs it comes out to say 'None'
2019-03-22T10:41:03.373400
Juliana
pythondev_help_Juliana_2019-03-22T10:41:03.373400
1,553,251,263.3734
14,507
pythondev
help
when printed
2019-03-22T10:41:12.373600
Juliana
pythondev_help_Juliana_2019-03-22T10:41:12.373600
1,553,251,272.3736
14,508
pythondev
help
did you add the return?
2019-03-22T10:41:15.373800
Clemmie
pythondev_help_Clemmie_2019-03-22T10:41:15.373800
1,553,251,275.3738
14,509
pythondev
help
yeah
2019-03-22T10:41:25.374000
Juliana
pythondev_help_Juliana_2019-03-22T10:41:25.374000
1,553,251,285.374
14,510
pythondev
help
show please
2019-03-22T10:41:30.374200
Clemmie
pythondev_help_Clemmie_2019-03-22T10:41:30.374200
1,553,251,290.3742
14,511
pythondev
help
oh wait
2019-03-22T10:41:40.374400
Juliana
pythondev_help_Juliana_2019-03-22T10:41:40.374400
1,553,251,300.3744
14,512
pythondev
help
So now it is duplicating the 6 in each team
2019-03-22T10:42:32.374600
Juliana
pythondev_help_Juliana_2019-03-22T10:42:32.374600
1,553,251,352.3746
14,513
pythondev
help
you are right, I didn’t think the whole thing through completely - one sec
2019-03-22T10:43:14.374800
Clemmie
pythondev_help_Clemmie_2019-03-22T10:43:14.374800
1,553,251,394.3748
14,514
pythondev
help
Can you show the output
2019-03-22T10:45:47.375000
Clemmie
pythondev_help_Clemmie_2019-03-22T10:45:47.375000
1,553,251,547.375
14,515
pythondev
help
what is the best way to generate list like [[0, 30], [30, 60], [60, 90], [90, 120], [120, 150], [150, 180], [180, 210], [210, 240], [240, 270], [270, 300], [300, 330], [330, 360]] ? incremental of 30 ... in pyspark
2019-03-22T10:46:13.375400
Jena
pythondev_help_Jena_2019-03-22T10:46:13.375400
1,553,251,573.3754
14,516
pythondev
help
` {'Panthers': ['Karl Saygan', 'Les Clay', 'Herschel Krustofski', 'Matt Gill', 'Joe Kavalier', 'Eva Gordon', 'Karl Saygan', 'Les Clay', 'Herschel Krustofski', 'Matt Gill', 'Joe Kavalier', 'Eva Gordon'], 'Bandits': ['Bill Bon', 'Suzane Greenberg', 'Joe Smith', 'Sammy Adams', 'Sal Dali', 'Ben Finkelstein', 'Bill Bon', 'Suzane Greenberg', 'Joe Smith', 'Sammy Adams', 'Sal Dali', 'Ben Finkelstein'], 'Warriors': ['Phillip Helm', 'Jill Tanner', 'Diego Soto', 'Chloe Alaska', 'Arnold Willis', 'Kimmy Stein', 'Phillip Helm', 'Jill Tanner', 'Diego Soto', 'Chloe Alaska', 'Arnold Willis', 'Kimmy Stein']} `
2019-03-22T10:46:19.375500
Juliana
pythondev_help_Juliana_2019-03-22T10:46:19.375500
1,553,251,579.3755
14,517
pythondev
help
oh, ok, so the teams are broken down correctly, just duplicated.
2019-03-22T10:47:08.375700
Clemmie
pythondev_help_Clemmie_2019-03-22T10:47:08.375700
1,553,251,628.3757
14,518
pythondev
help
right <@Clemmie>
2019-03-22T10:47:37.375900
Juliana
pythondev_help_Juliana_2019-03-22T10:47:37.375900
1,553,251,657.3759
14,519
pythondev
help
Can you add a `print(len(sorted_players))` at the beginning of the method
2019-03-22T10:47:45.376100
Clemmie
pythondev_help_Clemmie_2019-03-22T10:47:45.376100
1,553,251,665.3761
14,520