qid int64 46k 74.7M | question stringlengths 54 37.8k | date stringlengths 10 10 | metadata listlengths 3 3 | response_j stringlengths 17 26k | response_k stringlengths 26 26k |
|---|---|---|---|---|---|
13,262,575 | Making a turn based game using python 3. I want 2 characters (foe & enemy) to attack, pause based on random+speed, then attack again if they are still alive.
The problem I am running into is the time.sleep freezes both modules, not 1 or the other. Any suggestions to make this work effectively?
```
from multiprocessin... | 2012/11/07 | [
"https://Stackoverflow.com/questions/13262575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1804903/"
] | For Linux: <http://cristian-radulescu.ro/article/fix-netbeans-big-fonts-on-ubuntu.html>
That post recommends adding
```
--laf Nimbus -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd
```
It certainly works on Ubuntu 12.04. I don't know if the same settings will work for Windows7 (but they could because they... | A couple fellas (Muzaffar and GucciDiet) beat me to it on this question- but hope this helps someone :)
Below is my solution from 2 other similar questions [here](https://stackoverflow.com/a/65692939/4739826) and [here](https://stackoverflow.com/a/65693001/4739826)
>
> Literally NONE of these worked for me.
>
>
> ... |
13,262,575 | Making a turn based game using python 3. I want 2 characters (foe & enemy) to attack, pause based on random+speed, then attack again if they are still alive.
The problem I am running into is the time.sleep freezes both modules, not 1 or the other. Any suggestions to make this work effectively?
```
from multiprocessin... | 2012/11/07 | [
"https://Stackoverflow.com/questions/13262575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1804903/"
] | I have a NetBeans plugin called 'UI-Editor' that you can use to customize virtually all Swing Settings (including Font types, sizes, and colors). Go to Tools->Plugins and search for UI-Editor. Or go here: <http://plugins.netbeans.org/plugin/55618/?show=true> | A couple fellas (Muzaffar and GucciDiet) beat me to it on this question- but hope this helps someone :)
Below is my solution from 2 other similar questions [here](https://stackoverflow.com/a/65692939/4739826) and [here](https://stackoverflow.com/a/65693001/4739826)
>
> Literally NONE of these worked for me.
>
>
> ... |
13,262,575 | Making a turn based game using python 3. I want 2 characters (foe & enemy) to attack, pause based on random+speed, then attack again if they are still alive.
The problem I am running into is the time.sleep freezes both modules, not 1 or the other. Any suggestions to make this work effectively?
```
from multiprocessin... | 2012/11/07 | [
"https://Stackoverflow.com/questions/13262575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1804903/"
] | `Alt` + `scroll wheel` will increase / decrease the font size of the main code window | Go to the bin directory where Netbeans is installed. Generally the defualt is : `C:\Program Files\NetBeans <version>\bin`. Now through Command Prompt start netbeans by: `netbeans --fontsize <fontsize> --console suppress`. By using `--console suppress` you can close the cmd window, without the Netbeans window getting af... |
74,327,541 | FAST CGI IS NOT WORKING PROPERLY IN DJANGO DEPLOYMENT ON IIS WINDOW SERVER
```
HTTP Error 500.0 - Internal Server Error
C:\Users\satish.pal\AppData\Local\Programs\Python\Python310\python.exe - The FastCGI process exited unexpectedly
Most likely causes:
•IIS received the request; however, an internal error occurred ... | 2022/11/05 | [
"https://Stackoverflow.com/questions/74327541",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17904860/"
] | As I see from your code, whenever you get an image from `imagePickerController` you store it into variable `self.image`. Then whenever you click Done you just upload this `self.image`
Make variable `self.image` can be nil then remember to unset it after uploading successfully
Code will be like this
```swift
var imag... | You are setting `self.image` if the user selects a photo.
But you are not *unsetting* `self.image` if the user *doesn't* select a photo. It needs to be set to `nil` (not to an empty `UIImage()`). |
59,705,956 | I'm working with `tensorflow-gpu` version `2.0.0` and **I have installed gpu driver and CUDA and cuDNN** (`CUDA version 10.1.243_426` and `cuDNN v7.6.5.32` and I'm using windows!)
When I compile my model or run:
```
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
```
It will ... | 2020/01/12 | [
"https://Stackoverflow.com/questions/59705956",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8342406/"
] | Taken from the official documentation of TensorFlow.
```
import tensorflow as tf
tf.debugging.set_log_device_placement(True)
# Create some tensors
a = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
b = tf.constant([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]])
c = tf.matmul(a, b)
print(c)
```
If ... | Have also noted that Windows Task Manager is not useful for monitoring GPU(dual) activity. Try installing TechPowerUp GPU-Z. (I am running dual NVidia cards). This monitors CPU and GPU activity, power and temperatures. |
23,968,716 | I am using the following code to get remote PC CPU percentage of usage witch is slow and loading the remote PC because of SSHing.
```
per=(subprocess.check_output('ssh root@192.168.32.218 nohup python psutilexe.py',stdin=None,stderr=subprocess.STDOUT,shell=True)).split(' ')
print 'CPU %=',float(per[0])
print 'MEM %=',... | 2014/05/31 | [
"https://Stackoverflow.com/questions/23968716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3693882/"
] | I would suggest taking look at Glances. It's written in python and can also be used for remote server monitoring:
<https://github.com/nicolargo/glances>
Using glances on remote server:
<http://mylinuxbook.com/glances-an-all-in-one-system-monitoring-tool/> | You don't need a custom Python script, since you can [have CPU usage directly with `top`](https://stackoverflow.com/a/9229692/240613), (or [with `sysstat`](https://stackoverflow.com/a/9229396/240613), if installed).
Have you **profiled** your app? Is it the custom script which is making it slow, or the SSHing itself? ... |
23,968,716 | I am using the following code to get remote PC CPU percentage of usage witch is slow and loading the remote PC because of SSHing.
```
per=(subprocess.check_output('ssh root@192.168.32.218 nohup python psutilexe.py',stdin=None,stderr=subprocess.STDOUT,shell=True)).split(' ')
print 'CPU %=',float(per[0])
print 'MEM %=',... | 2014/05/31 | [
"https://Stackoverflow.com/questions/23968716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3693882/"
] | I would suggest taking look at Glances. It's written in python and can also be used for remote server monitoring:
<https://github.com/nicolargo/glances>
Using glances on remote server:
<http://mylinuxbook.com/glances-an-all-in-one-system-monitoring-tool/> | I had been looking for it for a while and I think WMI does what you need.
[WMI\_Python\_Documentation](https://pypi.org/project/WMI/)
```
import wmi
pc = wmi.WMI('PC_Name')
cpu = pc.Win32_Processor()
for i in cpu:
print (i.LoadPercentage)
```
Hopefully this is what you need. |
50,547,218 | Why does the python code below crash my website?
But the code at the very bottom does not crash the website
Here is the code that crashes the website:
```
from django.urls import path, include
from django.contrib import admin
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('learning_l... | 2018/05/26 | [
"https://Stackoverflow.com/questions/50547218",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9852457/"
] | You have a space between `url` and `patterns`. It should be all one word `urlpatterns`.
If you ever need to check the code for any of the other exercises in that book, they're all on github [here](https://github.com/ehmatthes/pcc). | I got to this point in the Crash Course, this area will break your site, temporarily. You will not have made all the files referenced in your code yet. In this case, you haven't made the urls.py file in learning\_logs. After this is made, you will not have updated your views.py nor made your index.html template. Keep g... |
73,793,403 | I frequently need to generate similar looking excel sheets for humans to read. Background colors and formatting should be similar. I'm looking to be able to read a template into python and have the values and cells filled in in Python.
It does not appear that xlsxwriter can read background color and formatting. It can... | 2022/09/20 | [
"https://Stackoverflow.com/questions/73793403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5775112/"
] | Fill color is fgColor per the OOXML specs "For solid cell fills (no pattern), fgColor is used".
You can get the color from about three attributes, all should provide the same hex value unless the fill is grey in which case the index/value is 0 and the grey content is determined by tint
```
for cell in ws['A']:
... | There were no openstack answers I could find about reading existing background color formatting. The answers I did find were about formatting of the cell into things like percentage or currency.
Here is a solution I've found for background cell color from the openpyxl documentation, though fill color was not explicit ... |
55,095,983 | I'm having some trouble with the `replace()` function in python. Here is my code :
```
string = input()
word = string.find('word')
if word >= 1:
string = string.replace('word', 'word.2')
print(string)
```
The output gives `word`. Shouldn't it be `word.2`?
I'm confused. Any help?
Edit: After playing around with ... | 2019/03/11 | [
"https://Stackoverflow.com/questions/55095983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11182783/"
] | Instead of
```
word >= 1
```
write
```
word >= 0
```
string.find() returns the first occurence of the word. If your string is 'word' and you find 'word', it'll return 0 as the word 'word' occurs at index 0 first.
In python, arrays start at 0. The first character in a string is at index 0.
Therefore, 'word' in ... | There is no need to use the find function, just do:
```
string = input()
string = string.replace('word', 'word.2')
```
But nevertheless, if i ran it in Python3, your code is correct ;-)
How does your input look like? |
55,095,983 | I'm having some trouble with the `replace()` function in python. Here is my code :
```
string = input()
word = string.find('word')
if word >= 1:
string = string.replace('word', 'word.2')
print(string)
```
The output gives `word`. Shouldn't it be `word.2`?
I'm confused. Any help?
Edit: After playing around with ... | 2019/03/11 | [
"https://Stackoverflow.com/questions/55095983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11182783/"
] | There is no need to use the find function, just do:
```
string = input()
string = string.replace('word', 'word.2')
```
But nevertheless, if i ran it in Python3, your code is correct ;-)
How does your input look like? | it happens because first occurrence is treated as zero position, use below code
```
string = input().replace('word','word.2')
print(string)
``` |
55,095,983 | I'm having some trouble with the `replace()` function in python. Here is my code :
```
string = input()
word = string.find('word')
if word >= 1:
string = string.replace('word', 'word.2')
print(string)
```
The output gives `word`. Shouldn't it be `word.2`?
I'm confused. Any help?
Edit: After playing around with ... | 2019/03/11 | [
"https://Stackoverflow.com/questions/55095983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11182783/"
] | Instead of
```
word >= 1
```
write
```
word >= 0
```
string.find() returns the first occurence of the word. If your string is 'word' and you find 'word', it'll return 0 as the word 'word' occurs at index 0 first.
In python, arrays start at 0. The first character in a string is at index 0.
Therefore, 'word' in ... | it happens because first occurrence is treated as zero position, use below code
```
string = input().replace('word','word.2')
print(string)
``` |
54,093,253 | I've been trying to work with BeautifulSoup because I want to try and scrape a webpage (<https://www.imdb.com/search/title?release_date=2017&sort=num_votes,desc&page=1>). So far I scraped some elements with success but now I wanted to scrape a movie description but I've been struggling. The description is simply situat... | 2019/01/08 | [
"https://Stackoverflow.com/questions/54093253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9441232/"
] | >
> [find\_all()](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#find-all) method looks through a tag’s descendants and retrieves
> all descendants that match your filters.
>
>
>
You can then use the list's index to get the element you need. Index starts at 0, so 1 will give the second item.
Change the f... | Just playing around with `.next_sibling` was able to get it. There's probably a more elegant way though. At least might give you a start/some direction
```
from bs4 import BeautifulSoup
html = '''<div class="lister-item mode-advanced">
<div class="lister-item-content>
<p class="muted-text"> paragraph I d... |
54,093,253 | I've been trying to work with BeautifulSoup because I want to try and scrape a webpage (<https://www.imdb.com/search/title?release_date=2017&sort=num_votes,desc&page=1>). So far I scraped some elements with success but now I wanted to scrape a movie description but I've been struggling. The description is simply situat... | 2019/01/08 | [
"https://Stackoverflow.com/questions/54093253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9441232/"
] | >
> [find\_all()](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#find-all) method looks through a tag’s descendants and retrieves
> all descendants that match your filters.
>
>
>
You can then use the list's index to get the element you need. Index starts at 0, so 1 will give the second item.
Change the f... | BeautifulSoup 4.71 support `:nth-child()` or any CSS4 selectors
```
first_description = soup.select_one('.lister-item-content p:nth-child(4)')
# or
#first_description = soup.select_one('.lister-item-content p:nth-of-type(2)')
print(desc)
``` |
64,754,032 | I am trying to use SageMaker script mode for training a model on image data. I have multiple scripts for data preparation, model creation, and training. This is the content of my working directory:
```
WORKDIR
|-- config
| |-- hyperparameters.json
| |-- lossweights.json
| `-- lr.json
|-- dataset.py
|-- densenet.... | 2020/11/09 | [
"https://Stackoverflow.com/questions/64754032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7697327/"
] | If you don't mind switching from TF 1.14 to TF 1.15.2+, you'll be able to bring a local code directory containing your custom modules to your SageMaker TensorFlow Estimator via the argument `source_dir`. Your entry point script shall be in that `source_dir`. Details in the SageMaker TensorFlow doc: <https://sagemaker.r... | This isn't exactly what the questioner asked but if anyone has come here wanting to know how to use custom libraries with SKLearn you can use `dependencies` as an argument like in the following:
```
import sagemaker
from sagemaker.sklearn.estimator import SKLearn
sess = sagemaker.Session()
role = sagemkaer.get_execut... |
62,097,219 | I am trying to connect to Google Sheets' API from a Django view. The bulk of the code I have taken from this link:
<https://developers.google.com/sheets/api/quickstart/python>
Anyway, here are the codes:
**sheets.py** (Copy pasted from the link above, function renamed)
```
from __future__ import print_function
impor... | 2020/05/30 | [
"https://Stackoverflow.com/questions/62097219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5056347/"
] | You shouldn't be using [Flow.run\_local\_server()](https://github.com/googleapis/google-auth-library-python-oauthlib/blob/v0.4.1/google_auth_oauthlib/flow.py#L408) unless you don't have the intention of deploying the code. This is because `run_local_server` launches a browser on the server to complete the flow.
This w... | The redirect URI tells Google the location you would like the authorization to be returned to. This must be set up properly in google developer console to avoid anyone hijacking your client. It must match exactly.
To to [Google developer console](https://console.developers.google.com/). Edit the client you are curren... |
62,097,219 | I am trying to connect to Google Sheets' API from a Django view. The bulk of the code I have taken from this link:
<https://developers.google.com/sheets/api/quickstart/python>
Anyway, here are the codes:
**sheets.py** (Copy pasted from the link above, function renamed)
```
from __future__ import print_function
impor... | 2020/05/30 | [
"https://Stackoverflow.com/questions/62097219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5056347/"
] | I had the same problem with the redirect\_uri error and it turned out (as implied above) that I created my credentials in the google console as type "Web server" instead of "desktop app". I created new creds as "desktop app", downloaded the JSON and it worked.
Ultimately, I want to use the GMAIL API for a web server, ... | The redirect URI tells Google the location you would like the authorization to be returned to. This must be set up properly in google developer console to avoid anyone hijacking your client. It must match exactly.
To to [Google developer console](https://console.developers.google.com/). Edit the client you are curren... |
62,097,219 | I am trying to connect to Google Sheets' API from a Django view. The bulk of the code I have taken from this link:
<https://developers.google.com/sheets/api/quickstart/python>
Anyway, here are the codes:
**sheets.py** (Copy pasted from the link above, function renamed)
```
from __future__ import print_function
impor... | 2020/05/30 | [
"https://Stackoverflow.com/questions/62097219",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5056347/"
] | You shouldn't be using [Flow.run\_local\_server()](https://github.com/googleapis/google-auth-library-python-oauthlib/blob/v0.4.1/google_auth_oauthlib/flow.py#L408) unless you don't have the intention of deploying the code. This is because `run_local_server` launches a browser on the server to complete the flow.
This w... | I had the same problem with the redirect\_uri error and it turned out (as implied above) that I created my credentials in the google console as type "Web server" instead of "desktop app". I created new creds as "desktop app", downloaded the JSON and it worked.
Ultimately, I want to use the GMAIL API for a web server, ... |
24,204,582 | I want to generate multiple streams of random numbers in python.
I am writing a program for simulating queues system and want one stream for the inter-arrival time and another stream for the service time and so on.
`numpy.random()` generates random numbers from a global stream.
In matlab there is [something called Ra... | 2014/06/13 | [
"https://Stackoverflow.com/questions/24204582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429820/"
] | Both Numpy and the internal random generators have instantiatable classes.
For just `random`:
```
import random
random_generator = random.Random()
random_generator.random()
#>>> 0.9493959884174072
```
And for Numpy:
```
import numpy
random_generator = numpy.random.RandomState()
random_generator.uniform(0, 1, 10)
#... | Veedrac's answer did not address how one might generate independent streams.
The best way I could find to generate independent streams is to use a replacement for numpy's RandomState. This is provided by the [RandomGen package](https://bashtage.github.io/randomgen/index.html).
It supports [independent random streams]... |
24,204,582 | I want to generate multiple streams of random numbers in python.
I am writing a program for simulating queues system and want one stream for the inter-arrival time and another stream for the service time and so on.
`numpy.random()` generates random numbers from a global stream.
In matlab there is [something called Ra... | 2014/06/13 | [
"https://Stackoverflow.com/questions/24204582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429820/"
] | Both Numpy and the internal random generators have instantiatable classes.
For just `random`:
```
import random
random_generator = random.Random()
random_generator.random()
#>>> 0.9493959884174072
```
And for Numpy:
```
import numpy
random_generator = numpy.random.RandomState()
random_generator.uniform(0, 1, 10)
#... | You do not need to use the RandomGen package. Simply initiate two streams would suffice. For example:
```
import numpy as np
prng1 = np.random.RandomState()
prng2 = np.random.RandomState()
prng1.seed(1)
prng2.seed(1)
```
Now if you progress both streams using `prngX.rand()`, you will find that the two streams will g... |
24,204,582 | I want to generate multiple streams of random numbers in python.
I am writing a program for simulating queues system and want one stream for the inter-arrival time and another stream for the service time and so on.
`numpy.random()` generates random numbers from a global stream.
In matlab there is [something called Ra... | 2014/06/13 | [
"https://Stackoverflow.com/questions/24204582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429820/"
] | Both Numpy and the internal random generators have instantiatable classes.
For just `random`:
```
import random
random_generator = random.Random()
random_generator.random()
#>>> 0.9493959884174072
```
And for Numpy:
```
import numpy
random_generator = numpy.random.RandomState()
random_generator.uniform(0, 1, 10)
#... | For the sake of reproducibility you can pass a seed directly to `random.Random()` and then call variables from there. Each initiated instance would then run independently from the other. For example, if you run:
```
import random
rg1 = random.Random(1)
rg2 = random.Random(2)
rg3 = random.Random(1)
for i in range(5): p... |
24,204,582 | I want to generate multiple streams of random numbers in python.
I am writing a program for simulating queues system and want one stream for the inter-arrival time and another stream for the service time and so on.
`numpy.random()` generates random numbers from a global stream.
In matlab there is [something called Ra... | 2014/06/13 | [
"https://Stackoverflow.com/questions/24204582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429820/"
] | Both Numpy and the internal random generators have instantiatable classes.
For just `random`:
```
import random
random_generator = random.Random()
random_generator.random()
#>>> 0.9493959884174072
```
And for Numpy:
```
import numpy
random_generator = numpy.random.RandomState()
random_generator.uniform(0, 1, 10)
#... | `numpy` added feature to generate independent streams of Random Numbers using `SeedSequence`. This process a user-provided seed, typically as an integer of some size, and to convert it into an initial state for a BitGenerator. It uses hashing techniques to ensure that low-quality seeds are turned into high quality init... |
24,204,582 | I want to generate multiple streams of random numbers in python.
I am writing a program for simulating queues system and want one stream for the inter-arrival time and another stream for the service time and so on.
`numpy.random()` generates random numbers from a global stream.
In matlab there is [something called Ra... | 2014/06/13 | [
"https://Stackoverflow.com/questions/24204582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429820/"
] | You do not need to use the RandomGen package. Simply initiate two streams would suffice. For example:
```
import numpy as np
prng1 = np.random.RandomState()
prng2 = np.random.RandomState()
prng1.seed(1)
prng2.seed(1)
```
Now if you progress both streams using `prngX.rand()`, you will find that the two streams will g... | Veedrac's answer did not address how one might generate independent streams.
The best way I could find to generate independent streams is to use a replacement for numpy's RandomState. This is provided by the [RandomGen package](https://bashtage.github.io/randomgen/index.html).
It supports [independent random streams]... |
24,204,582 | I want to generate multiple streams of random numbers in python.
I am writing a program for simulating queues system and want one stream for the inter-arrival time and another stream for the service time and so on.
`numpy.random()` generates random numbers from a global stream.
In matlab there is [something called Ra... | 2014/06/13 | [
"https://Stackoverflow.com/questions/24204582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429820/"
] | For the sake of reproducibility you can pass a seed directly to `random.Random()` and then call variables from there. Each initiated instance would then run independently from the other. For example, if you run:
```
import random
rg1 = random.Random(1)
rg2 = random.Random(2)
rg3 = random.Random(1)
for i in range(5): p... | Veedrac's answer did not address how one might generate independent streams.
The best way I could find to generate independent streams is to use a replacement for numpy's RandomState. This is provided by the [RandomGen package](https://bashtage.github.io/randomgen/index.html).
It supports [independent random streams]... |
24,204,582 | I want to generate multiple streams of random numbers in python.
I am writing a program for simulating queues system and want one stream for the inter-arrival time and another stream for the service time and so on.
`numpy.random()` generates random numbers from a global stream.
In matlab there is [something called Ra... | 2014/06/13 | [
"https://Stackoverflow.com/questions/24204582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429820/"
] | You do not need to use the RandomGen package. Simply initiate two streams would suffice. For example:
```
import numpy as np
prng1 = np.random.RandomState()
prng2 = np.random.RandomState()
prng1.seed(1)
prng2.seed(1)
```
Now if you progress both streams using `prngX.rand()`, you will find that the two streams will g... | For the sake of reproducibility you can pass a seed directly to `random.Random()` and then call variables from there. Each initiated instance would then run independently from the other. For example, if you run:
```
import random
rg1 = random.Random(1)
rg2 = random.Random(2)
rg3 = random.Random(1)
for i in range(5): p... |
24,204,582 | I want to generate multiple streams of random numbers in python.
I am writing a program for simulating queues system and want one stream for the inter-arrival time and another stream for the service time and so on.
`numpy.random()` generates random numbers from a global stream.
In matlab there is [something called Ra... | 2014/06/13 | [
"https://Stackoverflow.com/questions/24204582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429820/"
] | You do not need to use the RandomGen package. Simply initiate two streams would suffice. For example:
```
import numpy as np
prng1 = np.random.RandomState()
prng2 = np.random.RandomState()
prng1.seed(1)
prng2.seed(1)
```
Now if you progress both streams using `prngX.rand()`, you will find that the two streams will g... | `numpy` added feature to generate independent streams of Random Numbers using `SeedSequence`. This process a user-provided seed, typically as an integer of some size, and to convert it into an initial state for a BitGenerator. It uses hashing techniques to ensure that low-quality seeds are turned into high quality init... |
24,204,582 | I want to generate multiple streams of random numbers in python.
I am writing a program for simulating queues system and want one stream for the inter-arrival time and another stream for the service time and so on.
`numpy.random()` generates random numbers from a global stream.
In matlab there is [something called Ra... | 2014/06/13 | [
"https://Stackoverflow.com/questions/24204582",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3429820/"
] | For the sake of reproducibility you can pass a seed directly to `random.Random()` and then call variables from there. Each initiated instance would then run independently from the other. For example, if you run:
```
import random
rg1 = random.Random(1)
rg2 = random.Random(2)
rg3 = random.Random(1)
for i in range(5): p... | `numpy` added feature to generate independent streams of Random Numbers using `SeedSequence`. This process a user-provided seed, typically as an integer of some size, and to convert it into an initial state for a BitGenerator. It uses hashing techniques to ensure that low-quality seeds are turned into high quality init... |
38,430,491 | I'm writing a Python application that needs to fetch a Google document from Google Drive as markdown.
I'm looking for ideas for the design and existing open-source code.
As far as I know, Google doesn't provide export as markdown. I suppose this means I would have to figure out, which of the available download/export... | 2016/07/18 | [
"https://Stackoverflow.com/questions/38430491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852140/"
] | You might want to take a look at [Pandoc](http://pandoc.org/ "Pandoc") which supports conversions i.e. from docx to markdown. There are several Python wrappers for Pandoc, such as [pypandoc](https://pypi.python.org/pypi/pypandoc/ "pypandoc").
After fetching a document from Google Drive in docx format, the conversion i... | Google Drive offers a "Zipped HTML" export option.
[](https://i.stack.imgur.com/BosJ2.png)
Use the [Python module `html2text`](https://pypi.python.org/pypi/html2text) to convert the HTML into Markdown.
>
> html2text is a Python script that converts... |
9,753,885 | I'd like to have the matplotlib "show" command return to the command line
while displaying the plot. Most other plot packages, like R, do this.
But pylab hangs until the plot window closes. For example:
```
import pylab
x = pylab.arange( 0, 10, 0.1)
y = pylab.sin(x)
pylab.plot(x,y, 'ro-')
pylab.show() # Python hang... | 2012/03/17 | [
"https://Stackoverflow.com/questions/9753885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/647331/"
] | Add `pylab.ion()` ([interactive mode](http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.ion)) before the `pylab.show()` call. That will make the UI run in a separate thread and the call to `show` will return immediately. | You need to run it as
```
$ ipython --pylab
```
and run your code as
```
In [8]: x = arange(0,10,.1)
In [9]: y = sin(x)
In [10]: plot(x,y,'ro-')
Out[10]: [<matplotlib.lines.Line2D at 0x2f2fd50>]
In [11]:
```
This gives you the prompt for cases where you would want to modify other parts or plot more. |
52,711,988 | I'm having trouble using Pipenv on my Windows 10 machine. Initially, I got a timeout error while trying to run `pipenv install <module>` and following [this answer](https://stackoverflow.com/a/52509038/5535114), I disabled Windows Defender.
That got rid of the timeout error and it then seems to successfully install th... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52711988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5535114/"
] | Finally solved it. This is current issue, with a [workaround](https://github.com/pypa/pipenv/issues/2924#issuecomment-427383459) for Windows:
`pipenv run python -m pip install -U pip==18.0` | I got the same problem . It looks like problem happen with pip18.1 . However, you are using pip 18.0 . By the way,
I solved by these commands . You can try it.
`pipenv run pip install pip==18.0
pipenv install`
Reference:
<https://github.com/pypa/pipenv/issues/2924> |
52,711,988 | I'm having trouble using Pipenv on my Windows 10 machine. Initially, I got a timeout error while trying to run `pipenv install <module>` and following [this answer](https://stackoverflow.com/a/52509038/5535114), I disabled Windows Defender.
That got rid of the timeout error and it then seems to successfully install th... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52711988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5535114/"
] | I recommend you to update your pipenv version by using
```
>>> python -m pip install --upgrade pip
```
`>>> pip install --upgrade pipenv`
And then try to install your module again
```
>>> pipenv install <module_name>
``` | I got the same problem . It looks like problem happen with pip18.1 . However, you are using pip 18.0 . By the way,
I solved by these commands . You can try it.
`pipenv run pip install pip==18.0
pipenv install`
Reference:
<https://github.com/pypa/pipenv/issues/2924> |
52,711,988 | I'm having trouble using Pipenv on my Windows 10 machine. Initially, I got a timeout error while trying to run `pipenv install <module>` and following [this answer](https://stackoverflow.com/a/52509038/5535114), I disabled Windows Defender.
That got rid of the timeout error and it then seems to successfully install th... | 2018/10/09 | [
"https://Stackoverflow.com/questions/52711988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5535114/"
] | Finally solved it. This is current issue, with a [workaround](https://github.com/pypa/pipenv/issues/2924#issuecomment-427383459) for Windows:
`pipenv run python -m pip install -U pip==18.0` | I recommend you to update your pipenv version by using
```
>>> python -m pip install --upgrade pip
```
`>>> pip install --upgrade pipenv`
And then try to install your module again
```
>>> pipenv install <module_name>
``` |
33,845,726 | For example this is my simple python code to send e-mail:
```
import smtplib
import getpass
mail = "example@example.com"
passs = getpass.getpass("pass: ")
sendto = "example1@example2.com"
title = "Subject: example\n"
body = "blabla\n"
msg = title + body
send = smtplib.SMTP("smtp.example.com",587)
send.ehlo()
send.star... | 2015/11/21 | [
"https://Stackoverflow.com/questions/33845726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3848384/"
] | The simplest way is to ask for its `description`:
```
cell.priceLabel.text = productPrice.price.description;
```
(All those answers that suggest formatting with `"%@"` are using `description`, indirectly.)
But if it's a price, you probably want to format it like a price. For example, in the USA, prices in US dollar... | A UILabel expects its text value to be an NSString, so you need to create a string using the value of product.price.
```
cell.priceLabel.text = [NSString stringWithFormat:@"%@", product.price];
```
What's important is that you can't simply cast (change) the type of NSDecimalNumber, you have to convert the value in s... |
12,665,574 | I'm working with a class that emulates a python list. I want to return it as a python list() when I access it without an index.
with a normal list():
```
>>> a = [1,2,3]
>>> a
[1,2,3]
```
what I'm getting, essentially:
```
>>> a = MyList([1,2,3])
>>> a
<MyList object at 0xdeadbeef>
```
I can't figure out which... | 2012/09/30 | [
"https://Stackoverflow.com/questions/12665574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1212685/"
] | You should override the `__repr__` method in you class (and optionally the `__str__` method too), see this [post](https://stackoverflow.com/questions/1436703/difference-between-str-and-repr-in-python) for a discussion on the differences.
Something like this:
```
class MyList(object):
def __repr__(self):
#... | Allow me to answer my own question - I believe it's the \_\_ repr \_\_ method that I'm looking for. Please correct me if i'm wrong. Here's what I came up with:
```
def __repr__(self):
return str([i for i in iter(self)])
``` |
12,665,574 | I'm working with a class that emulates a python list. I want to return it as a python list() when I access it without an index.
with a normal list():
```
>>> a = [1,2,3]
>>> a
[1,2,3]
```
what I'm getting, essentially:
```
>>> a = MyList([1,2,3])
>>> a
<MyList object at 0xdeadbeef>
```
I can't figure out which... | 2012/09/30 | [
"https://Stackoverflow.com/questions/12665574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1212685/"
] | You should override the `__repr__` method in you class (and optionally the `__str__` method too), see this [post](https://stackoverflow.com/questions/1436703/difference-between-str-and-repr-in-python) for a discussion on the differences.
Something like this:
```
class MyList(object):
def __repr__(self):
#... | A very simple example:
```
class MyList(object):
def __init__(self,arg):
self.mylist = arg
def __repr__(self):
return 'MyList(' + str(self.mylist) + ')'
def __str__(self):
return str(self.mylist)
def __getitem__(self,i):
return self.mylist[i]
a = MyList([1,2,3])
print a
... |
12,665,574 | I'm working with a class that emulates a python list. I want to return it as a python list() when I access it without an index.
with a normal list():
```
>>> a = [1,2,3]
>>> a
[1,2,3]
```
what I'm getting, essentially:
```
>>> a = MyList([1,2,3])
>>> a
<MyList object at 0xdeadbeef>
```
I can't figure out which... | 2012/09/30 | [
"https://Stackoverflow.com/questions/12665574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1212685/"
] | The method you are looking for wolud be `__repr__`.
See also [http://docs.python.org/reference/datamodel.html#object.**repr**](http://docs.python.org/reference/datamodel.html#object.__repr__) | Allow me to answer my own question - I believe it's the \_\_ repr \_\_ method that I'm looking for. Please correct me if i'm wrong. Here's what I came up with:
```
def __repr__(self):
return str([i for i in iter(self)])
``` |
12,665,574 | I'm working with a class that emulates a python list. I want to return it as a python list() when I access it without an index.
with a normal list():
```
>>> a = [1,2,3]
>>> a
[1,2,3]
```
what I'm getting, essentially:
```
>>> a = MyList([1,2,3])
>>> a
<MyList object at 0xdeadbeef>
```
I can't figure out which... | 2012/09/30 | [
"https://Stackoverflow.com/questions/12665574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1212685/"
] | The method you are looking for wolud be `__repr__`.
See also [http://docs.python.org/reference/datamodel.html#object.**repr**](http://docs.python.org/reference/datamodel.html#object.__repr__) | A very simple example:
```
class MyList(object):
def __init__(self,arg):
self.mylist = arg
def __repr__(self):
return 'MyList(' + str(self.mylist) + ')'
def __str__(self):
return str(self.mylist)
def __getitem__(self,i):
return self.mylist[i]
a = MyList([1,2,3])
print a
... |
12,665,574 | I'm working with a class that emulates a python list. I want to return it as a python list() when I access it without an index.
with a normal list():
```
>>> a = [1,2,3]
>>> a
[1,2,3]
```
what I'm getting, essentially:
```
>>> a = MyList([1,2,3])
>>> a
<MyList object at 0xdeadbeef>
```
I can't figure out which... | 2012/09/30 | [
"https://Stackoverflow.com/questions/12665574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1212685/"
] | A very simple example:
```
class MyList(object):
def __init__(self,arg):
self.mylist = arg
def __repr__(self):
return 'MyList(' + str(self.mylist) + ')'
def __str__(self):
return str(self.mylist)
def __getitem__(self,i):
return self.mylist[i]
a = MyList([1,2,3])
print a
... | Allow me to answer my own question - I believe it's the \_\_ repr \_\_ method that I'm looking for. Please correct me if i'm wrong. Here's what I came up with:
```
def __repr__(self):
return str([i for i in iter(self)])
``` |
55,564,014 | I am unable to import the tensorflow 2.0 module into my code i end up getting this error
```
Traceback (most recent call last):
File "C:\Users\Perseus\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Us... | 2019/04/07 | [
"https://Stackoverflow.com/questions/55564014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11258767/"
] | I think you hit [this bug](https://github.com/tensorflow/tensorflow/issues/22794).
You can downgrade tensorflow to `v1.10.0`
```
pip install tensorflow-gpu==1.10.0
```
or make sure that you have these versions for CUDA, Tensorflow and CUDNN:
* CUDA v9.0
* tensorflow-gpu v1.12.0
* CUDNN 7.4.1.5
Alternatively, yo... | tensorflow 2.0 is now officially available. You can retry. This time it should work without any errors, if CUDA and CuDNN are properly installed. |
63,160,976 | I am trying to split my nested list of strings into nested lists of floats. My nested list is below:
```
nested = [['0.3, 0.4, 0.2', '0.5, 0.1, 0.3'], ['0.7, 0.4, 0.2'], ['0.4, 0.1, 0.3']]
```
My desired output would be a nested list where these values remain in their sublist and are converted to floats as seen belo... | 2020/07/29 | [
"https://Stackoverflow.com/questions/63160976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13984141/"
] | ```
result = [[float(t) for s in sublist for t in s.split(', ')] for sublist in nested]
```
which is equivalent to
```
result = []
for sublist in nested:
inner = []
for s in sublist:
for t in s.split(', '):
inner.append(float(t))
result.append(inner)
``` | OK, starting with your example:
myNestedList = [['0.3, 0.4, 0.2', '0.5, 0.1, 0.3'], ['0.7, 0.4, 0.2'], ['0.4, 0.1, 0.3']]
```
myOutputList = []
for subList in myNestedList:
tempList = []
for valueStr in sublist:
valueFloat = float( valueStr )
tempList.append( valueFloat )
myOutputList.appe... |
63,160,976 | I am trying to split my nested list of strings into nested lists of floats. My nested list is below:
```
nested = [['0.3, 0.4, 0.2', '0.5, 0.1, 0.3'], ['0.7, 0.4, 0.2'], ['0.4, 0.1, 0.3']]
```
My desired output would be a nested list where these values remain in their sublist and are converted to floats as seen belo... | 2020/07/29 | [
"https://Stackoverflow.com/questions/63160976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13984141/"
] | ```
result = [[float(t) for s in sublist for t in s.split(', ')] for sublist in nested]
```
which is equivalent to
```
result = []
for sublist in nested:
inner = []
for s in sublist:
for t in s.split(', '):
inner.append(float(t))
result.append(inner)
``` | ```py
nested = [['0.3, 0.4, 0.2', '0.5, 0.1, 0.3'], ['0.7, 0.4, 0.2'], ['0.4, 0.1, 0.3']]
new_nested = [[float(number) for strings in sublist for number in strings.split(', ')] for sublist in nested]
print(new_nested)
new_nested = list()
for sublist in nested:
sublist_new_nested = list()
for strings in sublist:... |
54,901,493 | i have problem with my code when i want signup error appear `Manager isn't available; 'auth.User' has been swapped for 'members.CustomUser'` , i try solotion of other questions same like [Manager isn't available; 'auth.User' has been swapped for 'members.CustomUser'](https://stackoverflow.com/questions/17873855/manager... | 2019/02/27 | [
"https://Stackoverflow.com/questions/54901493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10642829/"
] | Modify views.py
```
from django.contrib.auth.forms import UserCreationForm
from django.urls import reverse_lazy
from django.views import generic
class SignUp(generic.CreateView):
form_class = UserCreationForm
success_url = reverse_lazy('login')
template_name = 'signup.html'
```
to
```
from .forms impo... | In your forms.py make changes as:
```
from django.contrib.auth import get_user_model
class CustomUserChangeForm(UserChangeForm):
class Meta:
model = get_user_model()
fields = ('username', 'email')
class CustomUserCreationForm(UserCreationForm):
class Meta:
model = get_user_model()
... |
14,447,202 | Heroku seems to prefer the apps deployed have a certain structure, mostly that the .git and manage.py is at root level and everything else is below that.
I have inherited a Django app I'm trying to deploy for testing purposes and I don't think I can restructure it so I was wondering if I have an alternative.
The stru... | 2013/01/21 | [
"https://Stackoverflow.com/questions/14447202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1998312/"
] | Just in case someone else has this trouble, my findings are:
There is nothing to solve -- the sandbox is just really slow, sometimes it took a couple days for the profile to become active and send the IPN. In other words, sandbox isn't good to test these functions at all, just go live and refund a couple tests. Even l... | From PayPal doco:
"By default, PayPal does not activate the profile if the initial payment amount fails. To override this default behavior, set the FAILEDINITAMTACTION field to ContinueOnFailure. If the initial payment amount fails, ContinueOnFailure instructs PayPal to add the failed payment amount to the outstanding... |
25,317,140 | I may be going about this the wrong way but that's why I'm asking the question.
I have a source of serial data that is connected to a SOC then streams the serial data up to a socket on my server over UDP. The baud rate of the raw data is 57600, I'm trying to use Python to receive and parse the data. I tested that I'm ... | 2014/08/14 | [
"https://Stackoverflow.com/questions/25317140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/993775/"
] | You can't treat a socket as a serial line. A socket can only send and receive data (data stream for TCP, packets for UDP). If you would need a facility to control the serial line on the SOC you would need to build an appropriate control protocol over the socket, i.e. either use another socket for control like FTP does ... | Build on facts
--------------
A first thing to start with is to summarise facts -- **begining from the very SystemOnChip** (SOC) all the way up ...:
1. an originator serial-bitstream parameters ::= **57600** Bd, **X**-<*dataBIT*>-s, **Y**-<*stopBIT*>, **Z**-<*parityBIT*>,
2. a mediator receiving process de-framing <*... |
61,831,953 | I am looking for a way in python to make a dictionary of dictionaries based on the desired structure dynamically.
I have the data bellow:
```py
{'weather': ['windy', 'calm'], 'season': ['summer', 'winter', 'spring', 'autumn'], 'lateness': ['ontime', 'delayed']}
```
I give the structure I want them to be like:
``... | 2020/05/16 | [
"https://Stackoverflow.com/questions/61831953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4377632/"
] | If you're not avert to using external packages, [`pandas.DataFrame`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html#pandas.DataFrame) might be a viable candidate since it looks like you'll be using a table:
```
import pandas as pd
df = pd.DataFrame(
index=pd.MultiIndex.from_pro... | Yes, you can achieve this using the following code:
```
import copy
structure = ['weather', 'season', 'lateness']
data = {'weather': ['windy', 'calm'], 'season': ['summer', 'winter', 'spring', 'autumn'],
'lateness': ['ontime', 'delayed'], }
d_tree = dict()
n = len(structure) # length of the structure list
p... |
61,831,953 | I am looking for a way in python to make a dictionary of dictionaries based on the desired structure dynamically.
I have the data bellow:
```py
{'weather': ['windy', 'calm'], 'season': ['summer', 'winter', 'spring', 'autumn'], 'lateness': ['ontime', 'delayed']}
```
I give the structure I want them to be like:
``... | 2020/05/16 | [
"https://Stackoverflow.com/questions/61831953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4377632/"
] | I think this might work for you.
```
def get_output(category, order, i=0):
output = {}
for key in order[i:i+1]:
for value in category[key]:
output[value] = get_output(category, order, i+1)
if output == {}:
return 0
return output
``` | Yes, you can achieve this using the following code:
```
import copy
structure = ['weather', 'season', 'lateness']
data = {'weather': ['windy', 'calm'], 'season': ['summer', 'winter', 'spring', 'autumn'],
'lateness': ['ontime', 'delayed'], }
d_tree = dict()
n = len(structure) # length of the structure list
p... |
61,831,953 | I am looking for a way in python to make a dictionary of dictionaries based on the desired structure dynamically.
I have the data bellow:
```py
{'weather': ['windy', 'calm'], 'season': ['summer', 'winter', 'spring', 'autumn'], 'lateness': ['ontime', 'delayed']}
```
I give the structure I want them to be like:
``... | 2020/05/16 | [
"https://Stackoverflow.com/questions/61831953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4377632/"
] | You could use [`itertools.product`](https://docs.python.org/3.8/library/itertools.html#itertools.product) to get the cartesian product between the dictionary values(assuming you want the same key order). Then we can iterate every key except the last, insert/update dictionaries with `setdefault`. Then we can set the inn... | Yes, you can achieve this using the following code:
```
import copy
structure = ['weather', 'season', 'lateness']
data = {'weather': ['windy', 'calm'], 'season': ['summer', 'winter', 'spring', 'autumn'],
'lateness': ['ontime', 'delayed'], }
d_tree = dict()
n = len(structure) # length of the structure list
p... |
61,831,953 | I am looking for a way in python to make a dictionary of dictionaries based on the desired structure dynamically.
I have the data bellow:
```py
{'weather': ['windy', 'calm'], 'season': ['summer', 'winter', 'spring', 'autumn'], 'lateness': ['ontime', 'delayed']}
```
I give the structure I want them to be like:
``... | 2020/05/16 | [
"https://Stackoverflow.com/questions/61831953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4377632/"
] | Here's a recursive solution that is slightly different from the one provided by r.ook in the excellent accepted answer:
```
category_cases = {'weather': ['windy', 'calm'],
'season': ['summer', 'winter', 'spring', 'autumn'],
'lateness': ['ontime', 'delayed']}
order = ['weather', 'sea... | Yes, you can achieve this using the following code:
```
import copy
structure = ['weather', 'season', 'lateness']
data = {'weather': ['windy', 'calm'], 'season': ['summer', 'winter', 'spring', 'autumn'],
'lateness': ['ontime', 'delayed'], }
d_tree = dict()
n = len(structure) # length of the structure list
p... |
61,831,953 | I am looking for a way in python to make a dictionary of dictionaries based on the desired structure dynamically.
I have the data bellow:
```py
{'weather': ['windy', 'calm'], 'season': ['summer', 'winter', 'spring', 'autumn'], 'lateness': ['ontime', 'delayed']}
```
I give the structure I want them to be like:
``... | 2020/05/16 | [
"https://Stackoverflow.com/questions/61831953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4377632/"
] | If you're not avert to using external packages, [`pandas.DataFrame`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html#pandas.DataFrame) might be a viable candidate since it looks like you'll be using a table:
```
import pandas as pd
df = pd.DataFrame(
index=pd.MultiIndex.from_pro... | I think this might work for you.
```
def get_output(category, order, i=0):
output = {}
for key in order[i:i+1]:
for value in category[key]:
output[value] = get_output(category, order, i+1)
if output == {}:
return 0
return output
``` |
61,831,953 | I am looking for a way in python to make a dictionary of dictionaries based on the desired structure dynamically.
I have the data bellow:
```py
{'weather': ['windy', 'calm'], 'season': ['summer', 'winter', 'spring', 'autumn'], 'lateness': ['ontime', 'delayed']}
```
I give the structure I want them to be like:
``... | 2020/05/16 | [
"https://Stackoverflow.com/questions/61831953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4377632/"
] | If you're not avert to using external packages, [`pandas.DataFrame`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html#pandas.DataFrame) might be a viable candidate since it looks like you'll be using a table:
```
import pandas as pd
df = pd.DataFrame(
index=pd.MultiIndex.from_pro... | You could use [`itertools.product`](https://docs.python.org/3.8/library/itertools.html#itertools.product) to get the cartesian product between the dictionary values(assuming you want the same key order). Then we can iterate every key except the last, insert/update dictionaries with `setdefault`. Then we can set the inn... |
61,831,953 | I am looking for a way in python to make a dictionary of dictionaries based on the desired structure dynamically.
I have the data bellow:
```py
{'weather': ['windy', 'calm'], 'season': ['summer', 'winter', 'spring', 'autumn'], 'lateness': ['ontime', 'delayed']}
```
I give the structure I want them to be like:
``... | 2020/05/16 | [
"https://Stackoverflow.com/questions/61831953",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4377632/"
] | If you're not avert to using external packages, [`pandas.DataFrame`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html#pandas.DataFrame) might be a viable candidate since it looks like you'll be using a table:
```
import pandas as pd
df = pd.DataFrame(
index=pd.MultiIndex.from_pro... | Here's a recursive solution that is slightly different from the one provided by r.ook in the excellent accepted answer:
```
category_cases = {'weather': ['windy', 'calm'],
'season': ['summer', 'winter', 'spring', 'autumn'],
'lateness': ['ontime', 'delayed']}
order = ['weather', 'sea... |
37,912,206 | Given a list:
```
l1 = [0, 211, 576, 941, 1307, 1672, 2037]
```
What is the most pythonic way of getting the index of the last element of the list. Given that Python lists are zero-indexed, is it:
```
len(l1) - 1
```
Or, is it the following which uses Python's list operations:
```
l1.index(l1[-1])
```
Both ret... | 2016/06/19 | [
"https://Stackoverflow.com/questions/37912206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3096712/"
] | Only the first is correct:
```
>>> lst = [1, 2, 3, 4, 1]
>>> len(lst) - 1
4
>>> lst.index(lst[-1])
0
```
However it depends on what do you mean by "the index of the last element".
Note that `index` must traverse the whole list in order to provide an answer:
```
In [1]: %%timeit lst = list(range(100000))
...: ls... | You should use the first. Why?
```
>>> l1 = [1,2,3,4,3]
>>> l1.index(l1[-1])
2
``` |
37,912,206 | Given a list:
```
l1 = [0, 211, 576, 941, 1307, 1672, 2037]
```
What is the most pythonic way of getting the index of the last element of the list. Given that Python lists are zero-indexed, is it:
```
len(l1) - 1
```
Or, is it the following which uses Python's list operations:
```
l1.index(l1[-1])
```
Both ret... | 2016/06/19 | [
"https://Stackoverflow.com/questions/37912206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3096712/"
] | Only the first is correct:
```
>>> lst = [1, 2, 3, 4, 1]
>>> len(lst) - 1
4
>>> lst.index(lst[-1])
0
```
However it depends on what do you mean by "the index of the last element".
Note that `index` must traverse the whole list in order to provide an answer:
```
In [1]: %%timeit lst = list(range(100000))
...: ls... | Bakuriu's answer is great!
In addition, it should be mentioned that you rarely need this value. There are usually other and better ways to do what you want to do. Consider this answer as a sidenote :)
As you mention, getting the last element can be done this way:
```
lst = [1,2,4,2,3]
print lst[-1] # 3
```
If you... |
37,912,206 | Given a list:
```
l1 = [0, 211, 576, 941, 1307, 1672, 2037]
```
What is the most pythonic way of getting the index of the last element of the list. Given that Python lists are zero-indexed, is it:
```
len(l1) - 1
```
Or, is it the following which uses Python's list operations:
```
l1.index(l1[-1])
```
Both ret... | 2016/06/19 | [
"https://Stackoverflow.com/questions/37912206",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3096712/"
] | You should use the first. Why?
```
>>> l1 = [1,2,3,4,3]
>>> l1.index(l1[-1])
2
``` | Bakuriu's answer is great!
In addition, it should be mentioned that you rarely need this value. There are usually other and better ways to do what you want to do. Consider this answer as a sidenote :)
As you mention, getting the last element can be done this way:
```
lst = [1,2,4,2,3]
print lst[-1] # 3
```
If you... |
41,788,056 | I am following [this tutorial](https://cloud.google.com/endpoints/docs/frameworks/python/quickstart-frameworks-python) on setting up cloud endpoints in python on googles app engine and keep on getting an import error
```
ImportError: No module named control
```
on the **Generating the OpenAPI configuration file**... | 2017/01/22 | [
"https://Stackoverflow.com/questions/41788056",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5327279/"
] | You have to indent all the statements after your while loops and a single iteration version of your program should work. Proper indentation is critical in python. Lots of sites talk about python indentation (see [here](http://www.peachpit.com/articles/article.aspx?p=1312792&seqNum=3) for example). You were also missing... | First, you have to do your indentation correctly in the while-loop.
Second, your while loop only create the lists, `xs` and `ys`. That's why you can't keep the prompt and plot running again and again. So you have to use another loop to repeat your code above. Here is an example.
```
import matplotlib.pyplot as plt
imp... |
1,756,721 | I just updated Python to 2.6.4 on my Mac.
I installed from the dmg package.
The binary did not seem to correctly set my Python path, so I added `'/usr/local/lib/python2.6/site-packages'` in `.bash_profile`
```
>>> pprint.pprint(sys.path)
['',
'/Users/Bryan/work/django-trunk',
'/usr/local/lib/python2.6/site-packag... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86731/"
] | In case of upgrading your python on mac os 10.7 and pkg\_resources doesn't work, the simplest way to fix this is just reinstall setuptools as Ned mentioned above.
```
sudo pip install setuptools --upgrade
or sudo easy_install install setuptools --upgrade
``` | Try this only if you are ok with uninstalling python.
I uninstalled python using
```
brew uninstall python
```
then later installed using
```
brew install python
```
then it worked! |
1,756,721 | I just updated Python to 2.6.4 on my Mac.
I installed from the dmg package.
The binary did not seem to correctly set my Python path, so I added `'/usr/local/lib/python2.6/site-packages'` in `.bash_profile`
```
>>> pprint.pprint(sys.path)
['',
'/Users/Bryan/work/django-trunk',
'/usr/local/lib/python2.6/site-packag... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86731/"
] | On my system (OSX 10.6) that package is at
```
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py
```
I hope that helps you figure out if it's missing or just not on your path. | I got this error on **Ubuntu**, and the following worked for me:
Removed the dropbox binaries and download them again, by running:
```
sudo rm -rf /var/lib/dropbox/.dropbox-dist
dropbox start -i
``` |
1,756,721 | I just updated Python to 2.6.4 on my Mac.
I installed from the dmg package.
The binary did not seem to correctly set my Python path, so I added `'/usr/local/lib/python2.6/site-packages'` in `.bash_profile`
```
>>> pprint.pprint(sys.path)
['',
'/Users/Bryan/work/django-trunk',
'/usr/local/lib/python2.6/site-packag... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86731/"
] | The reason might be because the IPython module is not in your PYTHONPATH.
If you donwload IPython and then do
python setup.py install
The setup doesn't add the module IPython to your python path.
You might want to add it to your PYTHONPATH manually. It should work after you do :
export PYTHONPATH=/pathtoIPython:... | I got this error on **Ubuntu**, and the following worked for me:
Removed the dropbox binaries and download them again, by running:
```
sudo rm -rf /var/lib/dropbox/.dropbox-dist
dropbox start -i
``` |
1,756,721 | I just updated Python to 2.6.4 on my Mac.
I installed from the dmg package.
The binary did not seem to correctly set my Python path, so I added `'/usr/local/lib/python2.6/site-packages'` in `.bash_profile`
```
>>> pprint.pprint(sys.path)
['',
'/Users/Bryan/work/django-trunk',
'/usr/local/lib/python2.6/site-packag... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86731/"
] | [UPDATE] TL;DR `pkg_resources` is provided by either [Distribute](http://pypi.python.org/pypi/distribute/) or [setuptools](http://pypi.python.org/pypi/setuptools/).
[UPDATE 2] As announced at PyCon 2013, the `Distribute` and `setuptools` projects have re-merged. `Distribute` is now deprecated and you should just use ... | Try this only if you are ok with uninstalling python.
I uninstalled python using
```
brew uninstall python
```
then later installed using
```
brew install python
```
then it worked! |
1,756,721 | I just updated Python to 2.6.4 on my Mac.
I installed from the dmg package.
The binary did not seem to correctly set my Python path, so I added `'/usr/local/lib/python2.6/site-packages'` in `.bash_profile`
```
>>> pprint.pprint(sys.path)
['',
'/Users/Bryan/work/django-trunk',
'/usr/local/lib/python2.6/site-packag... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86731/"
] | The reason might be because the IPython module is not in your PYTHONPATH.
If you donwload IPython and then do
python setup.py install
The setup doesn't add the module IPython to your python path.
You might want to add it to your PYTHONPATH manually. It should work after you do :
export PYTHONPATH=/pathtoIPython:... | I encountered with the same problem when i am working on autobahn related project.
1) So I download the setuptools.-0.9.8.tar.gz form <https://pypi.python.org/packages/source/s/setuptools/> and extract it.
2 )Then i get the pkg\_resources module and copy it to the folder where it needed.
\*\*in my case that folder... |
1,756,721 | I just updated Python to 2.6.4 on my Mac.
I installed from the dmg package.
The binary did not seem to correctly set my Python path, so I added `'/usr/local/lib/python2.6/site-packages'` in `.bash_profile`
```
>>> pprint.pprint(sys.path)
['',
'/Users/Bryan/work/django-trunk',
'/usr/local/lib/python2.6/site-packag... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86731/"
] | [UPDATE] TL;DR `pkg_resources` is provided by either [Distribute](http://pypi.python.org/pypi/distribute/) or [setuptools](http://pypi.python.org/pypi/setuptools/).
[UPDATE 2] As announced at PyCon 2013, the `Distribute` and `setuptools` projects have re-merged. `Distribute` is now deprecated and you should just use ... | On my system (OSX 10.6) that package is at
```
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py
```
I hope that helps you figure out if it's missing or just not on your path. |
1,756,721 | I just updated Python to 2.6.4 on my Mac.
I installed from the dmg package.
The binary did not seem to correctly set my Python path, so I added `'/usr/local/lib/python2.6/site-packages'` in `.bash_profile`
```
>>> pprint.pprint(sys.path)
['',
'/Users/Bryan/work/django-trunk',
'/usr/local/lib/python2.6/site-packag... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86731/"
] | I encountered the same `ImportError`. Somehow the `setuptools` package had been deleted in my Python environment.
To fix the issue, run the setup script for `setuptools`:
```
curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | python
```
If you have any version of [`distribute`](http://pythonhost... | I realize this is not related to OSX, but on an embedded system (Beagle Bone Angstrom) I had the exact same error message. Installing the following ipk packages solved it.
```
opkg install python-setuptools
opkg install python-pip
``` |
1,756,721 | I just updated Python to 2.6.4 on my Mac.
I installed from the dmg package.
The binary did not seem to correctly set my Python path, so I added `'/usr/local/lib/python2.6/site-packages'` in `.bash_profile`
```
>>> pprint.pprint(sys.path)
['',
'/Users/Bryan/work/django-trunk',
'/usr/local/lib/python2.6/site-packag... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86731/"
] | I encountered the same `ImportError`. Somehow the `setuptools` package had been deleted in my Python environment.
To fix the issue, run the setup script for `setuptools`:
```
curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | python
```
If you have any version of [`distribute`](http://pythonhost... | Try this only if you are ok with uninstalling python.
I uninstalled python using
```
brew uninstall python
```
then later installed using
```
brew install python
```
then it worked! |
1,756,721 | I just updated Python to 2.6.4 on my Mac.
I installed from the dmg package.
The binary did not seem to correctly set my Python path, so I added `'/usr/local/lib/python2.6/site-packages'` in `.bash_profile`
```
>>> pprint.pprint(sys.path)
['',
'/Users/Bryan/work/django-trunk',
'/usr/local/lib/python2.6/site-packag... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86731/"
] | [UPDATE] TL;DR `pkg_resources` is provided by either [Distribute](http://pypi.python.org/pypi/distribute/) or [setuptools](http://pypi.python.org/pypi/setuptools/).
[UPDATE 2] As announced at PyCon 2013, the `Distribute` and `setuptools` projects have re-merged. `Distribute` is now deprecated and you should just use ... | I encountered with the same problem when i am working on autobahn related project.
1) So I download the setuptools.-0.9.8.tar.gz form <https://pypi.python.org/packages/source/s/setuptools/> and extract it.
2 )Then i get the pkg\_resources module and copy it to the folder where it needed.
\*\*in my case that folder... |
1,756,721 | I just updated Python to 2.6.4 on my Mac.
I installed from the dmg package.
The binary did not seem to correctly set my Python path, so I added `'/usr/local/lib/python2.6/site-packages'` in `.bash_profile`
```
>>> pprint.pprint(sys.path)
['',
'/Users/Bryan/work/django-trunk',
'/usr/local/lib/python2.6/site-packag... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86731/"
] | I encountered the same `ImportError`. Somehow the `setuptools` package had been deleted in my Python environment.
To fix the issue, run the setup script for `setuptools`:
```
curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | python
```
If you have any version of [`distribute`](http://pythonhost... | I encountered with the same problem when i am working on autobahn related project.
1) So I download the setuptools.-0.9.8.tar.gz form <https://pypi.python.org/packages/source/s/setuptools/> and extract it.
2 )Then i get the pkg\_resources module and copy it to the folder where it needed.
\*\*in my case that folder... |
42,838,366 | I think this question has been asked many times, but I can't find the answer. I am probably not using the correct words in my searches.
I am a beginner in python and I am learning to make simple games, with the pygame library. I would like to create a variable `character`, containing x and y coordinates.
I would like ... | 2017/03/16 | [
"https://Stackoverflow.com/questions/42838366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5682871/"
] | You could use a dictionary like this:
```
character = {'Name': 'Mary', 'xPos': 0, 'yPos': 0}
character['xPos'] = 10
``` | You can use dictionary.
```
character = dict()
character['x']= default_value
character['y']= default_value
```
You might want to have a look at this [Documentation](https://learnpythonthehardway.org/book/ex39.html) |
42,838,366 | I think this question has been asked many times, but I can't find the answer. I am probably not using the correct words in my searches.
I am a beginner in python and I am learning to make simple games, with the pygame library. I would like to create a variable `character`, containing x and y coordinates.
I would like ... | 2017/03/16 | [
"https://Stackoverflow.com/questions/42838366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5682871/"
] | A dict would work, but a [class](https://docs.python.org/3/tutorial/classes.html) is a better fit IMO.
```
class Character:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
arthur = Character(9, 9)
arthur.x = 15
```
*Due credit to [AChampion](https://stackoverflow.com/users/2750492/achampion)... | You can use dictionary.
```
character = dict()
character['x']= default_value
character['y']= default_value
```
You might want to have a look at this [Documentation](https://learnpythonthehardway.org/book/ex39.html) |
42,838,366 | I think this question has been asked many times, but I can't find the answer. I am probably not using the correct words in my searches.
I am a beginner in python and I am learning to make simple games, with the pygame library. I would like to create a variable `character`, containing x and y coordinates.
I would like ... | 2017/03/16 | [
"https://Stackoverflow.com/questions/42838366",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5682871/"
] | You could use a dictionary like this:
```
character = {'Name': 'Mary', 'xPos': 0, 'yPos': 0}
character['xPos'] = 10
``` | A dict would work, but a [class](https://docs.python.org/3/tutorial/classes.html) is a better fit IMO.
```
class Character:
def __init__(self, x=0, y=0):
self.x = x
self.y = y
arthur = Character(9, 9)
arthur.x = 15
```
*Due credit to [AChampion](https://stackoverflow.com/users/2750492/achampion)... |
39,919,586 | I know this is probably really easy question, but i'm struggling to split a string in python. My regex has group separators like this:
```
myRegex = "(\W+)"
```
And I want to parse this string into words:
```
testString = "This is my test string, hopefully I can get the word i need"
testAgain = re.split("(\W+)", te... | 2016/10/07 | [
"https://Stackoverflow.com/questions/39919586",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5613356/"
] | As described in this answer, [How to split but ignore separators in quoted strings, in python?](https://stackoverflow.com/questions/2785755/how-to-split-but-ignore-separators-in-quoted-strings-in-python), you can simply slice the array once it's split. It's easy to do so because you want every other member, starting wi... | You can simly do:
```
testAgain = testString.split() # built-in split with space
```
Different `regex` ways of doing this:
```
testAgain = re.split(r"\s+", testString) # split with space
testAgain = re.findall(r"\w+", testString) # find all words
testAgain = re.findall(r"\S+", testString) # find all non space ch... |
21,458,037 | I am using Ubuntu 12.04 LTS.
In Windows Azure account .cer file uploaded.
my python script is:
```
#!/usr/bin/python
from azure import *
from azure.servicemanagement import *
azureId = "XXXXXXXXXXXXXXXXXXXXX";
certificate_path= "/home/dharampal/Desktop/azure.pem";
sms = ServiceManagementService(azureId,certificate... | 2014/01/30 | [
"https://Stackoverflow.com/questions/21458037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3086379/"
] | I think your approach is extremely overly complicated for this. You should take a step back, think about what it is that you wish to accomplish, plan it out first, then start programming.
What you want to do is sort your array with a random sort order.
Create a new `IComparer` that returns the comparison randomly:
`... | You can randomly switch the values :
```
int n;
Console.WriteLine("Please enter a positive integer for the array size"); // asking the user for the int n
n = Int32.Parse(Console.ReadLine());
int[] array = new int[n]; // declaring the array
int[] newarray = new int[n];
Random rand = new Random();
for (int i = 0; i < ... |
21,458,037 | I am using Ubuntu 12.04 LTS.
In Windows Azure account .cer file uploaded.
my python script is:
```
#!/usr/bin/python
from azure import *
from azure.servicemanagement import *
azureId = "XXXXXXXXXXXXXXXXXXXXX";
certificate_path= "/home/dharampal/Desktop/azure.pem";
sms = ServiceManagementService(azureId,certificate... | 2014/01/30 | [
"https://Stackoverflow.com/questions/21458037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3086379/"
] | This is the simplest way to do it using a random comparison.
```
class Program
{
static Random rnd=new Random();
static void Main(string[] args)
{
int[] array= { 1, 2, 3, 4, 5, 6 };
int[] newarray=new int[array.Length];
array.CopyTo(newarray, 0);
Array.Sort(newarray, (i, j) ... | You can randomly switch the values :
```
int n;
Console.WriteLine("Please enter a positive integer for the array size"); // asking the user for the int n
n = Int32.Parse(Console.ReadLine());
int[] array = new int[n]; // declaring the array
int[] newarray = new int[n];
Random rand = new Random();
for (int i = 0; i < ... |
21,458,037 | I am using Ubuntu 12.04 LTS.
In Windows Azure account .cer file uploaded.
my python script is:
```
#!/usr/bin/python
from azure import *
from azure.servicemanagement import *
azureId = "XXXXXXXXXXXXXXXXXXXXX";
certificate_path= "/home/dharampal/Desktop/azure.pem";
sms = ServiceManagementService(azureId,certificate... | 2014/01/30 | [
"https://Stackoverflow.com/questions/21458037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3086379/"
] | I think your approach is extremely overly complicated for this. You should take a step back, think about what it is that you wish to accomplish, plan it out first, then start programming.
What you want to do is sort your array with a random sort order.
Create a new `IComparer` that returns the comparison randomly:
`... | use following code
```
int[] array = new int[n];
int[] randomPosition = new int[n];
Enumerable.Range(0, n ).ToList().ForEach(o => array[o] = o+1);
Random r = new Random();
Enumerable.Range(0, n).ToList().ForEach(o => randomPosition[o] = r.Next(0, n - 1));
foreach (var m in ra... |
21,458,037 | I am using Ubuntu 12.04 LTS.
In Windows Azure account .cer file uploaded.
my python script is:
```
#!/usr/bin/python
from azure import *
from azure.servicemanagement import *
azureId = "XXXXXXXXXXXXXXXXXXXXX";
certificate_path= "/home/dharampal/Desktop/azure.pem";
sms = ServiceManagementService(azureId,certificate... | 2014/01/30 | [
"https://Stackoverflow.com/questions/21458037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3086379/"
] | I think your approach is extremely overly complicated for this. You should take a step back, think about what it is that you wish to accomplish, plan it out first, then start programming.
What you want to do is sort your array with a random sort order.
Create a new `IComparer` that returns the comparison randomly:
`... | The reason you're not seeing any output is because the code isn't running to completion - it ends up bouncing between case 1 and 2 because
```
if (newarray[y] == newarray[z - 1])
```
is always true.
My recommendation would be to debug (i.e. step through) your code so you can really see why this is the case, then y... |
21,458,037 | I am using Ubuntu 12.04 LTS.
In Windows Azure account .cer file uploaded.
my python script is:
```
#!/usr/bin/python
from azure import *
from azure.servicemanagement import *
azureId = "XXXXXXXXXXXXXXXXXXXXX";
certificate_path= "/home/dharampal/Desktop/azure.pem";
sms = ServiceManagementService(azureId,certificate... | 2014/01/30 | [
"https://Stackoverflow.com/questions/21458037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3086379/"
] | It seems to get into an infinite loop. Try changing this bit:
```
case 2:
for (int z = y; z > 0; z--)
{
if (newarray[y] == newarray[z-1])
goto case 1;
}
break;
``` | use following code
```
int[] array = new int[n];
int[] randomPosition = new int[n];
Enumerable.Range(0, n ).ToList().ForEach(o => array[o] = o+1);
Random r = new Random();
Enumerable.Range(0, n).ToList().ForEach(o => randomPosition[o] = r.Next(0, n - 1));
foreach (var m in ra... |
21,458,037 | I am using Ubuntu 12.04 LTS.
In Windows Azure account .cer file uploaded.
my python script is:
```
#!/usr/bin/python
from azure import *
from azure.servicemanagement import *
azureId = "XXXXXXXXXXXXXXXXXXXXX";
certificate_path= "/home/dharampal/Desktop/azure.pem";
sms = ServiceManagementService(azureId,certificate... | 2014/01/30 | [
"https://Stackoverflow.com/questions/21458037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3086379/"
] | The reason you're not seeing any output is because the code isn't running to completion - it ends up bouncing between case 1 and 2 because
```
if (newarray[y] == newarray[z - 1])
```
is always true.
My recommendation would be to debug (i.e. step through) your code so you can really see why this is the case, then y... | use following code
```
int[] array = new int[n];
int[] randomPosition = new int[n];
Enumerable.Range(0, n ).ToList().ForEach(o => array[o] = o+1);
Random r = new Random();
Enumerable.Range(0, n).ToList().ForEach(o => randomPosition[o] = r.Next(0, n - 1));
foreach (var m in ra... |
21,458,037 | I am using Ubuntu 12.04 LTS.
In Windows Azure account .cer file uploaded.
my python script is:
```
#!/usr/bin/python
from azure import *
from azure.servicemanagement import *
azureId = "XXXXXXXXXXXXXXXXXXXXX";
certificate_path= "/home/dharampal/Desktop/azure.pem";
sms = ServiceManagementService(azureId,certificate... | 2014/01/30 | [
"https://Stackoverflow.com/questions/21458037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3086379/"
] | I think your approach is extremely overly complicated for this. You should take a step back, think about what it is that you wish to accomplish, plan it out first, then start programming.
What you want to do is sort your array with a random sort order.
Create a new `IComparer` that returns the comparison randomly:
`... | It seems to get into an infinite loop. Try changing this bit:
```
case 2:
for (int z = y; z > 0; z--)
{
if (newarray[y] == newarray[z-1])
goto case 1;
}
break;
``` |
21,458,037 | I am using Ubuntu 12.04 LTS.
In Windows Azure account .cer file uploaded.
my python script is:
```
#!/usr/bin/python
from azure import *
from azure.servicemanagement import *
azureId = "XXXXXXXXXXXXXXXXXXXXX";
certificate_path= "/home/dharampal/Desktop/azure.pem";
sms = ServiceManagementService(azureId,certificate... | 2014/01/30 | [
"https://Stackoverflow.com/questions/21458037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3086379/"
] | I think your approach is extremely overly complicated for this. You should take a step back, think about what it is that you wish to accomplish, plan it out first, then start programming.
What you want to do is sort your array with a random sort order.
Create a new `IComparer` that returns the comparison randomly:
`... | What you are trying to do is to generate a random permutation. You could try the following:
```
var rand = new Random();
var left = Enumerable.Range(1, n).ToList();
for(int i=0; i<n; ++i)
{
int j = rand.Next(n-i);
Console.Out.WriteLine(left[j]);
left[j].RemoveAt(j);
}
``` |
21,458,037 | I am using Ubuntu 12.04 LTS.
In Windows Azure account .cer file uploaded.
my python script is:
```
#!/usr/bin/python
from azure import *
from azure.servicemanagement import *
azureId = "XXXXXXXXXXXXXXXXXXXXX";
certificate_path= "/home/dharampal/Desktop/azure.pem";
sms = ServiceManagementService(azureId,certificate... | 2014/01/30 | [
"https://Stackoverflow.com/questions/21458037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3086379/"
] | I think your approach is extremely overly complicated for this. You should take a step back, think about what it is that you wish to accomplish, plan it out first, then start programming.
What you want to do is sort your array with a random sort order.
Create a new `IComparer` that returns the comparison randomly:
`... | You can do it like this:
```
...
n = Int32.Parse(Console.ReadLine());
// Initial array filled with 1..n values
int[] data = Enumerable.Range(1, n).ToArray();
// data array indice to show, initially 0..n-1
List<int> indice = Enumerable.Range(0, n - 1).ToList();
Random gen = new Random();
for (int i = 0; i < n; ++... |
21,458,037 | I am using Ubuntu 12.04 LTS.
In Windows Azure account .cer file uploaded.
my python script is:
```
#!/usr/bin/python
from azure import *
from azure.servicemanagement import *
azureId = "XXXXXXXXXXXXXXXXXXXXX";
certificate_path= "/home/dharampal/Desktop/azure.pem";
sms = ServiceManagementService(azureId,certificate... | 2014/01/30 | [
"https://Stackoverflow.com/questions/21458037",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3086379/"
] | I think your approach is extremely overly complicated for this. You should take a step back, think about what it is that you wish to accomplish, plan it out first, then start programming.
What you want to do is sort your array with a random sort order.
Create a new `IComparer` that returns the comparison randomly:
`... | This is the simplest way to do it using a random comparison.
```
class Program
{
static Random rnd=new Random();
static void Main(string[] args)
{
int[] array= { 1, 2, 3, 4, 5, 6 };
int[] newarray=new int[array.Length];
array.CopyTo(newarray, 0);
Array.Sort(newarray, (i, j) ... |
72,521,192 | Given a reproducible dataframe, I want to find the number of unique values in each column not including missing (NA) values. Below code counts NA values, as a result the cardinality of `nat_country` column shows as 4 in `n_unique_values` dataframe (it is supposed to be 3). In python there exists `nunique()` function wh... | 2022/06/06 | [
"https://Stackoverflow.com/questions/72521192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10617194/"
] | You can use `dplyr::n_distinct` with `na.rm = T`:
```r
library(dplyr)
sapply(dat, n_distinct, na.rm = T)
#map_dbl(dat, n_distinct, na.rm = T)
#nat_country age
# 3 8
```
---
In base R, you can use `na.omit` as well:
```r
sapply(dat, \(x) length(unique(na.omit(x))))
#nat_country ... | We could use `map` or `map_dfr` with `n_distinct`:
```
library(dplyr)
library(purrr)
dat %>%
map_dfr(., n_distinct, na.rm = TRUE)
nat_country age
<int> <int>
1 3 8
```
```
library(dplyr)
library(purrr)
dat %>%
map(., n_distinct, na.rm = TRUE) %>%
unlist()
```
```
nat_country ... |
72,521,192 | Given a reproducible dataframe, I want to find the number of unique values in each column not including missing (NA) values. Below code counts NA values, as a result the cardinality of `nat_country` column shows as 4 in `n_unique_values` dataframe (it is supposed to be 3). In python there exists `nunique()` function wh... | 2022/06/06 | [
"https://Stackoverflow.com/questions/72521192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10617194/"
] | You can use `dplyr::n_distinct` with `na.rm = T`:
```r
library(dplyr)
sapply(dat, n_distinct, na.rm = T)
#map_dbl(dat, n_distinct, na.rm = T)
#nat_country age
# 3 8
```
---
In base R, you can use `na.omit` as well:
```r
sapply(dat, \(x) length(unique(na.omit(x))))
#nat_country ... | In **base R** you can use `table`. It also has a parameter `useNA` if you want to change the default behavior.
```
sapply(dat, function(x) length(table(x)))
nat_country age
3 8
``` |
72,521,192 | Given a reproducible dataframe, I want to find the number of unique values in each column not including missing (NA) values. Below code counts NA values, as a result the cardinality of `nat_country` column shows as 4 in `n_unique_values` dataframe (it is supposed to be 3). In python there exists `nunique()` function wh... | 2022/06/06 | [
"https://Stackoverflow.com/questions/72521192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10617194/"
] | We could use `map` or `map_dfr` with `n_distinct`:
```
library(dplyr)
library(purrr)
dat %>%
map_dfr(., n_distinct, na.rm = TRUE)
nat_country age
<int> <int>
1 3 8
```
```
library(dplyr)
library(purrr)
dat %>%
map(., n_distinct, na.rm = TRUE) %>%
unlist()
```
```
nat_country ... | In **base R** you can use `table`. It also has a parameter `useNA` if you want to change the default behavior.
```
sapply(dat, function(x) length(table(x)))
nat_country age
3 8
``` |
41,604,223 | I am trying to read N lines of file in python.
This is my code
```
N = 10
counter = 0
lines = []
with open(file) as f:
if counter < N:
lines.append(f:next())
else:
break
```
Assuming the file is a super large text file. Is there anyway to write this better. I understand in production cod... | 2017/01/12 | [
"https://Stackoverflow.com/questions/41604223",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1939166/"
] | try using
`gem install nokogiri -v 1.7.0.1 -- --use-system-libraries=true --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2` | try:
gem update --system
then:
xcode-select --install
then:
gem install nokogiri
and finally:
install the rails gem |
68,368,323 | I want to run a Macro with python. I am doing:
```
import win32com.client as w3c
def ejecuntar_macro():
xlApp_mrapp = w3c.Dispatch("Excel.Application")
pw_str = str('Plantilla123')
mrapp = r'D:\Proyectos\Tablero estados\Tablero.xlsm'
xlApp_mrapp.Visible = True
xlApp_mrapp.DisplayAlerts = False
... | 2021/07/13 | [
"https://Stackoverflow.com/questions/68368323",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16053579/"
] | Use `text-align: center;`
Link: <https://developer.mozilla.org/en-US/docs/Web/CSS/text-align>
```html
<div style="text-align:center; width: 150px;">
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore... | Give the property `text-align: center` to the element containing the text. |
68,368,323 | I want to run a Macro with python. I am doing:
```
import win32com.client as w3c
def ejecuntar_macro():
xlApp_mrapp = w3c.Dispatch("Excel.Application")
pw_str = str('Plantilla123')
mrapp = r'D:\Proyectos\Tablero estados\Tablero.xlsm'
xlApp_mrapp.Visible = True
xlApp_mrapp.DisplayAlerts = False
... | 2021/07/13 | [
"https://Stackoverflow.com/questions/68368323",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16053579/"
] | Give the property `text-align: center` to the element containing the text. | Try doing this example (remember to replace text in div with your own).
`<div style="text-align: center; width=200px">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eu sapien vitae sem blandit pulvinar.</div>` |
68,368,323 | I want to run a Macro with python. I am doing:
```
import win32com.client as w3c
def ejecuntar_macro():
xlApp_mrapp = w3c.Dispatch("Excel.Application")
pw_str = str('Plantilla123')
mrapp = r'D:\Proyectos\Tablero estados\Tablero.xlsm'
xlApp_mrapp.Visible = True
xlApp_mrapp.DisplayAlerts = False
... | 2021/07/13 | [
"https://Stackoverflow.com/questions/68368323",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16053579/"
] | Use `text-align: center;`
Link: <https://developer.mozilla.org/en-US/docs/Web/CSS/text-align>
```html
<div style="text-align:center; width: 150px;">
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore... | Try doing this example (remember to replace text in div with your own).
`<div style="text-align: center; width=200px">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eu sapien vitae sem blandit pulvinar.</div>` |
60,306,244 | We are automating the process of creating/modifying tables on our database. We keep our ddls in github repo. Our objective is to drop and create the table again if the definition has changed. Otherwise, no change.
Lets say we have a table named `table1`
Steps:
```
1. Query database to get ddl for table1.
2. Get ddl... | 2020/02/19 | [
"https://Stackoverflow.com/questions/60306244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1768610/"
] | This is not currently supported, but I am 80% sure it is in the roadmap.
An alternative would be to use the SDK to create the same pipeline using `ModuleStep` where I *believe* you can reference a Designer Module by its name to use it like a `PythonScriptStep` | The export Designer graph to notebook is in our roadmap. For now, please take a look at the ModuleStep in SDK and let us know if you have any questions.
Thanks,
Lu Zhang | Senior Program Manager | Azure Machine Learning |
60,306,244 | We are automating the process of creating/modifying tables on our database. We keep our ddls in github repo. Our objective is to drop and create the table again if the definition has changed. Otherwise, no change.
Lets say we have a table named `table1`
Steps:
```
1. Query database to get ddl for table1.
2. Get ddl... | 2020/02/19 | [
"https://Stackoverflow.com/questions/60306244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1768610/"
] | This is not currently supported, but I am 80% sure it is in the roadmap.
An alternative would be to use the SDK to create the same pipeline using `ModuleStep` where I *believe* you can reference a Designer Module by its name to use it like a `PythonScriptStep` | Here are the instructions to Use the studio to [deploy models trained in the designer - Azure Machine Learning | Microsoft Docs](https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-model-designer) and document that explains how we can get access to score.py and conda\_env.yaml files under Output + lo... |
60,306,244 | We are automating the process of creating/modifying tables on our database. We keep our ddls in github repo. Our objective is to drop and create the table again if the definition has changed. Otherwise, no change.
Lets say we have a table named `table1`
Steps:
```
1. Query database to get ddl for table1.
2. Get ddl... | 2020/02/19 | [
"https://Stackoverflow.com/questions/60306244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1768610/"
] | The export Designer graph to notebook is in our roadmap. For now, please take a look at the ModuleStep in SDK and let us know if you have any questions.
Thanks,
Lu Zhang | Senior Program Manager | Azure Machine Learning | Here are the instructions to Use the studio to [deploy models trained in the designer - Azure Machine Learning | Microsoft Docs](https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-model-designer) and document that explains how we can get access to score.py and conda\_env.yaml files under Output + lo... |
2,859,081 | I'm trying to create a database connection in a python script to my DB2 database. When the connection is done I've to run some different SQL statements.
I googled the problem and has read the ibm\_db API (<http://code.google.com/p/ibm-db/wiki/APIs>) but just can't seem to get it right.
Here is what I got so far:
```... | 2010/05/18 | [
"https://Stackoverflow.com/questions/2859081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/188082/"
] | it should be:
```
query_str = "SELECT COUNT(*) FROM accounts"
conn = ibm_db.pconnect("dsn=write","usrname","secret")
query_stmt = ibm_db.prepare(conn, query_str)
ibm_db.execute(query_stmt)
``` | I'm sorry, of cause you need to error message. When trying to run my script it gives me this error:
```
Traceback (most recent call last):
File "test.py", line 16, in <module>
ibm_db.execute(query_stmt, "SELECT COUNT(*) FROM accounts")
Exception: Param is not a tuple
```
I'm pretty sure that it is my parameter... |
69,818,851 | I am running a simple React/Django app with webpack that is receiving this error on build:
```
ERROR in ./src/index.js
Module build failed (from ./node_modules/eslint-loader/dist/cjs.js):
TypeError: Cannot read properties of undefined (reading 'getFormatter')
at getFormatter (**[Relative path]**/frontend/node_modu... | 2021/11/03 | [
"https://Stackoverflow.com/questions/69818851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7359966/"
] | eslint-loader is deprecated:
<https://www.npmjs.com/package/eslint-loader>
You may use eslint-webpack-plugin instead:
<https://www.npmjs.com/package/eslint-webpack-plugin> | I found an issue <https://github.com/webpack-contrib/eslint-loader/issues/331> about this in the eslint-loader github, but I don't know if it will be useful for you.
. It would help to have a git repository to store the code that would be wrong for better testing. :) |
69,818,851 | I am running a simple React/Django app with webpack that is receiving this error on build:
```
ERROR in ./src/index.js
Module build failed (from ./node_modules/eslint-loader/dist/cjs.js):
TypeError: Cannot read properties of undefined (reading 'getFormatter')
at getFormatter (**[Relative path]**/frontend/node_modu... | 2021/11/03 | [
"https://Stackoverflow.com/questions/69818851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7359966/"
] | eslint-loader is deprecated:
<https://www.npmjs.com/package/eslint-loader>
You may use eslint-webpack-plugin instead:
<https://www.npmjs.com/package/eslint-webpack-plugin> | ```
"dependencies": {
"axios": "^0.24.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.6",
"react-router-dom": "^6.0.1",
"redux": "^4.1.2",
"redux-thunk": "^2.4.0",
"reselect": "^4.1.1"
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/node": "^7.1... |
69,818,851 | I am running a simple React/Django app with webpack that is receiving this error on build:
```
ERROR in ./src/index.js
Module build failed (from ./node_modules/eslint-loader/dist/cjs.js):
TypeError: Cannot read properties of undefined (reading 'getFormatter')
at getFormatter (**[Relative path]**/frontend/node_modu... | 2021/11/03 | [
"https://Stackoverflow.com/questions/69818851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7359966/"
] | eslint-loader is deprecated:
<https://www.npmjs.com/package/eslint-loader>
You may use eslint-webpack-plugin instead:
<https://www.npmjs.com/package/eslint-webpack-plugin> | eslint-loader has been deprecated now, and i change to use eslint-webpack-plugin which really works now!! I am so greatful, this problem has been troubling me a lot!
It really solve my problem thanks to the top answer, but I cannot comment directly on that answer due to my low reputation.
In addition, this is a plugin ... |
69,818,851 | I am running a simple React/Django app with webpack that is receiving this error on build:
```
ERROR in ./src/index.js
Module build failed (from ./node_modules/eslint-loader/dist/cjs.js):
TypeError: Cannot read properties of undefined (reading 'getFormatter')
at getFormatter (**[Relative path]**/frontend/node_modu... | 2021/11/03 | [
"https://Stackoverflow.com/questions/69818851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7359966/"
] | eslint-loader is deprecated:
<https://www.npmjs.com/package/eslint-loader>
You may use eslint-webpack-plugin instead:
<https://www.npmjs.com/package/eslint-webpack-plugin> | Find out that my versions of eslint and eslint-loader were incompatible
those works for me
"eslint": "^7.32.0",
"eslint-loader": "^4.0.2", |
51,113,531 | I am setting up `docker-for-windows` on my private pc.
When I set it up a while ago on my office laptop I had the same issue but it just stopped happening.
So I am stuck with this:
I have a docker-working project (on my other computer) with a `docker-compose.yml` like this:
```
version: '2'
services:
web:
de... | 2018/06/30 | [
"https://Stackoverflow.com/questions/51113531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1331671/"
] | I had same issue recently and the problems goes away using any advanced editor and changing line ending to unix style on sh entrypoint scripts.
In my case, not sure why, because git handle it very well depending on linux or windows host I ended up in same situation.
If you have files mounted in container and host(in w... | Do not use -d at the end.
Instead of this command
**docker-compose -f start\_tools.yaml up –d**
Use
**docker-compose -f start\_tools.yaml up** |
51,113,531 | I am setting up `docker-for-windows` on my private pc.
When I set it up a while ago on my office laptop I had the same issue but it just stopped happening.
So I am stuck with this:
I have a docker-working project (on my other computer) with a `docker-compose.yml` like this:
```
version: '2'
services:
web:
de... | 2018/06/30 | [
"https://Stackoverflow.com/questions/51113531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1331671/"
] | I had same issue recently and the problems goes away using any advanced editor and changing line ending to unix style on sh entrypoint scripts.
In my case, not sure why, because git handle it very well depending on linux or windows host I ended up in same situation.
If you have files mounted in container and host(in w... | On thing I noticed in Ubuntu 18.04.3 is that you need to install docker-compose on top of docker.io to get docker-compose to work
* sudo apt install docker.io
* sudo apt install docker-compose
After I did that, I got docker-compose [filename.yml] up to work without issue |
51,113,531 | I am setting up `docker-for-windows` on my private pc.
When I set it up a while ago on my office laptop I had the same issue but it just stopped happening.
So I am stuck with this:
I have a docker-working project (on my other computer) with a `docker-compose.yml` like this:
```
version: '2'
services:
web:
de... | 2018/06/30 | [
"https://Stackoverflow.com/questions/51113531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1331671/"
] | I had same issue recently and the problems goes away using any advanced editor and changing line ending to unix style on sh entrypoint scripts.
In my case, not sure why, because git handle it very well depending on linux or windows host I ended up in same situation.
If you have files mounted in container and host(in w... | You should issue the following command before cloning the repository:
```
git config --global core.autocrlf false
```
This will change the line-ending to UNIX-style.
Then clone the repository and proceed. |
51,113,531 | I am setting up `docker-for-windows` on my private pc.
When I set it up a while ago on my office laptop I had the same issue but it just stopped happening.
So I am stuck with this:
I have a docker-working project (on my other computer) with a `docker-compose.yml` like this:
```
version: '2'
services:
web:
de... | 2018/06/30 | [
"https://Stackoverflow.com/questions/51113531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1331671/"
] | You should issue the following command before cloning the repository:
```
git config --global core.autocrlf false
```
This will change the line-ending to UNIX-style.
Then clone the repository and proceed. | Do not use -d at the end.
Instead of this command
**docker-compose -f start\_tools.yaml up –d**
Use
**docker-compose -f start\_tools.yaml up** |
51,113,531 | I am setting up `docker-for-windows` on my private pc.
When I set it up a while ago on my office laptop I had the same issue but it just stopped happening.
So I am stuck with this:
I have a docker-working project (on my other computer) with a `docker-compose.yml` like this:
```
version: '2'
services:
web:
de... | 2018/06/30 | [
"https://Stackoverflow.com/questions/51113531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1331671/"
] | You should issue the following command before cloning the repository:
```
git config --global core.autocrlf false
```
This will change the line-ending to UNIX-style.
Then clone the repository and proceed. | If possible can you please provide all the files related to this, so that i can try to reproduce the issue.
Seems like command is not executing is the dir where run\_web\_local.sh exist.
You can check the current workdir by replacing command in docker-compose.yml as
`command: pwd && bash ./run_web_local.sh` |
51,113,531 | I am setting up `docker-for-windows` on my private pc.
When I set it up a while ago on my office laptop I had the same issue but it just stopped happening.
So I am stuck with this:
I have a docker-working project (on my other computer) with a `docker-compose.yml` like this:
```
version: '2'
services:
web:
de... | 2018/06/30 | [
"https://Stackoverflow.com/questions/51113531",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1331671/"
] | You should issue the following command before cloning the repository:
```
git config --global core.autocrlf false
```
This will change the line-ending to UNIX-style.
Then clone the repository and proceed. | It may be because the bash file is not in the root path or in the root path of workdir.
Check where is it in the container and verify if the path is correct. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.