All Questions
1,448 questions
0
votes
2
answers
885
views
Plotting a step-function supply curve using python
I have a dataframe in a rather annoying structure that makes it hard for me to plot it accurately. The data looks like the following:
Supplier
Price
Capacity
A
2
100
B
2.25
125
C
2.5
150
D
3
160
E
4
...
121
votes
3
answers
136k
views
Pandas plot() without a legend
Using the pandas library in python and using
.plot()
on a dataframe, how do I display the plot without a legend?
0
votes
1
answer
54
views
Matplotlib Plotting repeating steps in x axis
I have a dataframe like the following:
ID Parm_1 Parm_2 Result
0 100 100 0.2
1 100 200 0.4
3 100 300 0.9
4 100 400 0.45
5 ...
1
vote
1
answer
76
views
plotting vertical lines on pandas line plot with multiindex x axis
I have a dataframe whose index is a multiindex where axes[0] is the date, and axis[1] is the rank. Rank starts with 1 and ends at 100, but there can be a variable number of ranks in between as below.
...
0
votes
1
answer
77
views
Manipulate data in a DataFrame
I am very new to Python, so please bear with me. I have this dataframe called df_staging (sample image) that summarizes the annual sales and income for multiple counties (A1,A2,A3,A4,etc.).
I want to ...
1
vote
1
answer
43
views
Why does my plot have criss-crossing lines when I convert the index from string to datetime?
I am trying to plot a time series with plt.plot() but I am constantly observing some strange output. A sample of the dataset I am providing below (the whole dataset has roughly 150,000 entries). One ...
1
vote
2
answers
131
views
How to plot a Probability Density Function in Python?
I want to plot a Probability Density Function for the offsets from a log file.
Here is the code:
timestamps = []
sequences = []
log_Name = 'test_rtt_25-01-17_13-07-41_values5_rate50.log'
log_Path = &...
0
votes
0
answers
26
views
plot pre-computed mean and confidence intervals for two types of firms (python)
I want to plot two time-series lines with mean and CI each for low and high diversity firms (variable div_ind) throughout 8 calendar years (variable calyr). May I know how to do it? Online sources ...
1
vote
2
answers
287
views
How can i plot different plots for indexes of a dataframe?
I'm new to pandas and trying to learn and ran into this problem.
I've a dataframe and I am trying to plot the rows of the dataframe for each index value. I want different plots (subplots) for each ...
0
votes
1
answer
67
views
How to replace column value without losing the style?
This is my styled dataframe:
What I want is to change send the value of aEV to aEV_percentile, but without losing the styles, or to be much more specific, without losing the background color of ...
2
votes
0
answers
644
views
Streamlit plot 2 graphs
I'm new in Python and Streamlit, I have issues to plot two graphs on Streamlit.
On jupyter notebook it's working very well with this code:
train_size = X_train.shape[0]
f,axs = plt.subplots(1,2,...
0
votes
1
answer
72
views
Efficient Mapping of Average Scores Across Interval Windows
I have a df of genomic intervals with millions of rows for example:
chromosome start end
1 300 500
1 400 600
... ... ...
find the center of each interval (+/...
2
votes
1
answer
81
views
How to sort two columns in pandas dataframe and draw the heatmap from resulting dataframe?
I am trying to draw the heatmap from dataframe below:
methods
sub_1
sub_2
sub_3
sub_4
.....
distance
count_0
m1
0
2
2
1
.....
0
20
m2
1
2
2
1
.....
7
22
m3
1
2
2
1
.....
26
12
m4
0
2
2
0
.....
21
10
...
0
votes
2
answers
55
views
Why does matplotlibs bar seem to automatically order by the x-axis?
I have two arrays, one with identifier ids, and one with values, e.g
ids = [1,7,5]
values = [3.0, 9000.0, 2.7]
so 1 belongs to 3.0, 5 to 2.7,....
For whatever reason, no matter what I do, my ...
0
votes
2
answers
56
views
Why is my code subtitles still overlaping even after tight_layout()? [duplicate]
I tried looking it up but I am pretty new to coding and couldn't figure out, in all the examples I found the subtitles would stop overlapping after tight_layout. I am writing an anime code that shows ...