is there a way output 2 arrays separately in same cell in jupyter notebook
I am exploring a dataset, I need to print the array, here is what i got.
enter image description here
my question is:
is there a way output 2 arrays (a and a[::2]) in the same cell as there are enough space to do this? like this.
enter image description here
I've tried different print method, none works
python numpy jupyter-notebook
|
show 2 more comments
I am exploring a dataset, I need to print the array, here is what i got.
enter image description here
my question is:
is there a way output 2 arrays (a and a[::2]) in the same cell as there are enough space to do this? like this.
enter image description here
I've tried different print method, none works
python numpy jupyter-notebook
1
Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. On topic, how to ask, and ... the perfect question apply here. In particular, off-site links to details of your question are not acceptable.
– Prune
Oct 5 '18 at 0:46
Have you triedprint
ing both of them?
– Aviv Shai
Oct 5 '18 at 0:47
@Prune would please point out which is the 'off-site links' ?
– singularli
Oct 5 '18 at 0:55
@AvivShai yes, does not work
– singularli
Oct 5 '18 at 0:59
You posted two links: both are off site, both are images of text, each of which violates the posting guidelines.
– Prune
Oct 5 '18 at 15:45
|
show 2 more comments
I am exploring a dataset, I need to print the array, here is what i got.
enter image description here
my question is:
is there a way output 2 arrays (a and a[::2]) in the same cell as there are enough space to do this? like this.
enter image description here
I've tried different print method, none works
python numpy jupyter-notebook
I am exploring a dataset, I need to print the array, here is what i got.
enter image description here
my question is:
is there a way output 2 arrays (a and a[::2]) in the same cell as there are enough space to do this? like this.
enter image description here
I've tried different print method, none works
python numpy jupyter-notebook
python numpy jupyter-notebook
edited Jan 1 at 8:40
Cœur
18.6k9110150
18.6k9110150
asked Oct 5 '18 at 0:43
singularlisingularli
203
203
1
Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. On topic, how to ask, and ... the perfect question apply here. In particular, off-site links to details of your question are not acceptable.
– Prune
Oct 5 '18 at 0:46
Have you triedprint
ing both of them?
– Aviv Shai
Oct 5 '18 at 0:47
@Prune would please point out which is the 'off-site links' ?
– singularli
Oct 5 '18 at 0:55
@AvivShai yes, does not work
– singularli
Oct 5 '18 at 0:59
You posted two links: both are off site, both are images of text, each of which violates the posting guidelines.
– Prune
Oct 5 '18 at 15:45
|
show 2 more comments
1
Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. On topic, how to ask, and ... the perfect question apply here. In particular, off-site links to details of your question are not acceptable.
– Prune
Oct 5 '18 at 0:46
Have you triedprint
ing both of them?
– Aviv Shai
Oct 5 '18 at 0:47
@Prune would please point out which is the 'off-site links' ?
– singularli
Oct 5 '18 at 0:55
@AvivShai yes, does not work
– singularli
Oct 5 '18 at 0:59
You posted two links: both are off site, both are images of text, each of which violates the posting guidelines.
– Prune
Oct 5 '18 at 15:45
1
1
Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. On topic, how to ask, and ... the perfect question apply here. In particular, off-site links to details of your question are not acceptable.
– Prune
Oct 5 '18 at 0:46
Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. On topic, how to ask, and ... the perfect question apply here. In particular, off-site links to details of your question are not acceptable.
– Prune
Oct 5 '18 at 0:46
Have you tried
print
ing both of them?– Aviv Shai
Oct 5 '18 at 0:47
Have you tried
print
ing both of them?– Aviv Shai
Oct 5 '18 at 0:47
@Prune would please point out which is the 'off-site links' ?
– singularli
Oct 5 '18 at 0:55
@Prune would please point out which is the 'off-site links' ?
– singularli
Oct 5 '18 at 0:55
@AvivShai yes, does not work
– singularli
Oct 5 '18 at 0:59
@AvivShai yes, does not work
– singularli
Oct 5 '18 at 0:59
You posted two links: both are off site, both are images of text, each of which violates the posting guidelines.
– Prune
Oct 5 '18 at 15:45
You posted two links: both are off site, both are images of text, each of which violates the posting guidelines.
– Prune
Oct 5 '18 at 15:45
|
show 2 more comments
1 Answer
1
active
oldest
votes
@Aviv Shai 's answer is helpful
this answer gives a hint
display_side_by_side
here is my code
import pandas as pd
import numpy as np
from IPython.display import display_html
def display_arr_side_by_side(*arrays):
html_str=''
for arr in arrays:
df = pd.DataFrame(arr)
html_str+=df.to_html()
display_html(html_str.replace('table','table style="display:inline"'),raw=True)
a93 = np.arange(27).reshape((9,3))
display_arr_side_by_side(a93[:-1],a93[:-2])
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%2f52656853%2fis-there-a-way-output-2-arrays-separately-in-same-cell-in-jupyter-notebook%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
@Aviv Shai 's answer is helpful
this answer gives a hint
display_side_by_side
here is my code
import pandas as pd
import numpy as np
from IPython.display import display_html
def display_arr_side_by_side(*arrays):
html_str=''
for arr in arrays:
df = pd.DataFrame(arr)
html_str+=df.to_html()
display_html(html_str.replace('table','table style="display:inline"'),raw=True)
a93 = np.arange(27).reshape((9,3))
display_arr_side_by_side(a93[:-1],a93[:-2])
add a comment |
@Aviv Shai 's answer is helpful
this answer gives a hint
display_side_by_side
here is my code
import pandas as pd
import numpy as np
from IPython.display import display_html
def display_arr_side_by_side(*arrays):
html_str=''
for arr in arrays:
df = pd.DataFrame(arr)
html_str+=df.to_html()
display_html(html_str.replace('table','table style="display:inline"'),raw=True)
a93 = np.arange(27).reshape((9,3))
display_arr_side_by_side(a93[:-1],a93[:-2])
add a comment |
@Aviv Shai 's answer is helpful
this answer gives a hint
display_side_by_side
here is my code
import pandas as pd
import numpy as np
from IPython.display import display_html
def display_arr_side_by_side(*arrays):
html_str=''
for arr in arrays:
df = pd.DataFrame(arr)
html_str+=df.to_html()
display_html(html_str.replace('table','table style="display:inline"'),raw=True)
a93 = np.arange(27).reshape((9,3))
display_arr_side_by_side(a93[:-1],a93[:-2])
@Aviv Shai 's answer is helpful
this answer gives a hint
display_side_by_side
here is my code
import pandas as pd
import numpy as np
from IPython.display import display_html
def display_arr_side_by_side(*arrays):
html_str=''
for arr in arrays:
df = pd.DataFrame(arr)
html_str+=df.to_html()
display_html(html_str.replace('table','table style="display:inline"'),raw=True)
a93 = np.arange(27).reshape((9,3))
display_arr_side_by_side(a93[:-1],a93[:-2])
answered Oct 6 '18 at 1:43
singularlisingularli
203
203
add a comment |
add a comment |
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%2f52656853%2fis-there-a-way-output-2-arrays-separately-in-same-cell-in-jupyter-notebook%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
1
Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. On topic, how to ask, and ... the perfect question apply here. In particular, off-site links to details of your question are not acceptable.
– Prune
Oct 5 '18 at 0:46
Have you tried
print
ing both of them?– Aviv Shai
Oct 5 '18 at 0:47
@Prune would please point out which is the 'off-site links' ?
– singularli
Oct 5 '18 at 0:55
@AvivShai yes, does not work
– singularli
Oct 5 '18 at 0:59
You posted two links: both are off site, both are images of text, each of which violates the posting guidelines.
– Prune
Oct 5 '18 at 15:45