This code allows me to display panda dataframe contents in Jupyter notebook.
import pandas as pd
# create a simple dataset of people
data = {'Name': ["John", "Anna", "Peter", "Linda"],
'Location' : ["New York", "Paris", "Berlin", "London"],
'Age' : [24, 13, 53, 33]
}
data_pandas = pd.DataFrame(data)
# IPython.display allows "pretty printing" of dataframes
# in the Jupyter notebook
display(data_pandas)
However, I am not using Jupyter notebook. I am using pycharm and Anaconda (python v3.6). How should I display data_pandas
if I am not using Jupyter?
put data_pandas
in a cell and run that cell. It will display the content in output.
To be able to do the same thing in pycharm you will have to run anaconda notebook from pycharm. Which works like this: https://www.jetbrains.com/help/pycharm/2016.3/using-ipython-jupyter-notebook-with-pycharm.html
Then it's basically same as running a normal jupyter notebook on a different browser.
If you are running a normal python program and want an inline output, it's not going to happen. You will have to at least run an Ipython program to do so. Iteractive python.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With