Category : facet-grid

Let’s say I have two DataFrames as follows: data1 = {‘feature1’: [23, 40, 11], ‘feature2’: [10, 14, 30], ‘feature3’:[13, 21, 18], ‘identifier’: [‘drug1’, ‘drug2’, ‘drug3’]} data2 = {‘feature1’: [15, 35, 16], ‘feature2’: [41, 28, 14], ‘feature3’:[17, 19, 24], ‘identifier’: [‘Control’, ‘Control’, ‘Control’]} df_Sample = pd.DataFrame(data1) df_Control = pd.DataFrame(data2) I have a data set for many ..

Read more

I have a code like this, and I want to add ticks on the X-axis so I could see better what the value over 150 corresponds to, for example. the range for my X-values is from 178 to 17639. bins = np.linspace(df.days_with_cr_line.min(), df.days_with_cr_line.max(), 32) g = sns.FacetGrid(df, col="loan_status", hue="loan_status", palette=[‘#8856a7’, ‘#f03b20’], col_wrap=2) g.map(plt.hist, ‘days_with_cr_line’, bins=bins, ..

Read more

I have a dataframe which looks like as follow: RY,Station,CAT,No of Events 2019,AT,Cause Unknown,1 2019,AT,Defective Equipment,6 2019,AT,Third-party Interference,1 2019,AT,Vegetation,5 2019,CH,Cause Unknown,2 2019,CH,Defective Equipment,5 2019,CH,Third-party Interference,1 2019,CH,Vegetation,4 2019,CP,Cause Unknown,1 2019,CP,Defective Equipment,1 2019,DF,Defective Equipment,2 2019,DF,Vegetation,1 2019,FH,Defective Equipment,3 2019,FH,Third-party Interference,1 2019,FK,Cause Unknown,1 2019,FK,Defective Equipment,2 2019,FK,Third-party Interference,4 2019,FK,Vegetation,1 2019,QB,Cause Unknown,2 2019,QB,Defective Equipment,2 2019,QB,Third-party Interference,1 2019,QT,Cause Unknown,1 2019,QT,Defective Equipment,3 2019,QT,Third-party ..

Read more

I’m trying to make a facetgrid/"trellis" plot of netCDF data using xarray and cartopy. For most data, projection and layout combinations I’ve tried the output is reasonable. However, in some cases, the maps appear as tiny blobs near the four corners of the plot, rendering the plot unreadable (see the image pr). I cannot reproduce ..

Read more

I am plotting a polar bar chart using the following code: import numpy as np import matplotlib.pyplot as plt import pandas as pd Row1, Row2, Row3 = [‘A’,180,2], [‘A’,270,6], [‘A’,360,3] df_polar = pd.DataFrame([Row1, Row2, Row3]) df_polar.columns = [‘Type’, ‘Angle’, ‘Count’] df_polar = df_polar.set_index(‘Angle’) deg = np.pi/180 Angle = np.array(df_polar.index.tolist()) theta = Angle = Angle * ..

Read more