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

Pandas file IO Read Error
Pandas — asof() by last on DataFrame
Pandas Column Construction with np.where()
MultiIndex-based indexing in pandas
How to get the number of the most frequent value in a column?
Using pandas.ols on multiple dependent variables at once
Insert 0-values for missing dates within MultiIndex
Reindexing dataframes
pandas access axis by user-defined name
Trouble with groupss and aggregation
Replace MultiIndex's contents with DataFrame columns
What's the `DataFrameGroupBy`-equivalent of `dict.keys`?
How to split a dataframe according to a boolean criterion?
Pandas Rolling Computations on Sliding Windows (Unevenly spaced)
Resampling Minute data
How to get the last n row of pandas dataframe?

Categories

HOME
bluetooth
webpack
amazon-ec2
google-play
homebrew
bookshelf.js
setup-deployment
electronics
retrofit
esper
python-unittest
numeral.js
u-sql
etl
zend-framework3
ups
systemc
google-cloud-speech
jtextfield
autocad-plugin
xlsxwriter
orleans
tar
mustache.php
devops
microsoft-r
icloud-api
bootstrap-material-design
maxmind
elasticsearch-ruby
replaceall
webkitspeechrecognition
libssl
subdomains
yadcf
code-contracts
perlin-noise
rotational-matrices
mmenu
environment-modules
swisscomdev
xenforo
webix-treetable
sas-jmp
wso2carbon
angular-resource
zip4j
multipeer-connectivity
paxos
python-webbrowser
recursive-datastructures
setter
forever
sybase-asa
windows-iot-core-10
namecoin
angular-strap
firmata
instant
passport-google-oauth
elements
intrusion-detection
markojs
nsviewcontroller
react-native-listview
associative-array
uid
r-tree
atk4
coveralls
mmc
oberon
pretty-print
inmobi
directoryservices
clicktag
android-nested-fragment
file-copying
has-many-through
tld
mysql-error-1062
flexmojos
geos
tws
bulkloader
file-locking
gridcontrol
sqlperformance
tridion-worldserver
assembly-loading
pydot
xmlspy
locationlistener
rfc1123
servicehost
visitor-statistic
site.master
asp.net-mvc-areas
gin
user-friendly
zend-tool
libs
yagni
private-members

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