Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm looking for a way to create a graph like this but in Python where it's like a stacked bar chart but each segment is in it's own column. This was created in Tableau with the aggregate and one dimension in the columns section and the other variable as rows. I've been looking for awhile to no avail, any help would be greatly appreciated.
You can get something similar to your picture using
df.style.bar, e.g.:
df.style.bar(subset=['Col_1', 'Col_2', 'Col_3', 'Col_4', 'Col_5'],
width=75, vmin=0, color='lightgreen')
For a few initial rows from your sample I got the following
result:
Search the Web for documentation of this function and experiment
with changes in its parameters.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have a csv file that contains the attendance of a few students on particular dates.
Here is my csv file
Name,RollNumber,Attendance,Date,Day,Time
student1,1,Present,1/30/2019,Wednesday,12:34:05
student2,2,Present,1/30/2019,Wednesday,12:34:05
student3,3,Present,1/30/2019,Wednesday,12:34:05
student4,4,Present,1/30/2019,Wednesday,12:34:05
student1,1,Absent,1/31/2019,Thursday,23:34:05
student2,2,Present,1/31/2019,Thursday,23:34:05
student3,3,Present,1/31/2019,Thursday,23:34:05
student4,4,Present,1/31/2019,Thursday,12:34:05
student1,1,Present,2/1/2019,Friday,12:34:05
student2,2,Absent,2/1/2019,Friday,12:34:05
student3,3,Absent,2/1/2019,Friday,12:34:05
student4,4,Present,2/1/2019,Friday,12:34:05
student1,1,Absent,2/2/2019,Saturday,12:34:05
student2,2,Absent,2/2/2019,Saturday,12:34:05
student3,3,Absent,2/2/2019,Saturday,12:34:05
student4,4,Absent,2/2/2019,Saturday,12:34:05
I want to plot a graph that show the number of students present and absent on each date from the csv file. How do I do this with matplotlib?
The easiest way in my opinion is to work with pandas pivot_table as follow:
df = pd.read_csv('your_csv_filepath_here')
# Create a duplicate of your target value
df['attendance'] = a.Attendance
# Pivot your dataframe
df_pivot = df.pivot_table(index=['Date'], columns='Attendance', values='attendance', aggfunc='count')
# Plot it using pandas (barplot is probably what you want)
df_pivot.plot(kind='bar')
Of course further plot customizations are possible, as well as other methods would achieve the same result
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
My data was modelled with a Cox-regression, using R, however I would like to use this model into a python GUI. As my knowledge of R is very limited. This way non-coders would be able to 'predict' survival rates based on our model.
What is the best way that I could use this model (combination of 3 different regressions) in python?
Do you want to predict values based on your estimates?
In this case you can just copy the R outputs into python and apply to
respective procedures.
Do you want the user to be able to run "your R regression pipeline" from within Python?
There are python libraries that help with that. I find this
source a useful start.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am working on pattern recognition program using R/python. What would be the best way to compare two or more figures and identify/recognize the similar or duplicate figures based on pattern recognition?
There are lots of papers on the internet, we can try to get the idea how to extract and process feature in a fingerprint. For instance, http://www.cse.unr.edu/~bebis/CS790Q/PaperPresentations/MinutiaeDetection.pdf
Then you can use whatever classifier you want such as support vector machine.
If you need more idea you can visit http://dermatoglyphics.org/11-basic-patterns-of-fingerprint/ to generalize
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want to create a music player with Python which uses OpenGL for visualizing the audio spectrum.
I already have the 3d engine set up and all I need is to get the spectrum data and feed it to the renderer.
I'd imagine it would be a list of numbers updated each few miliseconds or so.
I've heard you can get that info with FMOD and there's pyfmodex Python wrapper for it, but I can't access the FMOD documentation and the pyfmodex is almost undocumented. Can't find what I need by just browsing the class/function names.
If there's another library which can get that info that will also work.
numpy has an FFT function that will compute a fast fourier transform on a block of input data. You can use its output to obtain your spectral information.