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
So the only thing I can get is 762, 64 for X and 762,1 for y
2017-10-17T08:29:18.000043
Christin
pythondev_help_Christin_2017-10-17T08:29:18.000043
1,508,228,958.000043
97,103
pythondev
help
Heres how Im making the data
2017-10-17T08:30:18.000539
Christin
pythondev_help_Christin_2017-10-17T08:30:18.000539
1,508,229,018.000539
97,104
pythondev
help
```def preprocessing(file_name): # Generate numpy array from csv file csv = np.genfromtxt (file_name, delimiter=",") # Initialize matrices X = [] y = [] # Filter data for i in range(len(csv)): if csv[i][64] == 8 or csv[i][64] == 9: X.append(csv[i][:64]) y.append([csv[i][64]]) return np.array(X), np.array(y)```
2017-10-17T08:30:22.000034
Christin
pythondev_help_Christin_2017-10-17T08:30:22.000034
1,508,229,022.000034
97,105
pythondev
help
Yes, you’re not constructing them with the same size.
2017-10-17T08:32:11.000038
Patty
pythondev_help_Patty_2017-10-17T08:32:11.000038
1,508,229,131.000038
97,106
pythondev
help
Think about it this way: how would you even plot that?
2017-10-17T08:32:15.000009
Patty
pythondev_help_Patty_2017-10-17T08:32:15.000009
1,508,229,135.000009
97,107
pythondev
help
I agree I can't plot that
2017-10-17T08:33:11.000011
Christin
pythondev_help_Christin_2017-10-17T08:33:11.000011
1,508,229,191.000011
97,108
pythondev
help
So I guess I have to add columns? columns of zeroes?
2017-10-17T08:33:23.000190
Christin
pythondev_help_Christin_2017-10-17T08:33:23.000190
1,508,229,203.00019
97,109
pythondev
help
I don’t know what value to give them as I don’t know what the data is or what you’re trying to accomplish
2017-10-17T08:34:27.000170
Patty
pythondev_help_Patty_2017-10-17T08:34:27.000170
1,508,229,267.00017
97,110
pythondev
help
Im just trying to make a binary classifier (8 or 9 instead of 1 -1) using linear regression
2017-10-17T08:34:54.000449
Christin
pythondev_help_Christin_2017-10-17T08:34:54.000449
1,508,229,294.000449
97,111
pythondev
help
I just have numbers as data
2017-10-17T08:35:02.000193
Christin
pythondev_help_Christin_2017-10-17T08:35:02.000193
1,508,229,302.000193
97,112
pythondev
help
randomly generated
2017-10-17T08:35:10.000444
Christin
pythondev_help_Christin_2017-10-17T08:35:10.000444
1,508,229,310.000444
97,113
pythondev
help
I have 65 columns, the first 64 are the features and the last one is the output (8 or 9)
2017-10-17T08:36:22.000423
Christin
pythondev_help_Christin_2017-10-17T08:36:22.000423
1,508,229,382.000423
97,114
pythondev
help
Why scatterplot?
2017-10-17T08:48:42.000353
Scot
pythondev_help_Scot_2017-10-17T08:48:42.000353
1,508,230,122.000353
97,115
pythondev
help
I was just splitting my training sets incorrectly, everything worked fine with i used splitting with sklearn <@Patty> <@Scot>
2017-10-17T10:12:44.000641
Christin
pythondev_help_Christin_2017-10-17T10:12:44.000641
1,508,235,164.000641
97,116
pythondev
help
Thank you!
2017-10-17T10:12:56.000713
Christin
pythondev_help_Christin_2017-10-17T10:12:56.000713
1,508,235,176.000713
97,117
pythondev
help
hey is it possible to pass a variable within a dictionary ?
2017-10-17T11:05:42.000026
Burma
pythondev_help_Burma_2017-10-17T11:05:42.000026
1,508,238,342.000026
97,118
pythondev
help
not sure what you mean, but you can pass a dictionary
2017-10-17T11:09:02.000375
Sirena
pythondev_help_Sirena_2017-10-17T11:09:02.000375
1,508,238,542.000375
97,119
pythondev
help
for example taking raw input and passing in to the value of a dictionary
2017-10-17T11:09:36.000243
Burma
pythondev_help_Burma_2017-10-17T11:09:36.000243
1,508,238,576.000243
97,120
pythondev
help
```adict = {} myresult = myfunc(adict)``` is valid
2017-10-17T11:09:37.000048
Sirena
pythondev_help_Sirena_2017-10-17T11:09:37.000048
1,508,238,577.000048
97,121
pythondev
help
```user = raw_input('please enter username: ') passw = raw_input('please enter password: ') payload = {"username": 'user', "password": 'pass', "Content-Type":"application/json", }```
2017-10-17T11:10:31.000806
Burma
pythondev_help_Burma_2017-10-17T11:10:31.000806
1,508,238,631.000806
97,122
pythondev
help
if you put `'` you create the string `user` but if you don't put them you reference the variable user
2017-10-17T11:11:20.000214
Ciera
pythondev_help_Ciera_2017-10-17T11:11:20.000214
1,508,238,680.000214
97,123
pythondev
help
yah, you want the vars, not the strings, so remove the quotes around the varnames
2017-10-17T11:12:30.000087
Sirena
pythondev_help_Sirena_2017-10-17T11:12:30.000087
1,508,238,750.000087
97,124
pythondev
help
Thanks for that I'll give it a try
2017-10-17T11:14:06.000461
Burma
pythondev_help_Burma_2017-10-17T11:14:06.000461
1,508,238,846.000461
97,125
pythondev
help
Hey folks. I'm a relative noob, but I've been doing some self learning for a while and I'm looking to break into a technical role. I'm talking with a person about a position that requires "strong Python and SQL skills". I'm most experienced with Python, but on the main project I worked on that would have required SQL (a flask web app) , I ended up using SQLAlchemy instead of writing SQL statements. I have a basic understanding of SQL though, and could figure out more complex queries with some extra time.
2017-10-17T11:40:30.000580
Kenny
pythondev_help_Kenny_2017-10-17T11:40:30.000580
1,508,240,430.00058
97,126
pythondev
help
Say they see my resume, decide to call me, and ask about my SQL skills. Would it be reasonable for me to say something like, "Well, I have a basic foundation in SQL, but perhaps to handle some more complex queries I'd set up and use SQLAlchemy"? Or would I get laughed off the phone?
2017-10-17T11:40:38.000703
Kenny
pythondev_help_Kenny_2017-10-17T11:40:38.000703
1,508,240,438.000703
97,127
pythondev
help
I wouldn't mention ORM until they ask
2017-10-17T11:42:10.000133
Suellen
pythondev_help_Suellen_2017-10-17T11:42:10.000133
1,508,240,530.000133
97,128
pythondev
help
actually don't tell them anything and only answer questions they ask you, that's a safe bet
2017-10-17T11:42:32.000524
Suellen
pythondev_help_Suellen_2017-10-17T11:42:32.000524
1,508,240,552.000524
97,129
pythondev
help
did you use sqlalchemy orm or the core?
2017-10-17T11:45:01.000047
Johana
pythondev_help_Johana_2017-10-17T11:45:01.000047
1,508,240,701.000047
97,130
pythondev
help
orm
2017-10-17T11:47:12.000198
Kenny
pythondev_help_Kenny_2017-10-17T11:47:12.000198
1,508,240,832.000198
97,131
pythondev
help
start learning the core. it will not be that hard of a jump knowing the ORM. the ORM is built on the core which at its heart is a Domain Specific Language (DSL) for SQL that is written in python. The syntax is really similar to what SQL statements look like. When you feel comfortable writing SQL core queries then you can answer confidently that maybe you don’t have a lot of experience writing raw sql b/c you like to use tools that take care of parameter binding and reduce risks of sql injection. You can also say with confidence you understand what makes up SQL and don’t think it would be difficult to learn since you know sqlalchemy core and orm.
2017-10-17T11:57:04.000752
Johana
pythondev_help_Johana_2017-10-17T11:57:04.000752
1,508,241,424.000752
97,132
pythondev
help
and to add a nice resource to practice …
2017-10-17T11:58:33.000107
Winnifred
pythondev_help_Winnifred_2017-10-17T11:58:33.000107
1,508,241,513.000107
97,133
pythondev
help
<http://sqlzoo.net/>
2017-10-17T11:58:35.000099
Winnifred
pythondev_help_Winnifred_2017-10-17T11:58:35.000099
1,508,241,515.000099
97,134
pythondev
help
SQLAlchemy is a very useful abstraction layer on top of the database. I’m sort of the opposite. I came into SQLAlchemy from the database world so I had already nearly written applications in raw SQL. That’s one of the reasons I found Python. I needed more power!
2017-10-17T11:59:23.000940
Johana
pythondev_help_Johana_2017-10-17T11:59:23.000940
1,508,241,563.00094
97,135
pythondev
help
you can also dump the sqlalchemy queries and study them.
2017-10-17T11:59:55.000340
Johana
pythondev_help_Johana_2017-10-17T11:59:55.000340
1,508,241,595.00034
97,136
pythondev
help
i gotz all sorts of sqlalchemy tricks in here: <https://github.com/openstax/biglearn-sparfa-server/blob/master/sparfa_server/db.py>
2017-10-17T12:01:24.000555
Johana
pythondev_help_Johana_2017-10-17T12:01:24.000555
1,508,241,684.000555
97,137
pythondev
help
I’ve done plenty of interviews where i may not have been an expert on many parts of the job but if i was able to display with confidence my capability to adapt and learn then that made all the difference.
2017-10-17T12:02:37.000620
Johana
pythondev_help_Johana_2017-10-17T12:02:37.000620
1,508,241,757.00062
97,138
pythondev
help
Awesome! Thanks <@Johana> for those ideas and <@Winnifred> for that resource.
2017-10-17T12:03:02.000215
Kenny
pythondev_help_Kenny_2017-10-17T12:03:02.000215
1,508,241,782.000215
97,139
pythondev
help
Yeah, that's what I'm banking on here. I have a foundation to work from at least, but depending on how long it takes from resume submission to phone interview, I just wanted to have _something_ to say
2017-10-17T12:04:02.000097
Kenny
pythondev_help_Kenny_2017-10-17T12:04:02.000097
1,508,241,842.000097
97,140
pythondev
help
yea, the safe answer is typically, “i like to use tools that take care of parameter binding and reduce risks of sql injection, like sqlalchemy which i’ve done …. yada yada .”
2017-10-17T12:07:30.000183
Johana
pythondev_help_Johana_2017-10-17T12:07:30.000183
1,508,242,050.000183
97,141
pythondev
help
dbapi? :stuck_out_tongue:
2017-10-17T12:07:47.000754
Suellen
pythondev_help_Suellen_2017-10-17T12:07:47.000754
1,508,242,067.000754
97,142
pythondev
help
sqlalchemy is a cool toolkit as it doesn’t hide too much of the database away. in other ecosystems a lot of devs don’t even know what the db schema looks like.
2017-10-17T12:12:01.000419
Johana
pythondev_help_Johana_2017-10-17T12:12:01.000419
1,508,242,321.000419
97,143
pythondev
help
cough* .NET
2017-10-17T12:12:39.000031
Johana
pythondev_help_Johana_2017-10-17T12:12:39.000031
1,508,242,359.000031
97,144
pythondev
help
h i b e r n a t e
2017-10-17T12:12:55.000211
Suellen
pythondev_help_Suellen_2017-10-17T12:12:55.000211
1,508,242,375.000211
97,145
pythondev
help
I love SQLA for this. Once I saw that m2m tables are not abstracted away I fell for Alchemy hard..
2017-10-17T12:13:40.000358
Suellen
pythondev_help_Suellen_2017-10-17T12:13:40.000358
1,508,242,420.000358
97,146
pythondev
help
yea, when i was instantly talking to the database and being productive i was sold. i gotta admit though it changes your thinking. when you come strictly from the db world you think about data as sets. You don’t think about working at the individual row level and iterating. Then when you get into programming it flips your mindset.
2017-10-17T12:15:20.000320
Johana
pythondev_help_Johana_2017-10-17T12:15:20.000320
1,508,242,520.00032
97,147
pythondev
help
the last thing you want is a cursor b/c it’s slow.
2017-10-17T12:16:16.000007
Johana
pythondev_help_Johana_2017-10-17T12:16:16.000007
1,508,242,576.000007
97,148
pythondev
help
<@Kenny> You could also review some SQL interview questions and do some SQL problems on Hacker Rank or something. It's unlikely anything will get much deeper than what you could get out of playing around with that stuff for a bit
2017-10-17T12:22:24.000243
Mallie
pythondev_help_Mallie_2017-10-17T12:22:24.000243
1,508,242,944.000243
97,149
pythondev
help
That may not change your self-assessment of SQL skillz, nor should it, but chances are they will ask a handful of things that are easily covered by those sorts of resources
2017-10-17T12:23:03.000683
Mallie
pythondev_help_Mallie_2017-10-17T12:23:03.000683
1,508,242,983.000683
97,150
pythondev
help
I've yet to use SQL Alchemy. Is an ORM really that much better than just writing SQL?
2017-10-17T13:55:07.000147
Meghan
pythondev_help_Meghan_2017-10-17T13:55:07.000147
1,508,248,507.000147
97,151
pythondev
help
for about 80-90% of the stuff you do, yeah
2017-10-17T13:55:38.000094
Meg
pythondev_help_Meg_2017-10-17T13:55:38.000094
1,508,248,538.000094
97,152
pythondev
help
but there are cases where raw sql is better
2017-10-17T13:55:47.000559
Meg
pythondev_help_Meg_2017-10-17T13:55:47.000559
1,508,248,547.000559
97,153
pythondev
help
especially with optimized queries and such. in addition, some ORMs can create lots of duplicate queries during the compilation process
2017-10-17T13:56:15.000460
Meg
pythondev_help_Meg_2017-10-17T13:56:15.000460
1,508,248,575.00046
97,154
pythondev
help
What is the advantage of it?
2017-10-17T13:57:54.000282
Meghan
pythondev_help_Meghan_2017-10-17T13:57:54.000282
1,508,248,674.000282
97,155
pythondev
help
ease of use
2017-10-17T13:58:07.000255
Meg
pythondev_help_Meg_2017-10-17T13:58:07.000255
1,508,248,687.000255
97,156
pythondev
help
makes quite a few things easier when executing queries
2017-10-17T13:58:41.000073
Meg
pythondev_help_Meg_2017-10-17T13:58:41.000073
1,508,248,721.000073
97,157
pythondev
help
Interesting. May have to give it a try some time. Since we've switched to DreamFactory I'm usually just calling a stored procedure through a rest api.
2017-10-17T13:59:32.000556
Meghan
pythondev_help_Meghan_2017-10-17T13:59:32.000556
1,508,248,772.000556
97,158
pythondev
help
then you gotta write that query…
2017-10-17T14:00:02.000249
Meg
pythondev_help_Meg_2017-10-17T14:00:02.000249
1,508,248,802.000249
97,159
pythondev
help
Yes. Most of them are easy though.
2017-10-17T14:00:22.000089
Meghan
pythondev_help_Meghan_2017-10-17T14:00:22.000089
1,508,248,822.000089
97,160
pythondev
help
I mean, I wouldn’t want to write this query out by hand
2017-10-17T14:00:44.000651
Meg
pythondev_help_Meg_2017-10-17T14:00:44.000651
1,508,248,844.000651
97,161
pythondev
help
Most of our data isn't all that relational. Lots of small projects with hundreds of thousands of records, but relatively flat.
2017-10-17T14:00:56.000431
Meghan
pythondev_help_Meghan_2017-10-17T14:00:56.000431
1,508,248,856.000431
97,162
pythondev
help
Haha, nah, no interest in writing that.
2017-10-17T14:01:24.000503
Meghan
pythondev_help_Meghan_2017-10-17T14:01:24.000503
1,508,248,884.000503
97,163
pythondev
help
with that, its basically fifteen lines in Django ORM,
2017-10-17T14:01:57.000432
Meg
pythondev_help_Meg_2017-10-17T14:01:57.000432
1,508,248,917.000432
97,164
pythondev
help
how many records is that ?
2017-10-17T14:02:06.000284
Winnifred
pythondev_help_Winnifred_2017-10-17T14:02:06.000284
1,508,248,926.000284
97,165
pythondev
help
me or <@Meghan>?
2017-10-17T14:02:34.000014
Meg
pythondev_help_Meg_2017-10-17T14:02:34.000014
1,508,248,954.000014
97,166
pythondev
help
Sorry, you, should have specified :slightly_smiling_face:
2017-10-17T14:03:05.000590
Winnifred
pythondev_help_Winnifred_2017-10-17T14:03:05.000590
1,508,248,985.00059
97,167
pythondev
help
hmm, small database but with plenty of tables
2017-10-17T14:03:26.000083
Meg
pythondev_help_Meg_2017-10-17T14:03:26.000083
1,508,249,006.000083
97,168
pythondev
help
so, for this particular query, it aggregates over about 8k rows
2017-10-17T14:03:38.000471
Meg
pythondev_help_Meg_2017-10-17T14:03:38.000471
1,508,249,018.000471
97,169
pythondev
help
ah, gotcha
2017-10-17T14:04:35.000083
Winnifred
pythondev_help_Winnifred_2017-10-17T14:04:35.000083
1,508,249,075.000083
97,170
pythondev
help
so I basically made a model manager in django
2017-10-17T14:04:59.000296
Meg
pythondev_help_Meg_2017-10-17T14:04:59.000296
1,508,249,099.000296
97,171
pythondev
help
created a metrics method to aggregate
2017-10-17T14:05:08.000207
Meg
pythondev_help_Meg_2017-10-17T14:05:08.000207
1,508,249,108.000207
97,172
pythondev
help
and I pass in extra fields in a dict with the evaluation to occur
2017-10-17T14:05:28.000464
Meg
pythondev_help_Meg_2017-10-17T14:05:28.000464
1,508,249,128.000464
97,173
pythondev
help
i’d like to write that just to reminisce on my T-SQL and PL/SQL days
2017-10-17T14:07:03.000094
Patty
pythondev_help_Patty_2017-10-17T14:07:03.000094
1,508,249,223.000094
97,174
pythondev
help
masochist :smile:
2017-10-17T14:07:15.000234
Meg
pythondev_help_Meg_2017-10-17T14:07:15.000234
1,508,249,235.000234
97,175
pythondev
help
Should the ORM create the schema or is it better to adapt to an existing one?
2017-10-17T14:09:01.000662
Meghan
pythondev_help_Meghan_2017-10-17T14:09:01.000662
1,508,249,341.000662
97,176
pythondev
help
you can do both
2017-10-17T14:09:23.000466
Meg
pythondev_help_Meg_2017-10-17T14:09:23.000466
1,508,249,363.000466
97,177
pythondev
help
django will let you create models from an existing schema
2017-10-17T14:09:31.000616
Meg
pythondev_help_Meg_2017-10-17T14:09:31.000616
1,508,249,371.000616
97,178
pythondev
help
or you can create it from your model definition
2017-10-17T14:09:40.000064
Meg
pythondev_help_Meg_2017-10-17T14:09:40.000064
1,508,249,380.000064
97,179
pythondev
help
<@Meg>, do you cache a lot of your queries?
2017-10-17T14:13:57.000348
Winnifred
pythondev_help_Winnifred_2017-10-17T14:13:57.000348
1,508,249,637.000348
97,180
pythondev
help
yes
2017-10-17T14:15:16.000001
Meg
pythondev_help_Meg_2017-10-17T14:15:16.000001
1,508,249,716.000001
97,181
pythondev
help
and profile
2017-10-17T14:15:19.000714
Meg
pythondev_help_Meg_2017-10-17T14:15:19.000714
1,508,249,719.000714
97,182
pythondev
help
`django-silk` really comes in handy
2017-10-17T14:15:25.000813
Meg
pythondev_help_Meg_2017-10-17T14:15:25.000813
1,508,249,725.000813
97,183
pythondev
help
but caching is a little tricky because you basically have to try to strike a happy medium between cache lifetime and new data
2017-10-17T14:16:10.000074
Meg
pythondev_help_Meg_2017-10-17T14:16:10.000074
1,508,249,770.000074
97,184
pythondev
help
ah, nice, I need to figure out efficient caching
2017-10-17T14:18:49.000505
Winnifred
pythondev_help_Winnifred_2017-10-17T14:18:49.000505
1,508,249,929.000505
97,185
pythondev
help
what are you using?
2017-10-17T14:20:12.000092
Meg
pythondev_help_Meg_2017-10-17T14:20:12.000092
1,508,250,012.000092
97,186
pythondev
help
no current projects right now, but I was running into problems with ORMs and large queries out of a redshift instance
2017-10-17T14:21:21.000344
Winnifred
pythondev_help_Winnifred_2017-10-17T14:21:21.000344
1,508,250,081.000344
97,187
pythondev
help
but I think this is because I hadn’t transformed the data enough to get the data to a point where it requires a simple query
2017-10-17T14:21:56.000368
Winnifred
pythondev_help_Winnifred_2017-10-17T14:21:56.000368
1,508,250,116.000368
97,188
pythondev
help
We've been using django-cachlot for a while and haven't had any real problems with it: <https://github.com/BertrandBordage/django-cachalot>
2017-10-17T14:22:33.000178
Mallie
pythondev_help_Mallie_2017-10-17T14:22:33.000178
1,508,250,153.000178
97,189
pythondev
help
Perhaps that doesn't sound like a resounding endorsement lol but what I mean is it does what it says and we haven't had any painful gotchas
2017-10-17T14:23:11.000171
Mallie
pythondev_help_Mallie_2017-10-17T14:23:11.000171
1,508,250,191.000171
97,190
pythondev
help
hahaha
2017-10-17T14:24:30.000239
Meg
pythondev_help_Meg_2017-10-17T14:24:30.000239
1,508,250,270.000239
97,191
pythondev
help
how can you ask for more?
2017-10-17T14:24:35.000087
Meg
pythondev_help_Meg_2017-10-17T14:24:35.000087
1,508,250,275.000087
97,192
pythondev
help
would definitely give it a :thumbsup:
2017-10-17T14:26:28.000345
Mallie
pythondev_help_Mallie_2017-10-17T14:26:28.000345
1,508,250,388.000345
97,193
pythondev
help
Hi all - simple question. How can I print out the contents of a generator object?
2017-10-17T14:27:19.000256
Amie
pythondev_help_Amie_2017-10-17T14:27:19.000256
1,508,250,439.000256
97,194
pythondev
help
```&lt;flask_restplus.reqparse.RequestParser object at 0x1132b3ed0&gt;```
2017-10-17T14:27:22.000430
Amie
pythondev_help_Amie_2017-10-17T14:27:22.000430
1,508,250,442.00043
97,195
pythondev
help
Iterating through does not work, nor does coercing to a string.
2017-10-17T14:28:11.000771
Amie
pythondev_help_Amie_2017-10-17T14:28:11.000771
1,508,250,491.000771
97,196
pythondev
help
sure, you just have to consume it first
2017-10-17T14:28:18.000289
Frieda
pythondev_help_Frieda_2017-10-17T14:28:18.000289
1,508,250,498.000289
97,197
pythondev
help
`next(obj)` ?
2017-10-17T14:28:24.000100
Winnifred
pythondev_help_Winnifred_2017-10-17T14:28:24.000100
1,508,250,504.0001
97,198
pythondev
help
In what manner <@Frieda>
2017-10-17T14:29:23.000615
Amie
pythondev_help_Amie_2017-10-17T14:29:23.000615
1,508,250,563.000615
97,199
pythondev
help
generally convert to a list or some similar thing
2017-10-17T14:30:16.000127
Sirena
pythondev_help_Sirena_2017-10-17T14:30:16.000127
1,508,250,616.000127
97,200
pythondev
help
list(generator)
2017-10-17T14:30:20.000036
Sirena
pythondev_help_Sirena_2017-10-17T14:30:20.000036
1,508,250,620.000036
97,201
pythondev
help
if it really is a generator object, you should be able to consume it to a list or a string or whatever (list is probably safest) and then print that
2017-10-17T14:30:21.000456
Frieda
pythondev_help_Frieda_2017-10-17T14:30:21.000456
1,508,250,621.000456
97,202