pandas


ipython dataframe plotting setting color parameter?


I am trying to plot using pandas DataFrame directly as the index column will automatically change to x-axis.
However, I really don't know how to set the color condition using DataFrame. i.e
df1 = pd.DataFrame(b-z,index=frame1.index,columns=['delta'])
colors = np.where(df1.delta>0,'g','r')
df1.plot(ax=axes[0],marker='o',color=colors)
I don't know how to make it work
what is b? what is z? from the sounds of of things you need to make two calls to plot.
df1[df1.delta > 0].plot(ax=axes[0], marker='o', color='g')
df1[df1.delta <= 0].plot(ax=axes[0], marker='o', color='r')

Related Links

Merge two data frames based on common column values in Pandas
Combine two columns of numbers in dataframe into single column using pandas/python
Python Pandas has low CPU usage and not using all cores
Pandas Set on copy warning when using .loc
Merge very large csv using pandas or awk
seasonal_decompose: operands could not be broadcast together with shapes on a series
How to properly sample from a numpy.random.multivariate_normal (positive-semidefinite covariance matrix issue)
how to do logical operation between dataframe columns?
Console hangs up at the time of plotting
Pandas apply a function at fixed interval
float type column in pandas to convert to tuple/list
Getting an error with Pandas Panel boolean indexing
pandas dataframe subtraction causing nan
Pandas dataframe: truncate string fields
how to add new categorical column in pandas
Finding different Ids with the same value in pandas dataframe

Categories

HOME
hook
ngrx
rsyslog
leon
jsrender
retrofit
ravendb
mvvmcross
mouse
in-app-purchase
node-notifier
facebook-messenger-bot
google-translate
fancybox-3
dax
modx-revolution
commonmark
dtrace
hex-editors
netflix
progressive-web-apps
finite-automata
serilog
apache-metamodel
undefined
viewport
csrf-protection
css-animations
php-openssl
shopware
tdd
windowbuilder
microsoft-chart-controls
react-chartjs
iframe-resizer
fog
bower-install
hilbert-curve
xenforo
temporary-files
cookiecutter-django
sencha-touch-2.3
scrollable
azure-application-gateway
python-webbrowser
dandelion
return-value
directory-structure
dynamics-sl
pintos
medium.com
removechild
py2app
paypal-express
nsviewcontroller
lua-5.1
moveit
energy
reactive-banana
google-places
qdialog
libressl
coveralls
php-ci
oberon
p2
knuth
google-style-guide
rdl
bitcoinj
php-5.4
openexr
contenttype
jquery-layout
oracle-warehouse-builder
meteor-velocity
back-stack
mhtml
ocx
amazon-appstore
punbb
gnu-prolog
oncheckedchanged
mongomapper
digest-authentication
thunderbird-lightning
yagni
pascal-fc

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App