accessing all keys in a dictionary simultaneouslyHow to merge two dictionaries in a single expression?How do I sort a list of dictionaries by a value of the dictionary?What is the best way to iterate over a dictionary?Accessing the index in 'for' loops?How do I sort a dictionary by value?Add new keys to a dictionary?Check if a given key already exists in a dictionaryHow do I list all files of a directory?Iterating over dictionaries using 'for' loopsHow to remove a key from a Python dictionary?
How can I tell if there was a power cut while I was out?
Replacing tongue and groove floorboards: but can't find a match
How do campaign rallies gain candidates votes?
Can two figures have the same area, perimeter, and same number of segments have different shape?
Invert Some Switches on a Switchboard
Does academia have a lazy work culture?
This message is flooding my syslog, how to find where it comes from?
How may I concisely assign different values to a variable, depending on another variable?
What are the exact meanings of roll, pitch and yaw?
How to get the two pictures aligned
Is there anything wrong with Thrawn?
How do we explain the E major chord in this progression?
Why is my read in of data taking so long?
Why is chess failing to attract big name sponsors?
Is my employer paying me fairly? Going from 1099 to W2
Airplanes in static display at Whiteman AFB
What is the max number of outlets on a GFCI circuit?
Inadvertently nuked my disk permission structure - why?
Automatic Habit of Meditation
Terence Tao–type books in other fields?
Why no ";" after "do" in sh loops?
A planet illuminated by a black hole?
Other than a swing wing, what types of variable geometry have flown?
Print sums of all subsets
accessing all keys in a dictionary simultaneously
How to merge two dictionaries in a single expression?How do I sort a list of dictionaries by a value of the dictionary?What is the best way to iterate over a dictionary?Accessing the index in 'for' loops?How do I sort a dictionary by value?Add new keys to a dictionary?Check if a given key already exists in a dictionaryHow do I list all files of a directory?Iterating over dictionaries using 'for' loopsHow to remove a key from a Python dictionary?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a dictionary in python which looks like this:
mydict=
"key1": np.array([1, 2, 3]),
"key2": np.array([4, 5, 6]),
"key3": np.array([7, 8, 9])
Now, I'd like to obtain the dictionary but with just the first the nth entry in each of the value arrays. Something like mydict2=mydict[:][1]
. The expected output would be:
mydict2=
"key1": 2
"key2": 5
"key3": 8
And I would like to get parts of all arrays simultaneously. For example mydict3=mydict[:][:2]
. Here, I expect:
mydict3=
"key1": np.array([1, 2]),
"key2": np.array([4, 5]),
"key3": np.array([7, 8])
Obviously, indexing via [:] doesn't work.
How do I achieve this?
python dictionary
add a comment |
I have a dictionary in python which looks like this:
mydict=
"key1": np.array([1, 2, 3]),
"key2": np.array([4, 5, 6]),
"key3": np.array([7, 8, 9])
Now, I'd like to obtain the dictionary but with just the first the nth entry in each of the value arrays. Something like mydict2=mydict[:][1]
. The expected output would be:
mydict2=
"key1": 2
"key2": 5
"key3": 8
And I would like to get parts of all arrays simultaneously. For example mydict3=mydict[:][:2]
. Here, I expect:
mydict3=
"key1": np.array([1, 2]),
"key2": np.array([4, 5]),
"key3": np.array([7, 8])
Obviously, indexing via [:] doesn't work.
How do I achieve this?
python dictionary
By simultaneously, you mean that you don't want to write code individually for each key?
– CristiFati
Mar 26 at 16:51
add a comment |
I have a dictionary in python which looks like this:
mydict=
"key1": np.array([1, 2, 3]),
"key2": np.array([4, 5, 6]),
"key3": np.array([7, 8, 9])
Now, I'd like to obtain the dictionary but with just the first the nth entry in each of the value arrays. Something like mydict2=mydict[:][1]
. The expected output would be:
mydict2=
"key1": 2
"key2": 5
"key3": 8
And I would like to get parts of all arrays simultaneously. For example mydict3=mydict[:][:2]
. Here, I expect:
mydict3=
"key1": np.array([1, 2]),
"key2": np.array([4, 5]),
"key3": np.array([7, 8])
Obviously, indexing via [:] doesn't work.
How do I achieve this?
python dictionary
I have a dictionary in python which looks like this:
mydict=
"key1": np.array([1, 2, 3]),
"key2": np.array([4, 5, 6]),
"key3": np.array([7, 8, 9])
Now, I'd like to obtain the dictionary but with just the first the nth entry in each of the value arrays. Something like mydict2=mydict[:][1]
. The expected output would be:
mydict2=
"key1": 2
"key2": 5
"key3": 8
And I would like to get parts of all arrays simultaneously. For example mydict3=mydict[:][:2]
. Here, I expect:
mydict3=
"key1": np.array([1, 2]),
"key2": np.array([4, 5]),
"key3": np.array([7, 8])
Obviously, indexing via [:] doesn't work.
How do I achieve this?
python dictionary
python dictionary
edited Mar 26 at 16:58
Martijn Pieters♦
749k161 gold badges2701 silver badges2428 bronze badges
749k161 gold badges2701 silver badges2428 bronze badges
asked Mar 26 at 16:46
riddleculousriddleculous
1561 silver badge9 bronze badges
1561 silver badge9 bronze badges
By simultaneously, you mean that you don't want to write code individually for each key?
– CristiFati
Mar 26 at 16:51
add a comment |
By simultaneously, you mean that you don't want to write code individually for each key?
– CristiFati
Mar 26 at 16:51
By simultaneously, you mean that you don't want to write code individually for each key?
– CristiFati
Mar 26 at 16:51
By simultaneously, you mean that you don't want to write code individually for each key?
– CristiFati
Mar 26 at 16:51
add a comment |
1 Answer
1
active
oldest
votes
What you are describing is a feature mostly offered by numpy, where slicing gives you views. Dictionaries are different beasts, partly because dictionaries are unordered.
You'll have to iterate in a dict comprehension:
mydict2 = k: v[1] for k, v in mydict.items()
and
mydict3 = k: v[:2] for k, v in mydict.items()
I'd simply not store numpy arrays in a dictionary, and use a larger array instead:
fullarray = np.arange(1, 10).reshape(3, 3)
and, at most, use a dictionary to map keys to slices on that array. These slices give you views so altering the full array is reflected in the references in the dictionary:
>>> import numpy as np
>>> fullarray = np.arange(1, 10).reshape(3, 3)
>>> mydict1 = 'key1': fullarray[0, :], 'key2': fullarray[1, :], 'key3': fullarray[2, :]
>>> mydict1
'key1': array([1, 2, 3]), 'key2': array([4, 5, 6]), 'key3': array([7, 8, 9])
>>> fullarray[:, 1]
array([2, 5, 8])
>>> fullarray[:, 1] *= 2
>>> fullarray[:, 1]
array([ 4, 10, 16])
>>> mydict1
'key1': array([1, 4, 3]), 'key2': array([ 4, 10, 6]), 'key3': array([ 7, 16, 9])
but accessing a column is just simpler via the full numpy array, so fullarray[:, 0]
and fullarray[:, :2]
.
Another option is to use structured arrays to produce rows with names:
>>> import numpy.lib.recfunctions as rfn
>>> structured = rfn.unstructured_to_structured(np.arange(1, 10).reshape((3, 3)).T, names=('key1', 'key2', 'key3'))
at which point indexing with a key name gives you arrays:
>>> structured['key1']
array([1, 2, 3]
but you can also index by 'column', including slicing:
>>> structured[0]
(1, 4, 7)
>>> structured[:2]
array([(1, 4, 7), (2, 5, 8)],
dtype=[('key1', '<i8'), ('key2', '<i8'), ('key3', '<i8')])
>>> structured[:2]['key1']
array([1, 2])
>>> structured[:2]['key2']
array([4, 5])
>>> structured[:2]['key3']
array([7, 8])
Converting an existing dictionary would require stacking the values:
import numpy as np
import numpy.lib.recfunctions as rfn
def dict_to_structured(d):
return rfn.unstructured_to_structured(
np.stack(list(mydict.values()), axis=1),
names=list(mydict)
)
thanks for the very pythonic-looking solution! This is exactly what I want. I am using dictionaries since that's what I get using scipy.signal.find_peaks. And thanks once more for the great idea of adding keys to an array.
– riddleculous
Mar 26 at 17:05
1
@riddleculous: you could convert the scipy result to a structured result too, I added an example function.
– Martijn Pieters♦
Mar 26 at 17:27
thanks also for the great example using structured arrays. I didn't try out conversion since at the moment I don't want to update to the latest numpy release but I will keep it in mind for the future.
– riddleculous
Mar 28 at 16:29
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55362309%2faccessing-all-keys-in-a-dictionary-simultaneously%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
What you are describing is a feature mostly offered by numpy, where slicing gives you views. Dictionaries are different beasts, partly because dictionaries are unordered.
You'll have to iterate in a dict comprehension:
mydict2 = k: v[1] for k, v in mydict.items()
and
mydict3 = k: v[:2] for k, v in mydict.items()
I'd simply not store numpy arrays in a dictionary, and use a larger array instead:
fullarray = np.arange(1, 10).reshape(3, 3)
and, at most, use a dictionary to map keys to slices on that array. These slices give you views so altering the full array is reflected in the references in the dictionary:
>>> import numpy as np
>>> fullarray = np.arange(1, 10).reshape(3, 3)
>>> mydict1 = 'key1': fullarray[0, :], 'key2': fullarray[1, :], 'key3': fullarray[2, :]
>>> mydict1
'key1': array([1, 2, 3]), 'key2': array([4, 5, 6]), 'key3': array([7, 8, 9])
>>> fullarray[:, 1]
array([2, 5, 8])
>>> fullarray[:, 1] *= 2
>>> fullarray[:, 1]
array([ 4, 10, 16])
>>> mydict1
'key1': array([1, 4, 3]), 'key2': array([ 4, 10, 6]), 'key3': array([ 7, 16, 9])
but accessing a column is just simpler via the full numpy array, so fullarray[:, 0]
and fullarray[:, :2]
.
Another option is to use structured arrays to produce rows with names:
>>> import numpy.lib.recfunctions as rfn
>>> structured = rfn.unstructured_to_structured(np.arange(1, 10).reshape((3, 3)).T, names=('key1', 'key2', 'key3'))
at which point indexing with a key name gives you arrays:
>>> structured['key1']
array([1, 2, 3]
but you can also index by 'column', including slicing:
>>> structured[0]
(1, 4, 7)
>>> structured[:2]
array([(1, 4, 7), (2, 5, 8)],
dtype=[('key1', '<i8'), ('key2', '<i8'), ('key3', '<i8')])
>>> structured[:2]['key1']
array([1, 2])
>>> structured[:2]['key2']
array([4, 5])
>>> structured[:2]['key3']
array([7, 8])
Converting an existing dictionary would require stacking the values:
import numpy as np
import numpy.lib.recfunctions as rfn
def dict_to_structured(d):
return rfn.unstructured_to_structured(
np.stack(list(mydict.values()), axis=1),
names=list(mydict)
)
thanks for the very pythonic-looking solution! This is exactly what I want. I am using dictionaries since that's what I get using scipy.signal.find_peaks. And thanks once more for the great idea of adding keys to an array.
– riddleculous
Mar 26 at 17:05
1
@riddleculous: you could convert the scipy result to a structured result too, I added an example function.
– Martijn Pieters♦
Mar 26 at 17:27
thanks also for the great example using structured arrays. I didn't try out conversion since at the moment I don't want to update to the latest numpy release but I will keep it in mind for the future.
– riddleculous
Mar 28 at 16:29
add a comment |
What you are describing is a feature mostly offered by numpy, where slicing gives you views. Dictionaries are different beasts, partly because dictionaries are unordered.
You'll have to iterate in a dict comprehension:
mydict2 = k: v[1] for k, v in mydict.items()
and
mydict3 = k: v[:2] for k, v in mydict.items()
I'd simply not store numpy arrays in a dictionary, and use a larger array instead:
fullarray = np.arange(1, 10).reshape(3, 3)
and, at most, use a dictionary to map keys to slices on that array. These slices give you views so altering the full array is reflected in the references in the dictionary:
>>> import numpy as np
>>> fullarray = np.arange(1, 10).reshape(3, 3)
>>> mydict1 = 'key1': fullarray[0, :], 'key2': fullarray[1, :], 'key3': fullarray[2, :]
>>> mydict1
'key1': array([1, 2, 3]), 'key2': array([4, 5, 6]), 'key3': array([7, 8, 9])
>>> fullarray[:, 1]
array([2, 5, 8])
>>> fullarray[:, 1] *= 2
>>> fullarray[:, 1]
array([ 4, 10, 16])
>>> mydict1
'key1': array([1, 4, 3]), 'key2': array([ 4, 10, 6]), 'key3': array([ 7, 16, 9])
but accessing a column is just simpler via the full numpy array, so fullarray[:, 0]
and fullarray[:, :2]
.
Another option is to use structured arrays to produce rows with names:
>>> import numpy.lib.recfunctions as rfn
>>> structured = rfn.unstructured_to_structured(np.arange(1, 10).reshape((3, 3)).T, names=('key1', 'key2', 'key3'))
at which point indexing with a key name gives you arrays:
>>> structured['key1']
array([1, 2, 3]
but you can also index by 'column', including slicing:
>>> structured[0]
(1, 4, 7)
>>> structured[:2]
array([(1, 4, 7), (2, 5, 8)],
dtype=[('key1', '<i8'), ('key2', '<i8'), ('key3', '<i8')])
>>> structured[:2]['key1']
array([1, 2])
>>> structured[:2]['key2']
array([4, 5])
>>> structured[:2]['key3']
array([7, 8])
Converting an existing dictionary would require stacking the values:
import numpy as np
import numpy.lib.recfunctions as rfn
def dict_to_structured(d):
return rfn.unstructured_to_structured(
np.stack(list(mydict.values()), axis=1),
names=list(mydict)
)
thanks for the very pythonic-looking solution! This is exactly what I want. I am using dictionaries since that's what I get using scipy.signal.find_peaks. And thanks once more for the great idea of adding keys to an array.
– riddleculous
Mar 26 at 17:05
1
@riddleculous: you could convert the scipy result to a structured result too, I added an example function.
– Martijn Pieters♦
Mar 26 at 17:27
thanks also for the great example using structured arrays. I didn't try out conversion since at the moment I don't want to update to the latest numpy release but I will keep it in mind for the future.
– riddleculous
Mar 28 at 16:29
add a comment |
What you are describing is a feature mostly offered by numpy, where slicing gives you views. Dictionaries are different beasts, partly because dictionaries are unordered.
You'll have to iterate in a dict comprehension:
mydict2 = k: v[1] for k, v in mydict.items()
and
mydict3 = k: v[:2] for k, v in mydict.items()
I'd simply not store numpy arrays in a dictionary, and use a larger array instead:
fullarray = np.arange(1, 10).reshape(3, 3)
and, at most, use a dictionary to map keys to slices on that array. These slices give you views so altering the full array is reflected in the references in the dictionary:
>>> import numpy as np
>>> fullarray = np.arange(1, 10).reshape(3, 3)
>>> mydict1 = 'key1': fullarray[0, :], 'key2': fullarray[1, :], 'key3': fullarray[2, :]
>>> mydict1
'key1': array([1, 2, 3]), 'key2': array([4, 5, 6]), 'key3': array([7, 8, 9])
>>> fullarray[:, 1]
array([2, 5, 8])
>>> fullarray[:, 1] *= 2
>>> fullarray[:, 1]
array([ 4, 10, 16])
>>> mydict1
'key1': array([1, 4, 3]), 'key2': array([ 4, 10, 6]), 'key3': array([ 7, 16, 9])
but accessing a column is just simpler via the full numpy array, so fullarray[:, 0]
and fullarray[:, :2]
.
Another option is to use structured arrays to produce rows with names:
>>> import numpy.lib.recfunctions as rfn
>>> structured = rfn.unstructured_to_structured(np.arange(1, 10).reshape((3, 3)).T, names=('key1', 'key2', 'key3'))
at which point indexing with a key name gives you arrays:
>>> structured['key1']
array([1, 2, 3]
but you can also index by 'column', including slicing:
>>> structured[0]
(1, 4, 7)
>>> structured[:2]
array([(1, 4, 7), (2, 5, 8)],
dtype=[('key1', '<i8'), ('key2', '<i8'), ('key3', '<i8')])
>>> structured[:2]['key1']
array([1, 2])
>>> structured[:2]['key2']
array([4, 5])
>>> structured[:2]['key3']
array([7, 8])
Converting an existing dictionary would require stacking the values:
import numpy as np
import numpy.lib.recfunctions as rfn
def dict_to_structured(d):
return rfn.unstructured_to_structured(
np.stack(list(mydict.values()), axis=1),
names=list(mydict)
)
What you are describing is a feature mostly offered by numpy, where slicing gives you views. Dictionaries are different beasts, partly because dictionaries are unordered.
You'll have to iterate in a dict comprehension:
mydict2 = k: v[1] for k, v in mydict.items()
and
mydict3 = k: v[:2] for k, v in mydict.items()
I'd simply not store numpy arrays in a dictionary, and use a larger array instead:
fullarray = np.arange(1, 10).reshape(3, 3)
and, at most, use a dictionary to map keys to slices on that array. These slices give you views so altering the full array is reflected in the references in the dictionary:
>>> import numpy as np
>>> fullarray = np.arange(1, 10).reshape(3, 3)
>>> mydict1 = 'key1': fullarray[0, :], 'key2': fullarray[1, :], 'key3': fullarray[2, :]
>>> mydict1
'key1': array([1, 2, 3]), 'key2': array([4, 5, 6]), 'key3': array([7, 8, 9])
>>> fullarray[:, 1]
array([2, 5, 8])
>>> fullarray[:, 1] *= 2
>>> fullarray[:, 1]
array([ 4, 10, 16])
>>> mydict1
'key1': array([1, 4, 3]), 'key2': array([ 4, 10, 6]), 'key3': array([ 7, 16, 9])
but accessing a column is just simpler via the full numpy array, so fullarray[:, 0]
and fullarray[:, :2]
.
Another option is to use structured arrays to produce rows with names:
>>> import numpy.lib.recfunctions as rfn
>>> structured = rfn.unstructured_to_structured(np.arange(1, 10).reshape((3, 3)).T, names=('key1', 'key2', 'key3'))
at which point indexing with a key name gives you arrays:
>>> structured['key1']
array([1, 2, 3]
but you can also index by 'column', including slicing:
>>> structured[0]
(1, 4, 7)
>>> structured[:2]
array([(1, 4, 7), (2, 5, 8)],
dtype=[('key1', '<i8'), ('key2', '<i8'), ('key3', '<i8')])
>>> structured[:2]['key1']
array([1, 2])
>>> structured[:2]['key2']
array([4, 5])
>>> structured[:2]['key3']
array([7, 8])
Converting an existing dictionary would require stacking the values:
import numpy as np
import numpy.lib.recfunctions as rfn
def dict_to_structured(d):
return rfn.unstructured_to_structured(
np.stack(list(mydict.values()), axis=1),
names=list(mydict)
)
edited Mar 26 at 17:27
answered Mar 26 at 16:52
Martijn Pieters♦Martijn Pieters
749k161 gold badges2701 silver badges2428 bronze badges
749k161 gold badges2701 silver badges2428 bronze badges
thanks for the very pythonic-looking solution! This is exactly what I want. I am using dictionaries since that's what I get using scipy.signal.find_peaks. And thanks once more for the great idea of adding keys to an array.
– riddleculous
Mar 26 at 17:05
1
@riddleculous: you could convert the scipy result to a structured result too, I added an example function.
– Martijn Pieters♦
Mar 26 at 17:27
thanks also for the great example using structured arrays. I didn't try out conversion since at the moment I don't want to update to the latest numpy release but I will keep it in mind for the future.
– riddleculous
Mar 28 at 16:29
add a comment |
thanks for the very pythonic-looking solution! This is exactly what I want. I am using dictionaries since that's what I get using scipy.signal.find_peaks. And thanks once more for the great idea of adding keys to an array.
– riddleculous
Mar 26 at 17:05
1
@riddleculous: you could convert the scipy result to a structured result too, I added an example function.
– Martijn Pieters♦
Mar 26 at 17:27
thanks also for the great example using structured arrays. I didn't try out conversion since at the moment I don't want to update to the latest numpy release but I will keep it in mind for the future.
– riddleculous
Mar 28 at 16:29
thanks for the very pythonic-looking solution! This is exactly what I want. I am using dictionaries since that's what I get using scipy.signal.find_peaks. And thanks once more for the great idea of adding keys to an array.
– riddleculous
Mar 26 at 17:05
thanks for the very pythonic-looking solution! This is exactly what I want. I am using dictionaries since that's what I get using scipy.signal.find_peaks. And thanks once more for the great idea of adding keys to an array.
– riddleculous
Mar 26 at 17:05
1
1
@riddleculous: you could convert the scipy result to a structured result too, I added an example function.
– Martijn Pieters♦
Mar 26 at 17:27
@riddleculous: you could convert the scipy result to a structured result too, I added an example function.
– Martijn Pieters♦
Mar 26 at 17:27
thanks also for the great example using structured arrays. I didn't try out conversion since at the moment I don't want to update to the latest numpy release but I will keep it in mind for the future.
– riddleculous
Mar 28 at 16:29
thanks also for the great example using structured arrays. I didn't try out conversion since at the moment I don't want to update to the latest numpy release but I will keep it in mind for the future.
– riddleculous
Mar 28 at 16:29
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55362309%2faccessing-all-keys-in-a-dictionary-simultaneously%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
By simultaneously, you mean that you don't want to write code individually for each key?
– CristiFati
Mar 26 at 16:51