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
but this worked for me ```for i in range(240): if df.loc[i,'SorD'] == 'S': df.loc[i,'N'] = 24 df.loc[i,'Size'] = 24 df.loc[i,'Space'] = 24 ```
2018-01-22T20:02:57.000294
Pennie
pythondev_help_Pennie_2018-01-22T20:02:57.000294
1,516,651,377.000294
30,524
pythondev
help
I had no problem with this
2018-01-22T20:03:01.000795
Pennie
pythondev_help_Pennie_2018-01-22T20:03:01.000795
1,516,651,381.000795
30,525
pythondev
help
also, the `a+1` and `b+1` things do nothing, you want `a+=1` and `b+=1` instead
2018-01-22T20:03:09.000215
Zack
pythondev_help_Zack_2018-01-22T20:03:09.000215
1,516,651,389.000215
30,526
pythondev
help
are you using pandas?
2018-01-22T20:03:20.000023
Floy
pythondev_help_Floy_2018-01-22T20:03:20.000023
1,516,651,400.000023
30,527
pythondev
help
yes ^^
2018-01-22T20:03:32.000298
Pennie
pythondev_help_Pennie_2018-01-22T20:03:32.000298
1,516,651,412.000298
30,528
pythondev
help
ok, so ignore what I said
2018-01-22T20:03:37.000681
Floy
pythondev_help_Floy_2018-01-22T20:03:37.000681
1,516,651,417.000681
30,529
pythondev
help
but I think my problem is
2018-01-22T20:03:53.000659
Pennie
pythondev_help_Pennie_2018-01-22T20:03:53.000659
1,516,651,433.000659
30,530
pythondev
help
that my first if statement is followed by and if statement?
2018-01-22T20:04:05.000685
Pennie
pythondev_help_Pennie_2018-01-22T20:04:05.000685
1,516,651,445.000685
30,531
pythondev
help
no, that won’t be it
2018-01-22T20:06:05.000469
Floy
pythondev_help_Floy_2018-01-22T20:06:05.000469
1,516,651,565.000469
30,532
pythondev
help
because you can definitely do that
2018-01-22T20:06:10.000076
Floy
pythondev_help_Floy_2018-01-22T20:06:10.000076
1,516,651,570.000076
30,533
pythondev
help
I would check the number of spaces in your indentation
2018-01-22T20:06:31.000620
Floy
pythondev_help_Floy_2018-01-22T20:06:31.000620
1,516,651,591.00062
30,534
pythondev
help
oh - the previous line is missing a closing paren
2018-01-22T20:07:31.000594
Zack
pythondev_help_Zack_2018-01-22T20:07:31.000594
1,516,651,651.000594
30,535
pythondev
help
really doesn’t need the one opening one I suppose
2018-01-22T20:07:53.000897
Zack
pythondev_help_Zack_2018-01-22T20:07:53.000897
1,516,651,673.000897
30,536
pythondev
help
I’m old, staying up till 2am isn’t much of an option anymore
2018-01-22T20:08:22.000081
Floy
pythondev_help_Floy_2018-01-22T20:08:22.000081
1,516,651,702.000081
30,537
pythondev
help
:smile:
2018-01-22T20:08:25.000619
Floy
pythondev_help_Floy_2018-01-22T20:08:25.000619
1,516,651,705.000619
30,538
pythondev
help
heh - I’m definitely getting too old for this. :stuck_out_tongue:
2018-01-22T20:08:55.000134
Zack
pythondev_help_Zack_2018-01-22T20:08:55.000134
1,516,651,735.000134
30,539
pythondev
help
:point_up:
2018-01-22T20:08:55.000799
Floy
pythondev_help_Floy_2018-01-22T20:08:55.000799
1,516,651,735.000799
30,540
pythondev
help
what’s the occasion for a late night?
2018-01-22T20:09:08.000085
Floy
pythondev_help_Floy_2018-01-22T20:09:08.000085
1,516,651,748.000085
30,541
pythondev
help
perfect almost xD new error
2018-01-22T20:09:32.000139
Pennie
pythondev_help_Pennie_2018-01-22T20:09:32.000139
1,516,651,772.000139
30,542
pythondev
help
name 'randint' is not defined
2018-01-22T20:09:46.000141
Pennie
pythondev_help_Pennie_2018-01-22T20:09:46.000141
1,516,651,786.000141
30,543
pythondev
help
should I put it also outside the loop?
2018-01-22T20:09:52.000477
Pennie
pythondev_help_Pennie_2018-01-22T20:09:52.000477
1,516,651,792.000477
30,544
pythondev
help
I though randint was a python function
2018-01-22T20:10:10.000026
Pennie
pythondev_help_Pennie_2018-01-22T20:10:10.000026
1,516,651,810.000026
30,545
pythondev
help
need a `from random import randint`
2018-01-22T20:10:13.000434
Zack
pythondev_help_Zack_2018-01-22T20:10:13.000434
1,516,651,813.000434
30,546
pythondev
help
it’s in a module you need to import
2018-01-22T20:10:23.000573
Zack
pythondev_help_Zack_2018-01-22T20:10:23.000573
1,516,651,823.000573
30,547
pythondev
help
thanks guys I am learning so much
2018-01-22T20:10:26.000081
Pennie
pythondev_help_Pennie_2018-01-22T20:10:26.000081
1,516,651,826.000081
30,548
pythondev
help
no problem. I’d recommend maybe taking a step back from pandas though and going through a pure python course, it might make it easier going
2018-01-22T20:10:55.000131
Zack
pythondev_help_Zack_2018-01-22T20:10:55.000131
1,516,651,855.000131
30,549
pythondev
help
because once you get the hang of the syntax, going to pandas will make getting the code easier
2018-01-22T20:11:24.000012
Floy
pythondev_help_Floy_2018-01-22T20:11:24.000012
1,516,651,884.000012
30,550
pythondev
help
I had python some while ago I am just getting back in it ^^coming from R
2018-01-22T20:11:33.000353
Pennie
pythondev_help_Pennie_2018-01-22T20:11:33.000353
1,516,651,893.000353
30,551
pythondev
help
coded in psychopy before ^^
2018-01-22T20:11:44.000466
Pennie
pythondev_help_Pennie_2018-01-22T20:11:44.000466
1,516,651,904.000466
30,552
pythondev
help
just trying to get some stuff done, which probably isn’t wise, but here I am anyway
2018-01-22T20:11:44.000874
Zack
pythondev_help_Zack_2018-01-22T20:11:44.000874
1,516,651,904.000874
30,553
pythondev
help
this is for my thesis ^^
2018-01-22T20:11:50.000573
Pennie
pythondev_help_Pennie_2018-01-22T20:11:50.000573
1,516,651,910.000573
30,554
pythondev
help
what’s the thesis?
2018-01-22T20:12:10.000577
Zack
pythondev_help_Zack_2018-01-22T20:12:10.000577
1,516,651,930.000577
30,555
pythondev
help
ok. if you’re comfortable in R, what drove the move to Python?
2018-01-22T20:12:18.000113
Floy
pythondev_help_Floy_2018-01-22T20:12:18.000113
1,516,651,938.000113
30,556
pythondev
help
:thumbsup:
2018-01-22T20:12:29.000190
Floy
pythondev_help_Floy_2018-01-22T20:12:29.000190
1,516,651,949.00019
30,557
pythondev
help
In neuroscience <@Zack> numerical cognition
2018-01-22T20:12:39.000805
Pennie
pythondev_help_Pennie_2018-01-22T20:12:39.000805
1,516,651,959.000805
30,558
pythondev
help
because python is more used
2018-01-22T20:12:51.000185
Pennie
pythondev_help_Pennie_2018-01-22T20:12:51.000185
1,516,651,971.000185
30,559
pythondev
help
also for the ML purposes later on
2018-01-22T20:12:59.000232
Pennie
pythondev_help_Pennie_2018-01-22T20:12:59.000232
1,516,651,979.000232
30,560
pythondev
help
sounds interesting
2018-01-22T20:13:29.000178
Zack
pythondev_help_Zack_2018-01-22T20:13:29.000178
1,516,652,009.000178
30,561
pythondev
help
MM my loop seems infinite
2018-01-22T20:13:54.000236
Pennie
pythondev_help_Pennie_2018-01-22T20:13:54.000236
1,516,652,034.000236
30,562
pythondev
help
your logic in the while dictates that
2018-01-22T20:14:16.000457
Floy
pythondev_help_Floy_2018-01-22T20:14:16.000457
1,516,652,056.000457
30,563
pythondev
help
because in one condition, `a` is incremented but not `b`
2018-01-22T20:14:31.000365
Floy
pythondev_help_Floy_2018-01-22T20:14:31.000365
1,516,652,071.000365
30,564
pythondev
help
and then vice versa
2018-01-22T20:14:37.000036
Floy
pythondev_help_Floy_2018-01-22T20:14:37.000036
1,516,652,077.000036
30,565
pythondev
help
so, seems like there’s no condition where `a` and `b` are identical
2018-01-22T20:14:55.000045
Floy
pythondev_help_Floy_2018-01-22T20:14:55.000045
1,516,652,095.000045
30,566
pythondev
help
I want the loop to end when they both are equal to 2
2018-01-22T20:14:55.000831
Pennie
pythondev_help_Pennie_2018-01-22T20:14:55.000831
1,516,652,095.000831
30,567
pythondev
help
is there a case where `a` can be 3 and `b` is 1?
2018-01-22T20:15:17.000582
Floy
pythondev_help_Floy_2018-01-22T20:15:17.000582
1,516,652,117.000582
30,568
pythondev
help
try a `print('random_number = {}\ta = {}\tb = {}.format(rn, a, b))` above `rn == 1`
2018-01-22T20:16:58.000106
Floy
pythondev_help_Floy_2018-01-22T20:16:58.000106
1,516,652,218.000106
30,569
pythondev
help
assuming you’re using python3
2018-01-22T20:17:19.000063
Floy
pythondev_help_Floy_2018-01-22T20:17:19.000063
1,516,652,239.000063
30,570
pythondev
help
yes I am
2018-01-22T20:17:34.000813
Pennie
pythondev_help_Pennie_2018-01-22T20:17:34.000813
1,516,652,254.000813
30,571
pythondev
help
what does it do?
2018-01-22T20:17:38.000369
Pennie
pythondev_help_Pennie_2018-01-22T20:17:38.000369
1,516,652,258.000369
30,572
pythondev
help
prints output to console
2018-01-22T20:18:04.000636
Floy
pythondev_help_Floy_2018-01-22T20:18:04.000636
1,516,652,284.000636
30,573
pythondev
help
same intend as the if's?
2018-01-22T20:18:10.000787
Pennie
pythondev_help_Pennie_2018-01-22T20:18:10.000787
1,516,652,290.000787
30,574
pythondev
help
in this case, `rn`, `a` and `b`
2018-01-22T20:18:13.000534
Floy
pythondev_help_Floy_2018-01-22T20:18:13.000534
1,516,652,293.000534
30,575
pythondev
help
so you can see what the values of all three variables in the course of the loop
2018-01-22T20:18:34.000376
Floy
pythondev_help_Floy_2018-01-22T20:18:34.000376
1,516,652,314.000376
30,576
pythondev
help
and identify why the while conditional is not being met
2018-01-22T20:18:50.000034
Floy
pythondev_help_Floy_2018-01-22T20:18:50.000034
1,516,652,330.000034
30,577
pythondev
help
doens't print(rn) print(a) print(b) suffce?
2018-01-22T20:18:54.000355
Pennie
pythondev_help_Pennie_2018-01-22T20:18:54.000355
1,516,652,334.000355
30,578
pythondev
help
yes. I just did it on the same line with tab characters in between
2018-01-22T20:19:27.000367
Floy
pythondev_help_Floy_2018-01-22T20:19:27.000367
1,516,652,367.000367
30,579
pythondev
help
makes it easier to detect changes when scrolling through output
2018-01-22T20:19:40.000372
Floy
pythondev_help_Floy_2018-01-22T20:19:40.000372
1,516,652,380.000372
30,580
pythondev
help
interesting
2018-01-22T20:20:05.000816
Pennie
pythondev_help_Pennie_2018-01-22T20:20:05.000816
1,516,652,405.000816
30,581
pythondev
help
```a=0 b=0 while a !=2 and b !=2: rn= randint(1, 2) if df.loc[i,'SorD'] == 'D': print('random_number = {}.format(rn)) if rn == 1 and a &lt; 3: df.loc[i,'N'] = 13 df.loc[i,'Size'] = 24 df.loc[i,'Space'] = 13 a+=1 print('random_number = {}...
2018-01-22T20:20:11.000316
Pennie
pythondev_help_Pennie_2018-01-22T20:20:11.000316
1,516,652,411.000316
30,582
pythondev
help
```EOL while scanning string literal ```
2018-01-22T20:20:19.000157
Pennie
pythondev_help_Pennie_2018-01-22T20:20:19.000157
1,516,652,419.000157
30,583
pythondev
help
you need a single quote after `{}'`
2018-01-22T20:20:37.000173
Floy
pythondev_help_Floy_2018-01-22T20:20:37.000173
1,516,652,437.000173
30,584
pythondev
help
oups
2018-01-22T20:20:42.000426
Pennie
pythondev_help_Pennie_2018-01-22T20:20:42.000426
1,516,652,442.000426
30,585
pythondev
help
close the string
2018-01-22T20:20:43.000052
Floy
pythondev_help_Floy_2018-01-22T20:20:43.000052
1,516,652,443.000052
30,586
pythondev
help
I would also print out the value of `a` and `b`
2018-01-22T20:21:03.000769
Floy
pythondev_help_Floy_2018-01-22T20:21:03.000769
1,516,652,463.000769
30,587
pythondev
help
so I got the same
2018-01-22T20:22:17.000218
Pennie
pythondev_help_Pennie_2018-01-22T20:22:17.000218
1,516,652,537.000218
30,588
pythondev
help
I have got the impression the loop does not start
2018-01-22T20:22:29.000779
Pennie
pythondev_help_Pennie_2018-01-22T20:22:29.000779
1,516,652,549.000779
30,589
pythondev
help
got the EOL error, or an infinite loop not printing anything out?
2018-01-22T20:23:12.000432
Zack
pythondev_help_Zack_2018-01-22T20:23:12.000432
1,516,652,592.000432
30,590
pythondev
help
infinite loop not printing
2018-01-22T20:23:27.000799
Pennie
pythondev_help_Pennie_2018-01-22T20:23:27.000799
1,516,652,607.000799
30,591
pythondev
help
:confused:
2018-01-22T20:23:29.000842
Pennie
pythondev_help_Pennie_2018-01-22T20:23:29.000842
1,516,652,609.000842
30,592
pythondev
help
sounds like that’s the issue with the `if df.loc` call
2018-01-22T20:24:01.000179
Floy
pythondev_help_Floy_2018-01-22T20:24:01.000179
1,516,652,641.000179
30,593
pythondev
help
maybe as an `else` to `if df.loc[i,'SorD'] == 'D':`, print out a message?
2018-01-22T20:24:02.000447
Zack
pythondev_help_Zack_2018-01-22T20:24:02.000447
1,516,652,642.000447
30,594
pythondev
help
well it worked in my other loop
2018-01-22T20:24:44.000466
Pennie
pythondev_help_Pennie_2018-01-22T20:24:44.000466
1,516,652,684.000466
30,595
pythondev
help
it’s probably best to avoid screenshots and share the text by using the little plus button to the left of the text input box and selecting “code or text snippet”
2018-01-22T20:24:44.000629
Zack
pythondev_help_Zack_2018-01-22T20:24:44.000629
1,516,652,684.000629
30,596
pythondev
help
for security issues?
2018-01-22T20:25:08.000640
Pennie
pythondev_help_Pennie_2018-01-22T20:25:08.000640
1,516,652,708.00064
30,597
pythondev
help
just easier to read, less data to download for everybody
2018-01-22T20:25:22.000352
Zack
pythondev_help_Zack_2018-01-22T20:25:22.000352
1,516,652,722.000352
30,598
pythondev
help
```for i in range(240): if df.loc[i,'SorD'] == 'S': df.loc[i,'N'] = 24 df.loc[i,'Size'] = 24 df.loc[i,'Space'] = 24 print(df) a=0 b=0 print(a) while a !=2 and b !=2: rn= randint(1, 2) if df.loc[i,'SorD'] == 'D': print('random_number = {}'.format(rn)) if rn == 1 and...
2018-01-22T20:25:36.000365
Pennie
pythondev_help_Pennie_2018-01-22T20:25:36.000365
1,516,652,736.000365
30,599
pythondev
help
see my first loop is working
2018-01-22T20:25:42.000180
Pennie
pythondev_help_Pennie_2018-01-22T20:25:42.000180
1,516,652,742.00018
30,600
pythondev
help
```In [11]: while a != 2 and b != 2: ...: rn = randint(1, 2) ...: print(rn) ...: if rn == 1 and a &lt; 3: ...: print(f'Rn == 1 and a == {a}') ...: a += 1 ...: if rn == 2 and b &lt; 3: ...: print (f'Rn == 2 and b == {b}') ...: b += 1 ......
2018-01-22T20:25:55.000122
Floy
pythondev_help_Floy_2018-01-22T20:25:55.000122
1,516,652,755.000122
30,601
pythondev
help
and I am using if df.loc
2018-01-22T20:25:58.000516
Pennie
pythondev_help_Pennie_2018-01-22T20:25:58.000516
1,516,652,758.000516
30,602
pythondev
help
ah, you aren’t iterating on i anymore, <@Floy> kinda touched on that before
2018-01-22T20:26:01.000185
Zack
pythondev_help_Zack_2018-01-22T20:26:01.000185
1,516,652,761.000185
30,603
pythondev
help
i is just always 240 in your second loop
2018-01-22T20:26:15.000766
Zack
pythondev_help_Zack_2018-01-22T20:26:15.000766
1,516,652,775.000766
30,604
pythondev
help
:point_up:
2018-01-22T20:26:31.000639
Floy
pythondev_help_Floy_2018-01-22T20:26:31.000639
1,516,652,791.000639
30,605
pythondev
help
or 239 I suppose
2018-01-22T20:26:33.000665
Zack
pythondev_help_Zack_2018-01-22T20:26:33.000665
1,516,652,793.000665
30,606
pythondev
help
well my second loop is independent no?
2018-01-22T20:26:54.000413
Pennie
pythondev_help_Pennie_2018-01-22T20:26:54.000413
1,516,652,814.000413
30,607
pythondev
help
yes
2018-01-22T20:26:59.000441
Floy
pythondev_help_Floy_2018-01-22T20:26:59.000441
1,516,652,819.000441
30,608
pythondev
help
but its always dependent on `i` from the outside of the loop
2018-01-22T20:27:13.000042
Floy
pythondev_help_Floy_2018-01-22T20:27:13.000042
1,516,652,833.000042
30,609
pythondev
help
I see
2018-01-22T20:28:00.000486
Pennie
pythondev_help_Pennie_2018-01-22T20:28:00.000486
1,516,652,880.000486
30,610
pythondev
help
the I
2018-01-22T20:28:03.000198
Pennie
pythondev_help_Pennie_2018-01-22T20:28:03.000198
1,516,652,883.000198
30,611
pythondev
help
I’d really go back to the suggestion earlier to step back from pandas and take a python course. you are going to struggle mightily without a good basis in the fundamentals
2018-01-22T20:28:04.000222
Zack
pythondev_help_Zack_2018-01-22T20:28:04.000222
1,516,652,884.000222
30,612
pythondev
help
i on df/loc
2018-01-22T20:28:06.000504
Pennie
pythondev_help_Pennie_2018-01-22T20:28:06.000504
1,516,652,886.000504
30,613
pythondev
help
yeah I was planning to do that but I am taken by the time so when I finish this last issue I am done and I was thinking of doing that and going through datacamp
2018-01-22T20:28:52.000045
Pennie
pythondev_help_Pennie_2018-01-22T20:28:52.000045
1,516,652,932.000045
30,614
pythondev
help
this is a common thing with frameworks like this, I did the same thing for years, just tried to plow through through and past the underlying bits to use the frameworks, but I struggled until I stepped back to learn the underlying language
2018-01-22T20:28:56.000115
Zack
pythondev_help_Zack_2018-01-22T20:28:56.000115
1,516,652,936.000115
30,615
pythondev
help
cool, yeah that sounds like a good idea
2018-01-22T20:29:22.000385
Zack
pythondev_help_Zack_2018-01-22T20:29:22.000385
1,516,652,962.000385
30,616
pythondev
help
how can I solve that 'i' problem?
2018-01-22T20:30:10.000713
Pennie
pythondev_help_Pennie_2018-01-22T20:30:10.000713
1,516,653,010.000713
30,617
pythondev
help
any idea?
2018-01-22T20:30:12.000606
Pennie
pythondev_help_Pennie_2018-01-22T20:30:12.000606
1,516,653,012.000606
30,618
pythondev
help
you need to iterate over i again I guess, although with the while loop that’s a little strange. it’s sort of hard to really know the right answer without understanding the application
2018-01-22T20:31:30.000193
Zack
pythondev_help_Zack_2018-01-22T20:31:30.000193
1,516,653,090.000193
30,619
pythondev
help
well you see I want to fill columns N Size and Space when the column SorD (standard or deviant ) is equal to D
2018-01-22T20:34:37.000502
Pennie
pythondev_help_Pennie_2018-01-22T20:34:37.000502
1,516,653,277.000502
30,620
pythondev
help
however the same row can only appear twice
2018-01-22T20:35:08.000380
Pennie
pythondev_help_Pennie_2018-01-22T20:35:08.000380
1,516,653,308.00038
30,621
pythondev
help
that's why a &lt; 3
2018-01-22T20:35:23.000268
Pennie
pythondev_help_Pennie_2018-01-22T20:35:23.000268
1,516,653,323.000268
30,622
pythondev
help
and b &lt; 3
2018-01-22T20:35:26.000474
Pennie
pythondev_help_Pennie_2018-01-22T20:35:26.000474
1,516,653,326.000474
30,623