question_id
int64 502
42.8M
| parent_answer_post_id
int64 595
42.8M
| prob
float64 0
0.87
| snippet
stringlengths 0
12.1k
| intent
stringlengths 14
150
| id
stringlengths 9
20
|
|---|---|---|---|---|---|
533,398
| 533,435
| 0.69841
|
os.system("zsh -c 'echo $0'")
|
In python 2.4, how can I execute external commands with csh instead of bash?
|
533398_533435_0
|
1,094,717
| 1,094,721
| 0.698366
|
int(s.split('.')[0])
|
Convert a string to integer with decimal in Python
|
1094717_1094721_0
|
7,842,157
| 7,842,620
| 0.697875
|
a.astype([('x', '<f8'), ('y', '<f8'), ('z', '<f8')]).view('<f8')
|
How to convert numpy.recarray to numpy.array?
|
7842157_7842620_0
|
2,191,699
| 2,191,712
| 0.697555
|
[(x, y) for x, y in a if x == 1]
|
Find an element in a list of tuples
|
2191699_2191712_0
|
3,878,555
| 3,878,738
| 0.697553
|
re.sub('\\*+', '*', text)
|
How to replace repeated instances of a character with a single instance of that character in python
|
3878555_3878738_0
|
2,769,061
| 2,769,090
| 0.697408
|
open('file.txt', 'w').close()
|
How to erase the file contents of text file in Python?
|
2769061_2769090_0
|
384,076
| 1,336,640
| 0.697374
|
logging.info('some info')
|
How can I color Python logging output?
|
384076_1336640_0
|
19,894,478
| 19,894,589
| 0.697078
|
re.split('\\W+', 'Words, words, words.')
|
Regex punctuation split [Python]
|
19894478_19894589_0
|
5,653,573
| 5,653,618
| 0.696703
|
sorted(iter(dict_.items()), key=lambda x: x[1])
|
Sorting dictionary by values in python
|
5653573_5653618_0
|
21,558,999
| 21,559,116
| 0.69629
|
df1.groupby(['key', 'year']).size().reset_index()
|
Pandas: How can I remove duplicate rows from DataFrame and calculate their frequency?
|
21558999_21559116_0
|
3,673,428
| 3,673,447
| 0.696249
|
ord('a')
|
Convert int to ASCII and back in Python
|
3673428_3673447_0
|
2,261,011
| 2,261,082
| 0.696229
|
root.geometry('500x500')
|
How can I resize the root window in Tkinter?
|
2261011_2261082_0
|
969,285
| 969,324
| 0.696202
|
datetime.datetime.strptime('2007-03-04T21:08:12', '%Y-%m-%dT%H:%M:%S')
|
How do I translate a ISO 8601 datetime string into a Python datetime object?
|
969285_969324_0
|
6,890,170
| 6,890,255
| 0.696187
|
len(li) - 1 - li[::-1].index('a')
|
How to find the last occurrence of an item in a Python list
|
6890170_6890255_0
|
18,724,607
| 18,724,633
| 0.696028
|
my_date.strftime('%-m/%-d/%y')
|
Python date string formatting
|
18724607_18724633_1
|
13,254,241
| 13,254,290
| 0.695988
|
[{k: v for k, v in d.items() if k != 'mykey1'} for d in mylist]
|
Removing key values pairs from a list of dictionaries
|
13254241_13254290_1
|
13,838,405
| 13,839,029
| 0.695937
|
df.sort('m')
|
Custom sorting in pandas dataframe
|
13838405_13839029_0
|
22,153,065
| 22,153,092
| 0.6957
|
print('{}, you won!'.format(name))
|
How to remove whitespace from end of string in Python?
|
22153065_22153092_0
|
40,728,244
| 40,728,326
| 0.695659
|
df.groupby('ID').cumcount() + 1
|
Conditional replacement of row's values in pandas DataFrame
|
40728244_40728326_0
|
11,573,817
| 11,573,946
| 0.695405
|
ftp.retrbinary('RETR %s' % filename, file.write)
|
How to download a file via FTP with Python ftplib
|
11573817_11573946_0
|
2,587,402
| 2,587,419
| 0.695257
|
xs.sort(key=lambda s: len(s))
|
Sorting Python list based on the length of the string
|
2587402_2587419_0
|
22,240,602
| 22,240,612
| 0.69463
|
len(set(mylist)) == 1
|
How do I check if all elements in a list are the same?
|
22240602_22240612_0
|
41,202,444
| 41,202,502
| 0.694276
|
plt.show()
|
I want to plot perpendicular vectors in Python
|
41202444_41202502_0
|
21,669,374
| 21,669,393
| 0.69411
|
hex(ord('a'))
|
convert string to hex in python
|
21669374_21669393_0
|
7,274,221
| 7,274,986
| 0.693457
|
new_img.save('tweeter_green.png')
|
Changing image hue with Python PIL
|
7274221_7274986_0
|
3,365,673
| 3,365,785
| 0.693137
|
ctypes.windll.user32.MessageBoxW(0, 'Error', 'Error', 0)
|
How to throw an error window in Python in Windows
|
3365673_3365785_0
|
14,139,793
| 14,139,878
| 0.693136
|
plt.show()
|
How to add a line parallel to y axis in matplotlib?
|
14139793_14139878_0
|
753,052
| 4,869,782
| 0.692548
|
re.sub('<[^<]+?>', '', text)
|
Strip HTML from strings in Python
|
753052_4869782_0
|
1,260,792
| 1,260,813
| 0.692293
|
__init__.py
|
Python: import a file from a subdirectory
|
1260792_1260813_0
|
22,749,706
| 22,749,723
| 0.692178
|
[len(x) for x in s.split()]
|
How to get the length of words in a sentence?
|
22749706_22749723_0
|
31,743,603
| 31,743,627
| 0.692016
|
[(i // 2) for i in range(10)]
|
Create a list of integers with duplicate values in Python
|
31743603_31743627_0
|
39,600,161
| 39,600,224
| 0.691879
|
re.findall('-(?!aa|bb)([^-]+)', string)
|
Regular expression matching all but a string
|
39600161_39600224_0
|
39,600,161
| 39,600,224
| 0.691879
|
re.findall('-(?!aa-|bb-)([^-]+)', string)
|
Regular expression matching all but a string
|
39600161_39600224_1
|
3,506,678
| 3,506,692
| 0.69186
|
Content.objects.all().order_by('?')[:100]
|
In Django, how do I select 100 random records from the database?
|
3506678_3506692_0
|
4,523,551
| 4,523,564
| 0.691812
|
bin(ord('P'))
|
Python ASCII to binary
|
4523551_4523564_0
|
42,172,204
| 42,172,236
| 0.691792
|
df.replace('-', 'NaN')
|
Replace value in any column in pandas dataframe
|
42172204_42172236_0
|
15,614,067
| 15,614,115
| 0.691145
|
sorted(iter(result.items()), key=lambda key_value: key_value[0])
|
Python: How to sort a dictionary by key
|
15614067_15614115_0
|
10,887,324
| 10,887,526
| 0.69089
|
json.dumps(json.dumps({'color': 'color', 'message': 'message'}))
|
How can I configure Pyramid's JSON encoding?
|
10887324_10887526_0
|
13,781,828
| 13,781,853
| 0.69069
|
[['string 1', 'atest string:'], ['string 1', 'test 2: anothertest string']]
|
Replace a string in list of lists
|
13781828_13781853_0
|
2,917,372
| 2,917,388
| 0.689695
|
[i for i, v in enumerate(L) if v[0] == 53]
|
How to search a list of tuples in Python
|
2917372_2917388_0
|
10,364,201
| 10,374,811
| 0.689482
|
cv2.imwrite('warped.png', warped)
|
Image transformation in OpenCV
|
10364201_10374811_0
|
5,555,063
| 5,555,121
| 0.689363
|
"""\\u003Cp\\u003E""".decode('unicode-escape')
|
Unescaping Characters in a String with Python
|
5555063_5555121_0
|
22,219,450
| 22,421,576
| 0.689282
|
ax.scartter(XS, YS, ZS)
|
How can I plot hysteresis in matplotlib?
|
22219450_22421576_1
|
13,042,013
| 13,042,034
| 0.689081
|
cursor.execute('INSERT INTO `index`(url) VALUES(%s)', (url,))
|
Adding url to mysql row in python
|
13042013_13042034_0
|
1,447,575
| 1,447,651
| 0.689059
|
kdll.CreateSymbolicLinkW('D:\\testdirLink', 'D:\\testdir', 1)
|
Symlinks on windows?
|
1447575_1447651_0
|
25,817,930
| 25,818,117
| 0.689051
|
df.sort(df.columns, axis=1, ascending=False)
|
Fastest way to sort each row in a pandas dataframe
|
25817930_25818117_1
|
14,775,068
| 14,775,604
| 0.688914
|
linregress(df['col_X'], df['col_Y'])
|
How to apply linregress in Pandas bygroup
|
14775068_14775604_0
|
674,519
| 674,536
| 0.688835
|
[(k, v) for k, v in a.items()]
|
How can I convert a Python dictionary to a list of tuples?
|
674519_674536_0
|
3,781,851
| 3,781,869
| 0.68879
|
os.system('script2.py 1')
|
Run a python script from another python script, passing in args
|
3781851_3781869_0
|
17,627,531
| 17,627,575
| 0.688663
|
sorted(d, key=lambda x: datetime.datetime.strptime(x, '%m-%Y'))
|
Sort list of date strings
|
17627531_17627575_0
|
29,558,007
| 29,558,077
| 0.688513
|
list(range(9))
|
How can I generate a list of consecutive numbers?
|
29558007_29558077_0
|
5,201,191
| 5,201,203
| 0.688122
|
L.sort(key=operator.itemgetter(1))
|
Method to sort a list of lists?
|
5201191_5201203_0
|
6,170,246
| 6,170,354
| 0.687712
|
plt.show()
|
How do I use matplotlib autopct?
|
6170246_6170354_0
|
8,654,637
| 8,654,731
| 0.687683
|
dict((k, v) for k, v in parent_dict.items() if 2 < k < 4)
|
Pythonic way to fetch all elements in a dictionary, falling between two keys?
|
8654637_8654731_0
|
17,057,544
| 17,057,603
| 0.687657
|
os.path.dirname(os.path.abspath(existGDBPath))
|
Python - Extract folder path from file path
|
17057544_17057603_0
|
18,493,677
| 18,493,712
| 0.687617
|
imtag = re.match('<img.*?>', line).group(0)
|
how do i return a string from a regex match in python
|
18493677_18493712_0
|
16,618,240
| 16,619,406
| 0.687381
|
{'cmd': ['python', '$file', 'arg1', 'arg2']}
|
How to pass parameters to a build in Sublime Text 3?
|
16618240_16619406_0
|
1,179,305
| 1,179,454
| 0.686896
|
parser.ParseFile(open('sample.xml', 'rb'))
|
Expat parsing in python 3
|
1179305_1179454_0
|
234,512
| 234,645
| 0.686208
|
re.findall('\\[[^\\]]*\\]|"[^"]*"|\\S+', s)
|
Splitting strings in python
|
234512_234645_0
|
3,925,096
| 3,925,147
| 0.686181
|
os.path.basename(os.path.normpath('/folderA/folderB/folderC/folderD/'))
|
How to get only the last part of a path in Python?
|
3925096_3925147_0
|
33,824,334
| 33,824,432
| 0.686086
|
dict([(e[0], int(e[1])) for e in lst])
|
How to convert this list into a dictionary
|
33824334_33824432_0
|
5,801,945
| 5,801,963
| 0.686078
|
re.split('(?<=[\\.\\?!]) ', text)
|
Non-consuming regular expression split in Python
|
5801945_5801963_0
|
17,841,149
| 17,841,294
| 0.685295
|
df.groupby('A')['C'].apply(lambda x: x.sum())
|
Pandas groupby: How to get a union of strings
|
17841149_17841294_0
|
36,460,368
| 36,460,514
| 0.685118
|
df.groupby(level=[0, 1]).median()
|
How to calculate quantiles in a pandas multiindex DataFrame?
|
36460368_36460514_0
|
30,357,276
| 30,357,382
| 0.685011
|
df['Cat1'].fillna(df['Cat2'])
|
Pandas - FillNa with another column
|
30357276_30357382_0
|
15,286,401
| 15,286,409
| 0.684838
|
print(('Total score for', name, 'is', score))
|
Print multiple arguments in python
|
15286401_15286409_0
|
37,463,184
| 37,464,042
| 0.684799
|
plt.show()
|
How to create a Manhattan plot with matplotlib in python?
|
37463184_37464042_0
|
8,556,076
| 8,556,080
| 0.684711
|
my_list[-10:]
|
Python - How to extract the last x elements from a list
|
8556076_8556080_0
|
11,833,266
| 11,833,277
| 0.684603
|
my_string.split('\n', 1)[0]
|
How do I read the first line of a string?
|
11833266_11833277_0
|
3,460,161
| 3,463,582
| 0.684358
|
[k for k, g in itertools.groupby([1, 2, 2, 3, 2, 2, 4])]
|
Remove adjacent duplicate elements from a list
|
3460161_3463582_0
|
7,372,592
| 7,372,651
| 0.684249
|
subprocess.call(['java', '-jar', 'Blender.jar'])
|
Python: How can I execute a jar file through a python script
|
7372592_7372651_0
|
12,376,863
| 12,377,083
| 0.684178
|
d.apply(lambda row: min([row['A'], row['B']]) - row['C'], axis=1)
|
Adding calculated column(s) to a dataframe in pandas
|
12376863_12377083_0
|
21,804,935
| 21,804,966
| 0.684089
|
subprocess.call('mv /home/somedir/subdir/* somedir/', shell=True)
|
How to use the mv command in Python with subprocess
|
21804935_21804966_0
|
13,252,333
| 13,252,348
| 0.683713
|
all(isinstance(x, int) for x in lst)
|
Python check if all elements of a list are the same type
|
13252333_13252348_0
|
6,376,886
| 6,377,007
| 0.683636
|
strs = ['' for x in range(size)]
|
What is the best way to create a string array in python?
|
6376886_6377007_0
|
2,625,877
| 2,626,085
| 0.68359
|
os.system('NET USE P: /DELETE')
|
How to copy files to network path or drive using Python
|
2625877_2626085_0
|
118,096
| 118,162
| 0.683565
|
['foo', 'bar', 'one, two', 'three four']
|
How can i parse a comma delimited string into a list (caveat)?
|
118096_118162_0
|
34,527,388
| 34,527,466
| 0.683522
|
browser.find_element_by_class_name('section-select-all').click()
|
How to click on the text button using selenium python
|
34527388_34527466_0
|
21,360,028
| 21,360,107
| 0.68334
|
[[X[i, j] for i in range(X.shape[0])] for j in range(x.shape[1])]
|
NumPy List Comprehension Syntax
|
21360028_21360107_0
|
8,735,312
| 8,735,360
| 0.683277
|
os.rename('Joe Blow', 'Blow, Joe')
|
How to change folder names in python?
|
8735312_8735360_0
|
14,442,636
| 14,442,938
| 0.683033
|
driver.find_element_by_id('<check_box_id>').is_selected()
|
How can I check if a checkbox is checked in Selenium Python Webdriver?
|
14442636_14442938_0
|
14,332,141
| 20,883,659
| 0.682666
|
fh1.seek(2)
|
Dumping subprcess output in a file in append mode
|
14332141_20883659_0
|
25,148,611
| 25,148,642
| 0.682647
|
results = [item['value'] for item in test_data]
|
How do I extract all the values of a specific key from a list of dictionaries?
|
25148611_25148642_0
|
19,035,186
| 19,035,495
| 0.682244
|
driver.find_element_by_xpath("//div[@id='a']//a[@class='click']")
|
How to select element with Selenium Python xpath
|
19035186_19035495_0
|
3,895,874
| 3,895,901
| 0.681735
|
re.sub('l+', 'l', 'lollll')
|
Regex to match 'lol' to 'lolllll' and 'omg' to 'omggg', etc
|
3895874_3895901_0
|
9,531,092
| 9,637,895
| 0.681671
|
('/static/(.*)', web.StaticFileHandler, {'path': '/var/www'}),
|
How to handle a HTTP GET request to a file in Tornado?
|
9531092_9637895_0
|
39,223,638
| 39,225,130
| 0.681575
|
pd.merge(df.reset_index(), df, on='sseqid')
|
Pandas : Delete rows based on other rows
|
39223638_39225130_0
|
7,900,882
| 7,900,909
| 0.681174
|
[d for d in a if d['name'] == 'pluto']
|
extract item from list of dictionaries
|
7900882_7900909_0
|
2,334,629
| 2,340,216
| 0.680927
|
(i + 1, j), (i - 1, j), (i, j - 1), (i, j + 1), (i + 1, j - 1), (i + 1, j + 1)
|
Hexagonal Self-Organizing map in Python
|
2334629_2340216_0
|
11,114,358
| 11,114,394
| 0.680919
|
list(dict((x['id'], x) for x in L).values())
|
How do I remove dicts from a list with duplicate fields in python?
|
11114358_11114394_0
|
517,355
| 628,974
| 0.68076
|
print('[{0}, {1}, {2}]'.format(1, 2, 3))
|
String formatting in Python
|
517355_628974_0
|
21,360,028
| 21,360,107
| 0.680571
|
[[X[i, j] for j in range(X.shape[1])] for i in range(x.shape[0])]
|
NumPy List Comprehension Syntax
|
21360028_21360107_1
|
5,254,445
| 5,254,455
| 0.680498
|
s[:4] + '-' + s[4:]
|
Add string in a certain position in Python
|
5254445_5254455_0
|
9,841,303
| 9,841,328
| 0.680466
|
"""""".join(set(foo))
|
Removing duplicate characters from a string
|
9841303_9841328_0
|
17,841,149
| 17,841,294
| 0.68024
|
df.groupby('A').apply(lambda x: x.sum())
|
Pandas groupby: How to get a union of strings
|
17841149_17841294_1
|
2,148,543
| 29,877,565
| 0.680233
|
array([[3, 0, 0], [0, 1, 2], [2, 1, 3]])
|
How to write a confusion matrix in Python?
|
2148543_29877565_0
|
7,253,803
| 7,253,830
| 0.679782
|
url.rsplit('/', 1)[-1]
|
How to get everything after last slash in a URL?
|
7253803_7253830_0
|
4,810,537
| 4,810,595
| 0.679683
|
os.system('clear')
|
how to clear the screen in python
|
4810537_4810595_0
|
4,628,333
| 4,629,241
| 0.679575
|
[(0, 4), (7, 9), (11, 11)]
|
converting a list of integers into range in python
|
4628333_4629241_0
|
5,796,238
| 13,595,210
| 0.679485
|
hex(dec).split('x')[1]
|
Python convert decimal to hex
|
5796238_13595210_0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.