Page MenuHomePhabricator

Create tool for informative infographics from structured information from Wikimedia projects - Task A
Open, Needs TriagePublic

Assigned To
Authored By
Ederporto
Feb 24 2024, 2:03 AM
Referenced Files
Restricted File
Mar 15 2024, 3:32 AM
F42634332: image.png
Mar 15 2024, 3:22 AM
F42627304: Screenshot 2024-03-14 at 20.49.06.png
Mar 14 2024, 8:04 PM
F42624113: Screenshot 2024-03-14 222908.png
Mar 14 2024, 5:02 PM
Restricted File
Mar 14 2024, 11:58 AM
Restricted File
Mar 14 2024, 11:58 AM
F42617939: Screenshot 2024-03-14 160452.png
Mar 14 2024, 10:35 AM
F42617716: Screenshot 2024-03-14 154850.png
Mar 14 2024, 10:19 AM

Description

IMPORTANT: Make sure to read the Outreachy participant instructions and communication guidelines thoroughly before commenting on this task. This space is for project-specific questions, so avoid asking questions about getting started, setting up Gerrit, etc. When in doubt, ask your question on Zulip first!

This is the first task for T357409: Create tool for informative infographics from structured information from Wikimedia projects.

Steps

Wikimedia hosts an Open Source deployment of Jupyter notebook, called PAWS, in which its users can use it to create and share documents wth live code and scripts. Here are the instructions to use it:

  1. You should create an Wikimedia account, if you don't already have one. You can do so at https://meta.wikimedia.org/w/index.php?title=Special:CreateAccount;
  2. Log in into the PAWS service with your wikimedia account: https://paws.wmflabs.org/paws/hub;
  3. Fork this notebook in your repository in PAWS (see the instructions here). Name your file as "T357409 - YourWikiUsername";
  4. Follow the specific directions in the notebook. If you have questions or need assistance, comment your inquiry in this subtask and make sure to ping @Ederporto;
  5. Once you feel you have completed your task, generate the public link of your notebook on PAWS (see the instructions here) and send it through email to @Ederporto (you can find his email in Outreachy);
  6. You can request feedback on your task until March 17, and we will answer to you until March 22, in order to give you ample time to work on the feedback and your final submission;
  7. Make sure to register the public link as a contribution on the Outreachy website. Your final contribution has to be submitted before April 2, at 4pm UTC.

If you still have doubts, please refer to this comment.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

No

Can you share the final function you wrote, so that I can run it locally and see what the error is?

Screenshot 2024-03-14 154850.png (485×767 px, 29 KB)

Please help me out, unable to get it correct!

Screenshot 2024-03-14 154850.png (485×767 px, 29 KB)

Please help me out, unable to get it correct!

Have you tried it without writing display? I mean simply call it ? Can you pls share the code and not the screenshot , so that i can copy it .

import warnings
warnings.filterwarnings("ignore", category=UserWarning)
import IPython.display as display

df_converted = top_viewed_dataframe.T
df_converted.fillna(0,inplace=True)

print(df_converted)

column_names = list(df_converted.columns)
Subsetdf = df_converted[column_names]
cum_sum_df = Subsetdf.cumsum(axis=0)

print(cum_sum_df)

def dataframe_to_race_chart(df=cum_sum_df):

video = bcr.bar_chart_race(df)
return video

dataframe_to_race_chart(df=cum_sum_df)

Screenshot 2024-03-14 160452.png (398×819 px, 23 KB)

While implementing the same code in PAWS, I encountered this warning.

Screenshot 2024-03-14 160452.png (398×819 px, 23 KB)

While implementing the same code in PAWS, I encountered this warning.

This is just the warning let it complete .

Screenshot 2024-03-14 143830.png (511×1 px, 36 KB)

I have tried implementing bar-chart-race locally on my machine as well as also tried on PAWS as one of the applicant advised above , but unable to play the video. Can anyone here help me with this issue and rectify my error?
@Ederporto

When you play video what is the error. Does it play but shows gibberish?
Can you provide more info

@Mitumoni_kalita for now avoid filtering warining unless you are able to play the video since warnings/error might contain useful info.

Has the video file appeared in your folder?

import warnings
warnings.filterwarnings("ignore", category=UserWarning)
import IPython.display as display

df_converted = top_viewed_dataframe.T
df_converted.fillna(0,inplace=True)

print(df_converted)

column_names = list(df_converted.columns)
Subsetdf = df_converted[column_names]
cum_sum_df = Subsetdf.cumsum(axis=0)

print(cum_sum_df)

def dataframe_to_race_chart(df=cum_sum_df):

video = bcr.bar_chart_race(df)
return video

dataframe_to_race_chart(df=cum_sum_df)

This code is working correctly on my side , displaying the output video in Jupyter notebook , Now i think that the error on your side might be in your top_viewed_dataframe.
{F42619183} The graph's appearance relies heavily on the structure and data within the top_viewed_dataframe. Therefore, any deviations from the expected graph might be due to issues in that dataframe.

{F42619228} Here is how the cum_sum_df appears when my top_viewed_dataframe is used.

@Mitumoni_kalita
If displaying the graph is taking too much time, you can expedite the process by using a shorter dataframe. You can achieve this by utilizing the cum_sum_df.iloc[:,:20] slice, limiting the dataframe to the first 20 columns. This adjustment should streamline the graph generation process and allow for quicker visualization.

Screenshot 2024-03-14 160452.png (398×819 px, 23 KB)

While implementing the same code in PAWS, I encountered this warning.

How's your dataframe like? This warning shows that df.fillna() is deprecated, it doesn't mean the video shouldn't play.
Check these first:

  • Is the video stored in your directory? If it is, simply run these:
from IPython.display import Video
Video("filename.mp4", embed=True)
  • If the video isn't in your directory, then it hasn't been generated at all.

Check these:

  • Convert all data in your dataFrame to numeric (df.apply(pd.to_numeric, errors='coerce'))
  • NB: The generation takes time if you're using the entire dataframe. In the generation function, limit your n_bars to 8
  • Then try again

If none of these work, we'd have to see your dataframe or its code portion.

Hello @Ederporto, for the project proposal, do we need to create one in Wikimedia Phabricator since we will also be submitting one on the Outreachy website?

You don't need to create anything on Phabricator, no.

Okay, thank you @Ederporto.

@Ederporto Could you please provide a timeline of the work we plan to accomplish on the project, outlining the tasks we will complete at each step.

Hi, I found some good examples of project timelines from past Wikimedia Outreachy interns, which may help. You can take a look at the links below:

https://phabricator.wikimedia.org/T161670
https://phabricator.wikimedia.org/T177507
https://phabricator.wikimedia.org/T333790

@all Please can you help me in removing false positive cases? @Ederporto please guide me in this.

Hi, I found some good examples of project timelines from past Wikimedia Outreachy interns, which may help. You can take a look at the links below:

https://phabricator.wikimedia.org/T161670
https://phabricator.wikimedia.org/T177507
https://phabricator.wikimedia.org/T333790

@Abishek_Das
Great one, thanks, this gives us a structure of what is expected.

Hi, I found some good examples of project timelines from past Wikimedia Outreachy interns, which may help. You can take a look at the links below:

https://phabricator.wikimedia.org/T161670
https://phabricator.wikimedia.org/T177507
https://phabricator.wikimedia.org/T333790

Thankyou @Abishek_Das , But I am looking forward to timeline of the work we plan to accomplish on the project. Outlines of the task we will be doing .

Hello everyone, I am also an Outreachy applicant for 2024.

Today, I discovered the message on Phabricator; however, I initially assumed that all discussions were taking place in the Zulip channel. Consequently, I didn't check the Phabricator comments section.

To keep it concise, I'd like to address how to make FFmpeg work on the PAWS Jupyter Notebook for the task "Create a tool for informative infographics from structured information from Wikimedia projects - Task A."

The reason FFmpeg isn't functioning on the PAWS Jupyter Notebook is that we need to download and add FFmpeg Static Builds from (https://johnvansickle.com/ffmpeg/) to the same folder where we have the code.

Here's a step-by-step guide (So, you don't have to go through the trouble of downloading from https://johnvansickle.com/ffmpeg/):

Note: Before you do the step mentioned in point (a), make sure all the steps, i.e., b, c, d, and e, are done first.

a) I've attached code that you can add to your Jupyter Notebook cell (Same notebook where you have your code to generate the bar chart race). Run this code to resolve the FFmpeg issue.

# Download a static FFmpeg build and add it to PATH.
%run 'util/load-ffmpeg.ipynb'
print('Done!')

b) Prior to running the code mentioned in point (a), add/upload the "util" folder to your PAWS. I've included the folder below.


(You, have to unzip it after downloading)

c) The purpose of the "util" folder is to automatically add the FFmpeg Static Build File (which is a folder) to your PAWS when you run the provided code mentioned in point (a).

d) Ensure that the filename in bcr.bar_chart_race() has a ".mp4" extension.

e) After completing these steps, you can run your respective code, which is the code for generating the bar chart race.

Note:

a) You might encounter a warning / Error (Which again doesn't appear when I run my code locally and only sometimes appears on my PAWS Jupyter Notebook), as shown in the attached screenshot. However, this is not an issue, as the video file will be generated in the PAWS folder after running your code. You can then download the bar chart race video and watch the video(as shown the screenshot below).

Code for ffmpeg.png (239×992 px, 48 KB)

mp 4.png (32×418 px, 2 KB)

b) If your code works correctly locally, it should generally (90%-99% of the time) work on the PAWS online Jupyter Notebook.

c) The warning or error screenshot I provided may or may not appear (Which happens to me only on PAWS), so be mindful of that.

d) Ensure that the filename in bcr.bar_chart_race() has a ".mp4" extension, as the ".html" filename won't appear on PAWS. But, Again, the .html works locally.

e) Why the .html doesn't appear on PAWS, I have no idea about it, and I have still not looked for a solution related to .html since the .mp4 file is generated on PAWS without any issue.

f) All the things I have mentioned on how to solve the issue related to FFmpeg were taken from various documentation like Matplotlib 3.8.3 documentation and, of course, my favorite stack overflow (So, thanks to the Devs on Stack Overflow).

Thank you so much for this

Hi, I found some good examples of project timelines from past Wikimedia Outreachy interns, which may help. You can take a look at the links below:

https://phabricator.wikimedia.org/T161670
https://phabricator.wikimedia.org/T177507
https://phabricator.wikimedia.org/T333790

Thankyou @Abishek_Das , But I am looking forward to timeline of the work we plan to accomplish on the project. Outlines of the task we will be doing .

Welcome, @MahimaSinghal. Yes, it would be nice if the outlines of the task we will be doing are given, unless we have to figure that out ourselves.

Hello everyone, I am also an Outreachy applicant for 2024.

Today, I discovered the message on Phabricator; however, I initially assumed that all discussions were taking place in the Zulip channel. Consequently, I didn't check the Phabricator comments section.

To keep it concise, I'd like to address how to make FFmpeg work on the PAWS Jupyter Notebook for the task "Create a tool for informative infographics from structured information from Wikimedia projects - Task A."

The reason FFmpeg isn't functioning on the PAWS Jupyter Notebook is that we need to download and add FFmpeg Static Builds from (https://johnvansickle.com/ffmpeg/) to the same folder where we have the code.

Here's a step-by-step guide (So, you don't have to go through the trouble of downloading from https://johnvansickle.com/ffmpeg/):

Note: Before you do the step mentioned in point (a), make sure all the steps, i.e., b, c, d, and e, are done first.

a) I've attached code that you can add to your Jupyter Notebook cell (Same notebook where you have your code to generate the bar chart race). Run this code to resolve the FFmpeg issue.

# Download a static FFmpeg build and add it to PATH.
%run 'util/load-ffmpeg.ipynb'
print('Done!')

b) Prior to running the code mentioned in point (a), add/upload the "util" folder to your PAWS. I've included the folder below.


(You, have to unzip it after downloading)

c) The purpose of the "util" folder is to automatically add the FFmpeg Static Build File (which is a folder) to your PAWS when you run the provided code mentioned in point (a).

d) Ensure that the filename in bcr.bar_chart_race() has a ".mp4" extension.

e) After completing these steps, you can run your respective code, which is the code for generating the bar chart race.

Note:

a) You might encounter a warning / Error (Which again doesn't appear when I run my code locally and only sometimes appears on my PAWS Jupyter Notebook), as shown in the attached screenshot. However, this is not an issue, as the video file will be generated in the PAWS folder after running your code. You can then download the bar chart race video and watch the video(as shown the screenshot below).

Code for ffmpeg.png (239×992 px, 48 KB)

mp 4.png (32×418 px, 2 KB)

b) If your code works correctly locally, it should generally (90%-99% of the time) work on the PAWS online Jupyter Notebook.

c) The warning or error screenshot I provided may or may not appear (Which happens to me only on PAWS), so be mindful of that.

d) Ensure that the filename in bcr.bar_chart_race() has a ".mp4" extension, as the ".html" filename won't appear on PAWS. But, Again, the .html works locally.

e) Why the .html doesn't appear on PAWS, I have no idea about it, and I have still not looked for a solution related to .html since the .mp4 file is generated on PAWS without any issue.

f) All the things I have mentioned on how to solve the issue related to FFmpeg were taken from various documentation like Matplotlib 3.8.3 documentation and, of course, my favorite stack overflow (So, thanks to the Devs on Stack Overflow).

Thank you so much for this

Welcome, @Valentina_Buoro

Screenshot 2024-03-14 143830.png (511×1 px, 36 KB)

I have tried implementing bar-chart-race locally on my machine as well as also tried on PAWS as one of the applicant advised above , but unable to play the video. Can anyone here help me with this issue and rectify my error?
@Ederporto

When you play video what is the error. Does it play but shows gibberish?
Can you provide more info

@Mitumoni_kalita for now avoid filtering warining unless you are able to play the video since warnings/error might contain useful info.

Has the video file appeared in your folder?

yes, it hasappeared; only the video is not playing.

Screenshot 2024-03-14 222908.png (435×1 px, 40 KB)

This is the dataframe structure that I have generated of the cumulative sum which is sent to the bar_chart_race function, please confirm me if this is the correct structure that i have generated. let me know if I have made any error

Are you including all the 7519 columns in your video 😅?

Screenshot 2024-03-14 222908.png (435×1 px, 40 KB)

This is the dataframe structure that I have generated of the cumulative sum which is sent to the bar_chart_race function, please confirm me if this is the correct structure that i have generated. let me know if I have made any error

Screenshot 2024-03-14 143830.png (511×1 px, 36 KB)

I have tried implementing bar-chart-race locally on my machine as well as also tried on PAWS as one of the applicant advised above , but unable to play the video. Can anyone here help me with this issue and rectify my error?
@Ederporto

When you play video what is the error. Does it play but shows gibberish?
Can you provide more info

@Mitumoni_kalita for now avoid filtering warining unless you are able to play the video since warnings/error might contain useful info.

Has the video file appeared in your folder?

yes, it hasappeared; only the video is not playing.

Try to right click on the video file, then download it to your computer. I had a similar issue but when I downloaded it , VLC played it.
Also try embedding it in your notebook like one person suggested.

Are you including all the 7519 columns in your video 😅?

Screenshot 2024-03-14 222908.png (435×1 px, 40 KB)

This is the dataframe structure that I have generated of the cumulative sum which is sent to the bar_chart_race function, please confirm me if this is the correct structure that i have generated. let me know if I have made any error

How should I proceed?

Are you including all the 7519 columns in your video 😅?

Screenshot 2024-03-14 222908.png (435×1 px, 40 KB)

This is the dataframe structure that I have generated of the cumulative sum which is sent to the bar_chart_race function, please confirm me if this is the correct structure that i have generated. let me know if I have made any error

How should I proceed?

Hmm, if you're including 7519 columns, it will take time. For now, just add 5 rows and 5 columns, or 10 rows by 10 columns. I think I read in the bar chart documentation that the more rows and columns you have, the longer it takes to render.Since, it generates frame by frame something like that. Also, only play the video after your cell is done running.

Are you including all the 7519 columns in your video 😅?

Screenshot 2024-03-14 222908.png (435×1 px, 40 KB)

This is the dataframe structure that I have generated of the cumulative sum which is sent to the bar_chart_race function, please confirm me if this is the correct structure that i have generated. let me know if I have made any error

Thank you so much to all, It worked.

How should I proceed?

Hmm, if you're including 7519 columns, it will take time. For now, just add 5 rows and 5 columns, or 10 rows by 10 columns. I think I read in the bar chart documentation that the more rows and columns you have, the longer it takes to render.Since, it generates frame by frame something like that. Also, only play the video after your cell is done running.

Are you including all the 7519 columns in your video 😅?

Screenshot 2024-03-14 222908.png (435×1 px, 40 KB)

This is the dataframe structure that I have generated of the cumulative sum which is sent to the bar_chart_race function, please confirm me if this is the correct structure that i have generated. let me know if I have made any error

Thank you so much to all, It worked.

How should I proceed?

Hmm, if you're including 7519 columns, it will take time. For now, just add 5 rows and 5 columns, or 10 rows by 10 columns. I think I read in the bar chart documentation that the more rows and columns you have, the longer it takes to render.Since, it generates frame by frame something like that. Also, only play the video after your cell is done running.

Great 🥳

Are you including all the 7519 columns in your video 😅?

Screenshot 2024-03-14 222908.png (435×1 px, 40 KB)

This is the dataframe structure that I have generated of the cumulative sum which is sent to the bar_chart_race function, please confirm me if this is the correct structure that i have generated. let me know if I have made any error

Thank you so much to all, It worked.

How should I proceed?

Hmm, if you're including 7519 columns, it will take time. For now, just add 5 rows and 5 columns, or 10 rows by 10 columns. I think I read in the bar chart documentation that the more rows and columns you have, the longer it takes to render.Since, it generates frame by frame something like that. Also, only play the video after your cell is done running.

Great 🥳

What should I do next? record this as a contribution or send PAWS link to @Ederporto

Are you including all the 7519 columns in your video 😅?

Screenshot 2024-03-14 222908.png (435×1 px, 40 KB)

This is the dataframe structure that I have generated of the cumulative sum which is sent to the bar_chart_race function, please confirm me if this is the correct structure that i have generated. let me know if I have made any error

Thank you so much to all, It worked.

How should I proceed?

Hmm, if you're including 7519 columns, it will take time. For now, just add 5 rows and 5 columns, or 10 rows by 10 columns. I think I read in the bar chart documentation that the more rows and columns you have, the longer it takes to render.Since, it generates frame by frame something like that. Also, only play the video after your cell is done running.

Great 🥳

What should I do next? record this as a contribution or send PAWS link to @Ederporto

check this message https://phabricator.wikimedia.org/T358412#9628885 by @Ederporto

Do we have to continue with other tasks as well after completing Task A?

I have generated both data frames of monthly as well as daily report of January and February. But don't know the process of removing false positives. How to proceed with this?

I have generated both data frames of monthly as well as daily report of January and February. But don't know the process of removing false positives. How to proceed with this?

I think we have to refer to this page https://pageviews.wmcloud.org/topviews/faq/#false_positive for the process of removing false positives.

Screenshot 2024-03-14 at 20.49.06.png (1×1 px, 371 KB)
pls can anyone help me with this error @Ederporto

Screenshot 2024-03-14 at 20.49.06.png (1×1 px, 371 KB)
pls can anyone help me with this error

Can you share the code , what you wrote inside function which you are calling?

Screenshot 2024-03-14 at 20.49.06.png (1×1 px, 371 KB)
pls can anyone help me with this error

Can you share the code , what you wrote inside function which you are calling?

Thanks, I've fixed it. I'd restarted my kernel and forgot to rerun the imports

Screenshot 2024-03-14 at 20.49.06.png (1×1 px, 371 KB)
pls can anyone help me with this error

Can you share the code , what you wrote inside function which you are calling?

Thanks, I've fixed it. I'd restarted my kernel and forgot to rerun the imports

You are welcome anytime.

I have generated both data frames of monthly as well as daily report of January and February. But don't know the process of removing false positives. How to proceed with this?

I think we have to refer to this page https://pageviews.wmcloud.org/topviews/faq/#false_positive for the process of removing false positives.

Thanks !

Are you including all the 7519 columns in your video 😅?

Screenshot 2024-03-14 222908.png (435×1 px, 40 KB)

This is the dataframe structure that I have generated of the cumulative sum which is sent to the bar_chart_race function, please confirm me if this is the correct structure that i have generated. let me know if I have made any error

Thank you so much to all, It worked.

How should I proceed?

Hmm, if you're including 7519 columns, it will take time. For now, just add 5 rows and 5 columns, or 10 rows by 10 columns. I think I read in the bar chart documentation that the more rows and columns you have, the longer it takes to render.Since, it generates frame by frame something like that. Also, only play the video after your cell is done running.

Great 🥳

What should I do next? record this as a contribution or send PAWS link to @Ederporto

check this message https://phabricator.wikimedia.org/T358412#9628885 by @Ederporto

Hey @Abishek_Das and @all, can someone clarify this statement made by @Ederporto, "You all have to make at least a draft proposal in the Outreachy platform by March 17th, as we will close new applications in the 18th, you can update it later, but your draft needs to be up by then."

Is it just to record a contribution or apply for the project (which comes after you've recorded your contribution).

Are you including all the 7519 columns in your video 😅?

Screenshot 2024-03-14 222908.png (435×1 px, 40 KB)

This is the dataframe structure that I have generated of the cumulative sum which is sent to the bar_chart_race function, please confirm me if this is the correct structure that i have generated. let me know if I have made any error

Thank you so much to all, It worked.

How should I proceed?

Hmm, if you're including 7519 columns, it will take time. For now, just add 5 rows and 5 columns, or 10 rows by 10 columns. I think I read in the bar chart documentation that the more rows and columns you have, the longer it takes to render.Since, it generates frame by frame something like that. Also, only play the video after your cell is done running.

Great 🥳

What should I do next? record this as a contribution or send PAWS link to @Ederporto

check this message https://phabricator.wikimedia.org/T358412#9628885 by @Ederporto

Hey @Abishek_Das and @all, can someone clarify this statement made by @Ederporto, "You all have to make at least a draft proposal in the Outreachy platform by March 17th, as we will close new applications in the 18th, you can update it later, but your draft needs to be up by then."

Is it just to record a contribution or apply for the project (which comes after you've recorded your contribution).

I believe its to record a contribution

Are you including all the 7519 columns in your video 😅?

Screenshot 2024-03-14 222908.png (435×1 px, 40 KB)

This is the dataframe structure that I have generated of the cumulative sum which is sent to the bar_chart_race function, please confirm me if this is the correct structure that i have generated. let me know if I have made any error

Thank you so much to all, It worked.

How should I proceed?

Hmm, if you're including 7519 columns, it will take time. For now, just add 5 rows and 5 columns, or 10 rows by 10 columns. I think I read in the bar chart documentation that the more rows and columns you have, the longer it takes to render.Since, it generates frame by frame something like that. Also, only play the video after your cell is done running.

Great 🥳

What should I do next? record this as a contribution or send PAWS link to @Ederporto

check this message https://phabricator.wikimedia.org/T358412#9628885 by @Ederporto

Hey @Abishek_Das and @all, can someone clarify this statement made by @Ederporto, "You all have to make at least a draft proposal in the Outreachy platform by March 17th, as we will close new applications in the 18th, you can update it later, but your draft needs to be up by then."

Is it just to record a contribution or apply for the project (which comes after you've recorded your contribution).

We have to apply for the project (which comes after you've recorded your contribution).

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

You need to install ffmpeg before the bar race function works.

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

After installing ffmpeg try to add only few rows and columns to check everything works properly

Actually one more problem is there, memory of the paws notebook is fixed 3GB and this work is requiring more how to increase that limit? Have all of you done without increasing the memory?

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Actually one more problem is there, memory of the paws notebook is fixed 3GB and this work is requiring more how to increase that limit? Have all of you done without increasing the memory?

Yeah I worked without increasing memory.

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

After installing ffmpeg try to add only few rows and columns to check everything works properly

Already working on only 5 columns and 60 rows

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

After installing ffmpeg try to add only few rows and columns to check everything works properly

Already working on only 5 columns and 60 rows

What is the error?
is your ffmpeg not working?

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

KeyError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2416, in Image.save(self, fp, format, **params)

2415 try:

-> 2416 format = EXTENSION[ext]

2417 except KeyError as e:

KeyError: '.mp4'

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:435, in _BarChartRace.make_animation(self)

434     else:

--> 435 ret_val = anim.save(self.filename, fps=self.fps, writer=self.writer)

436 except Exception as e:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:1089, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)

1086 # canvas._is_saving = True makes the draw_event animation-starting
1087 # callback a no-op; canvas.manager = None prevents resizing the GUI
1088 # widget (both are likewise done in savefig()).

-> 1089 with writer.saving(self._fig, filename, dpi), \

1090      cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None):
1091     for anim in all_anim:

File /usr/lib/python3.10/contextlib.py:142, in _GeneratorContextManager.exit(self, typ, value, traceback)

141 try:

--> 142 next(self.gen)

143 except StopIteration:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:245, in AbstractMovieWriter.saving(self, fig, outfile, dpi, *args, **kwargs)

244 finally:

--> 245 self.finish()

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:515, in PillowWriter.finish(self)

514 def finish(self):

--> 515 self._frames[0].save(

516         self.outfile, save_all=True, append_images=self._frames[1:],
517         duration=int(1000 / self.fps), loop=0)

File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2419, in Image.save(self, fp, format, **params)

2418         msg = f"unknown file extension: {ext}"

-> 2419 raise ValueError(msg) from e

2421 if format.upper() not in SAVE:

ValueError: unknown file extension: .mp4

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[8], line 11

 4     bcr.bar_chart_race(
 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

---> 11 video = dataframe_to_race_chart(first_20)

12 Video(video, embed=True)

Cell In[8], line 4, in dataframe_to_race_chart(df)

3 def dataframe_to_race_chart(df):

----> 4 bcr.bar_chart_race(

 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:783, in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

 461 '''
 462 Create an animated bar chart race using matplotlib. Data must be in 
 463 'wide' format where each row represents a single time period and each 
(...)
 776 These sizes are relative to plt.rcParams['font.size'].
 777 '''
 778 bcr = _BarChartRace(df, filename, orientation, sort, n_bars, fixed_order, fixed_max,
 779                     steps_per_period, period_length, interpolate_period, label_bars, bar_size, 
 780                     period_label, period_fmt, period_summary_func, perpendicular_bar_func, 
 781                     figsize, cmap, title, title_size, bar_label_size, tick_label_size, 
 782                     shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

--> 783 return bcr.make_animation()

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:446, in _BarChartRace.make_animation(self)

444     else:
445         message = str(e)

--> 446 raise Exception(message)

447 finally:
448     plt.rcParams = self.orig_rcParams

Exception: You do not have ffmpeg installed on your machine. Download

ffmpeg from here: https://www.ffmpeg.org/download.html.

Matplotlib's original error message below:

unknown file extension: .mp4

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

KeyError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2416, in Image.save(self, fp, format, **params)

2415 try:

-> 2416 format = EXTENSION[ext]

2417 except KeyError as e:

KeyError: '.mp4'

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:435, in _BarChartRace.make_animation(self)

434     else:

--> 435 ret_val = anim.save(self.filename, fps=self.fps, writer=self.writer)

436 except Exception as e:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:1089, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)

1086 # canvas._is_saving = True makes the draw_event animation-starting
1087 # callback a no-op; canvas.manager = None prevents resizing the GUI
1088 # widget (both are likewise done in savefig()).

-> 1089 with writer.saving(self._fig, filename, dpi), \

1090      cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None):
1091     for anim in all_anim:

File /usr/lib/python3.10/contextlib.py:142, in _GeneratorContextManager.exit(self, typ, value, traceback)

141 try:

--> 142 next(self.gen)

143 except StopIteration:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:245, in AbstractMovieWriter.saving(self, fig, outfile, dpi, *args, **kwargs)

244 finally:

--> 245 self.finish()

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:515, in PillowWriter.finish(self)

514 def finish(self):

--> 515 self._frames[0].save(

516         self.outfile, save_all=True, append_images=self._frames[1:],
517         duration=int(1000 / self.fps), loop=0)

File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2419, in Image.save(self, fp, format, **params)

2418         msg = f"unknown file extension: {ext}"

-> 2419 raise ValueError(msg) from e

2421 if format.upper() not in SAVE:

ValueError: unknown file extension: .mp4

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[8], line 11

 4     bcr.bar_chart_race(
 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

---> 11 video = dataframe_to_race_chart(first_20)

12 Video(video, embed=True)

Cell In[8], line 4, in dataframe_to_race_chart(df)

3 def dataframe_to_race_chart(df):

----> 4 bcr.bar_chart_race(

 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:783, in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

 461 '''
 462 Create an animated bar chart race using matplotlib. Data must be in 
 463 'wide' format where each row represents a single time period and each 
(...)
 776 These sizes are relative to plt.rcParams['font.size'].
 777 '''
 778 bcr = _BarChartRace(df, filename, orientation, sort, n_bars, fixed_order, fixed_max,
 779                     steps_per_period, period_length, interpolate_period, label_bars, bar_size, 
 780                     period_label, period_fmt, period_summary_func, perpendicular_bar_func, 
 781                     figsize, cmap, title, title_size, bar_label_size, tick_label_size, 
 782                     shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

--> 783 return bcr.make_animation()

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:446, in _BarChartRace.make_animation(self)

444     else:
445         message = str(e)

--> 446 raise Exception(message)

447 finally:
448     plt.rcParams = self.orig_rcParams

Exception: You do not have ffmpeg installed on your machine. Download

ffmpeg from here: https://www.ffmpeg.org/download.html.

Matplotlib's original error message below:

unknown file extension: .mp4

You do not have ffmpeg installed on your machine. ffmpeg is not install successfully on your system. You can try the steps mentioned by me on how to install ffmpeg its little bit long 😅 but i think will work.

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

You have made video on how much rows and columns?

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

KeyError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2416, in Image.save(self, fp, format, **params)

2415 try:

-> 2416 format = EXTENSION[ext]

2417 except KeyError as e:

KeyError: '.mp4'

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:435, in _BarChartRace.make_animation(self)

434     else:

--> 435 ret_val = anim.save(self.filename, fps=self.fps, writer=self.writer)

436 except Exception as e:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:1089, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)

1086 # canvas._is_saving = True makes the draw_event animation-starting
1087 # callback a no-op; canvas.manager = None prevents resizing the GUI
1088 # widget (both are likewise done in savefig()).

-> 1089 with writer.saving(self._fig, filename, dpi), \

1090      cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None):
1091     for anim in all_anim:

File /usr/lib/python3.10/contextlib.py:142, in _GeneratorContextManager.exit(self, typ, value, traceback)

141 try:

--> 142 next(self.gen)

143 except StopIteration:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:245, in AbstractMovieWriter.saving(self, fig, outfile, dpi, *args, **kwargs)

244 finally:

--> 245 self.finish()

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:515, in PillowWriter.finish(self)

514 def finish(self):

--> 515 self._frames[0].save(

516         self.outfile, save_all=True, append_images=self._frames[1:],
517         duration=int(1000 / self.fps), loop=0)

File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2419, in Image.save(self, fp, format, **params)

2418         msg = f"unknown file extension: {ext}"

-> 2419 raise ValueError(msg) from e

2421 if format.upper() not in SAVE:

ValueError: unknown file extension: .mp4

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[8], line 11

 4     bcr.bar_chart_race(
 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

---> 11 video = dataframe_to_race_chart(first_20)

12 Video(video, embed=True)

Cell In[8], line 4, in dataframe_to_race_chart(df)

3 def dataframe_to_race_chart(df):

----> 4 bcr.bar_chart_race(

 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:783, in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

 461 '''
 462 Create an animated bar chart race using matplotlib. Data must be in 
 463 'wide' format where each row represents a single time period and each 
(...)
 776 These sizes are relative to plt.rcParams['font.size'].
 777 '''
 778 bcr = _BarChartRace(df, filename, orientation, sort, n_bars, fixed_order, fixed_max,
 779                     steps_per_period, period_length, interpolate_period, label_bars, bar_size, 
 780                     period_label, period_fmt, period_summary_func, perpendicular_bar_func, 
 781                     figsize, cmap, title, title_size, bar_label_size, tick_label_size, 
 782                     shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

--> 783 return bcr.make_animation()

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:446, in _BarChartRace.make_animation(self)

444     else:
445         message = str(e)

--> 446 raise Exception(message)

447 finally:
448     plt.rcParams = self.orig_rcParams

Exception: You do not have ffmpeg installed on your machine. Download

ffmpeg from here: https://www.ffmpeg.org/download.html.

Matplotlib's original error message below:

unknown file extension: .mp4

You do not have ffmpeg installed on your machine. ffmpeg is not install successfully on your system. You can try the steps mentioned by me on how to install ffmpeg its little bit long 😅 but i think will work.

No I have already installed and it's giving same error again.

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

KeyError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2416, in Image.save(self, fp, format, **params)

2415 try:

-> 2416 format = EXTENSION[ext]

2417 except KeyError as e:

KeyError: '.mp4'

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:435, in _BarChartRace.make_animation(self)

434     else:

--> 435 ret_val = anim.save(self.filename, fps=self.fps, writer=self.writer)

436 except Exception as e:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:1089, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)

1086 # canvas._is_saving = True makes the draw_event animation-starting
1087 # callback a no-op; canvas.manager = None prevents resizing the GUI
1088 # widget (both are likewise done in savefig()).

-> 1089 with writer.saving(self._fig, filename, dpi), \

1090      cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None):
1091     for anim in all_anim:

File /usr/lib/python3.10/contextlib.py:142, in _GeneratorContextManager.exit(self, typ, value, traceback)

141 try:

--> 142 next(self.gen)

143 except StopIteration:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:245, in AbstractMovieWriter.saving(self, fig, outfile, dpi, *args, **kwargs)

244 finally:

--> 245 self.finish()

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:515, in PillowWriter.finish(self)

514 def finish(self):

--> 515 self._frames[0].save(

516         self.outfile, save_all=True, append_images=self._frames[1:],
517         duration=int(1000 / self.fps), loop=0)

File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2419, in Image.save(self, fp, format, **params)

2418         msg = f"unknown file extension: {ext}"

-> 2419 raise ValueError(msg) from e

2421 if format.upper() not in SAVE:

ValueError: unknown file extension: .mp4

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[8], line 11

 4     bcr.bar_chart_race(
 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

---> 11 video = dataframe_to_race_chart(first_20)

12 Video(video, embed=True)

Cell In[8], line 4, in dataframe_to_race_chart(df)

3 def dataframe_to_race_chart(df):

----> 4 bcr.bar_chart_race(

 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:783, in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

 461 '''
 462 Create an animated bar chart race using matplotlib. Data must be in 
 463 'wide' format where each row represents a single time period and each 
(...)
 776 These sizes are relative to plt.rcParams['font.size'].
 777 '''
 778 bcr = _BarChartRace(df, filename, orientation, sort, n_bars, fixed_order, fixed_max,
 779                     steps_per_period, period_length, interpolate_period, label_bars, bar_size, 
 780                     period_label, period_fmt, period_summary_func, perpendicular_bar_func, 
 781                     figsize, cmap, title, title_size, bar_label_size, tick_label_size, 
 782                     shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

--> 783 return bcr.make_animation()

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:446, in _BarChartRace.make_animation(self)

444     else:
445         message = str(e)

--> 446 raise Exception(message)

447 finally:
448     plt.rcParams = self.orig_rcParams

Exception: You do not have ffmpeg installed on your machine. Download

ffmpeg from here: https://www.ffmpeg.org/download.html.

Matplotlib's original error message below:

unknown file extension: .mp4

What output do you get after running this code, specific to this code block:

image.png (274×1 px, 25 KB)

If the code I provided would have executed correctly, then you should have a folder named ffmpeg in your home folder.

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

KeyError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2416, in Image.save(self, fp, format, **params)

2415 try:

-> 2416 format = EXTENSION[ext]

2417 except KeyError as e:

KeyError: '.mp4'

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:435, in _BarChartRace.make_animation(self)

434     else:

--> 435 ret_val = anim.save(self.filename, fps=self.fps, writer=self.writer)

436 except Exception as e:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:1089, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)

1086 # canvas._is_saving = True makes the draw_event animation-starting
1087 # callback a no-op; canvas.manager = None prevents resizing the GUI
1088 # widget (both are likewise done in savefig()).

-> 1089 with writer.saving(self._fig, filename, dpi), \

1090      cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None):
1091     for anim in all_anim:

File /usr/lib/python3.10/contextlib.py:142, in _GeneratorContextManager.exit(self, typ, value, traceback)

141 try:

--> 142 next(self.gen)

143 except StopIteration:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:245, in AbstractMovieWriter.saving(self, fig, outfile, dpi, *args, **kwargs)

244 finally:

--> 245 self.finish()

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:515, in PillowWriter.finish(self)

514 def finish(self):

--> 515 self._frames[0].save(

516         self.outfile, save_all=True, append_images=self._frames[1:],
517         duration=int(1000 / self.fps), loop=0)

File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2419, in Image.save(self, fp, format, **params)

2418         msg = f"unknown file extension: {ext}"

-> 2419 raise ValueError(msg) from e

2421 if format.upper() not in SAVE:

ValueError: unknown file extension: .mp4

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[8], line 11

 4     bcr.bar_chart_race(
 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

---> 11 video = dataframe_to_race_chart(first_20)

12 Video(video, embed=True)

Cell In[8], line 4, in dataframe_to_race_chart(df)

3 def dataframe_to_race_chart(df):

----> 4 bcr.bar_chart_race(

 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:783, in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

 461 '''
 462 Create an animated bar chart race using matplotlib. Data must be in 
 463 'wide' format where each row represents a single time period and each 
(...)
 776 These sizes are relative to plt.rcParams['font.size'].
 777 '''
 778 bcr = _BarChartRace(df, filename, orientation, sort, n_bars, fixed_order, fixed_max,
 779                     steps_per_period, period_length, interpolate_period, label_bars, bar_size, 
 780                     period_label, period_fmt, period_summary_func, perpendicular_bar_func, 
 781                     figsize, cmap, title, title_size, bar_label_size, tick_label_size, 
 782                     shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

--> 783 return bcr.make_animation()

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:446, in _BarChartRace.make_animation(self)

444     else:
445         message = str(e)

--> 446 raise Exception(message)

447 finally:
448     plt.rcParams = self.orig_rcParams

Exception: You do not have ffmpeg installed on your machine. Download

ffmpeg from here: https://www.ffmpeg.org/download.html.

Matplotlib's original error message below:

unknown file extension: .mp4

You do not have ffmpeg installed on your machine. ffmpeg is not install successfully on your system. You can try the steps mentioned by me on how to install ffmpeg its little bit long 😅 but i think will work.

No I have already installed and it's giving same error again.

So, I guess you tried both the method given by @MahimaSinghal and me.

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

KeyError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2416, in Image.save(self, fp, format, **params)

2415 try:

-> 2416 format = EXTENSION[ext]

2417 except KeyError as e:

KeyError: '.mp4'

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:435, in _BarChartRace.make_animation(self)

434     else:

--> 435 ret_val = anim.save(self.filename, fps=self.fps, writer=self.writer)

436 except Exception as e:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:1089, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)

1086 # canvas._is_saving = True makes the draw_event animation-starting
1087 # callback a no-op; canvas.manager = None prevents resizing the GUI
1088 # widget (both are likewise done in savefig()).

-> 1089 with writer.saving(self._fig, filename, dpi), \

1090      cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None):
1091     for anim in all_anim:

File /usr/lib/python3.10/contextlib.py:142, in _GeneratorContextManager.exit(self, typ, value, traceback)

141 try:

--> 142 next(self.gen)

143 except StopIteration:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:245, in AbstractMovieWriter.saving(self, fig, outfile, dpi, *args, **kwargs)

244 finally:

--> 245 self.finish()

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:515, in PillowWriter.finish(self)

514 def finish(self):

--> 515 self._frames[0].save(

516         self.outfile, save_all=True, append_images=self._frames[1:],
517         duration=int(1000 / self.fps), loop=0)

File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2419, in Image.save(self, fp, format, **params)

2418         msg = f"unknown file extension: {ext}"

-> 2419 raise ValueError(msg) from e

2421 if format.upper() not in SAVE:

ValueError: unknown file extension: .mp4

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[8], line 11

 4     bcr.bar_chart_race(
 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

---> 11 video = dataframe_to_race_chart(first_20)

12 Video(video, embed=True)

Cell In[8], line 4, in dataframe_to_race_chart(df)

3 def dataframe_to_race_chart(df):

----> 4 bcr.bar_chart_race(

 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:783, in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

 461 '''
 462 Create an animated bar chart race using matplotlib. Data must be in 
 463 'wide' format where each row represents a single time period and each 
(...)
 776 These sizes are relative to plt.rcParams['font.size'].
 777 '''
 778 bcr = _BarChartRace(df, filename, orientation, sort, n_bars, fixed_order, fixed_max,
 779                     steps_per_period, period_length, interpolate_period, label_bars, bar_size, 
 780                     period_label, period_fmt, period_summary_func, perpendicular_bar_func, 
 781                     figsize, cmap, title, title_size, bar_label_size, tick_label_size, 
 782                     shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

--> 783 return bcr.make_animation()

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:446, in _BarChartRace.make_animation(self)

444     else:
445         message = str(e)

--> 446 raise Exception(message)

447 finally:
448     plt.rcParams = self.orig_rcParams

Exception: You do not have ffmpeg installed on your machine. Download

ffmpeg from here: https://www.ffmpeg.org/download.html.

Matplotlib's original error message below:

unknown file extension: .mp4

What output do you get after running this code, specific to this code block:

image.png (274×1 px, 25 KB)

If the code I provided would have executed correctly, then you should have a folder named ffmpeg in your home folder.

% Total % Received % Xferd Average Speed Time Time Time Current

Dload  Upload   Total   Spent    Left  Speed

100 39.4M 100 39.4M 0 0 144M 0 --:--:-- --:--:-- --:--:-- 145M
env: PATH=/srv/paws/pwb:/srv/paws/bin:/srv/paws:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/srv/openrefine:/srv/julia/bin:./ffmpeg-6.1-amd64-static
./ffmpeg-6.1-amd64-static/ffmpeg

I got this.

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

KeyError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2416, in Image.save(self, fp, format, **params)

2415 try:

-> 2416 format = EXTENSION[ext]

2417 except KeyError as e:

KeyError: '.mp4'

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:435, in _BarChartRace.make_animation(self)

434     else:

--> 435 ret_val = anim.save(self.filename, fps=self.fps, writer=self.writer)

436 except Exception as e:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:1089, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)

1086 # canvas._is_saving = True makes the draw_event animation-starting
1087 # callback a no-op; canvas.manager = None prevents resizing the GUI
1088 # widget (both are likewise done in savefig()).

-> 1089 with writer.saving(self._fig, filename, dpi), \

1090      cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None):
1091     for anim in all_anim:

File /usr/lib/python3.10/contextlib.py:142, in _GeneratorContextManager.exit(self, typ, value, traceback)

141 try:

--> 142 next(self.gen)

143 except StopIteration:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:245, in AbstractMovieWriter.saving(self, fig, outfile, dpi, *args, **kwargs)

244 finally:

--> 245 self.finish()

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:515, in PillowWriter.finish(self)

514 def finish(self):

--> 515 self._frames[0].save(

516         self.outfile, save_all=True, append_images=self._frames[1:],
517         duration=int(1000 / self.fps), loop=0)

File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2419, in Image.save(self, fp, format, **params)

2418         msg = f"unknown file extension: {ext}"

-> 2419 raise ValueError(msg) from e

2421 if format.upper() not in SAVE:

ValueError: unknown file extension: .mp4

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[8], line 11

 4     bcr.bar_chart_race(
 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

---> 11 video = dataframe_to_race_chart(first_20)

12 Video(video, embed=True)

Cell In[8], line 4, in dataframe_to_race_chart(df)

3 def dataframe_to_race_chart(df):

----> 4 bcr.bar_chart_race(

 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:783, in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

 461 '''
 462 Create an animated bar chart race using matplotlib. Data must be in 
 463 'wide' format where each row represents a single time period and each 
(...)
 776 These sizes are relative to plt.rcParams['font.size'].
 777 '''
 778 bcr = _BarChartRace(df, filename, orientation, sort, n_bars, fixed_order, fixed_max,
 779                     steps_per_period, period_length, interpolate_period, label_bars, bar_size, 
 780                     period_label, period_fmt, period_summary_func, perpendicular_bar_func, 
 781                     figsize, cmap, title, title_size, bar_label_size, tick_label_size, 
 782                     shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

--> 783 return bcr.make_animation()

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:446, in _BarChartRace.make_animation(self)

444     else:
445         message = str(e)

--> 446 raise Exception(message)

447 finally:
448     plt.rcParams = self.orig_rcParams

Exception: You do not have ffmpeg installed on your machine. Download

ffmpeg from here: https://www.ffmpeg.org/download.html.

Matplotlib's original error message below:

unknown file extension: .mp4

What output do you get after running this code, specific to this code block:

image.png (274×1 px, 25 KB)

If the code I provided would have executed correctly, then you should have a folder named ffmpeg in your home folder.

% Total % Received % Xferd Average Speed Time Time Time Current

Dload  Upload   Total   Spent    Left  Speed

100 39.4M 100 39.4M 0 0 144M 0 --:--:-- --:--:-- --:--:-- 145M
env: PATH=/srv/paws/pwb:/srv/paws/bin:/srv/paws:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/srv/openrefine:/srv/julia/bin:./ffmpeg-6.1-amd64-static
./ffmpeg-6.1-amd64-static/ffmpeg

I got this.

So this implies, you must be having a folder named ffmpeg-6.1-amd64-static in your home folder.
{F42634524}

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

KeyError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2416, in Image.save(self, fp, format, **params)

2415 try:

-> 2416 format = EXTENSION[ext]

2417 except KeyError as e:

KeyError: '.mp4'

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:435, in _BarChartRace.make_animation(self)

434     else:

--> 435 ret_val = anim.save(self.filename, fps=self.fps, writer=self.writer)

436 except Exception as e:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:1089, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)

1086 # canvas._is_saving = True makes the draw_event animation-starting
1087 # callback a no-op; canvas.manager = None prevents resizing the GUI
1088 # widget (both are likewise done in savefig()).

-> 1089 with writer.saving(self._fig, filename, dpi), \

1090      cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None):
1091     for anim in all_anim:

File /usr/lib/python3.10/contextlib.py:142, in _GeneratorContextManager.exit(self, typ, value, traceback)

141 try:

--> 142 next(self.gen)

143 except StopIteration:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:245, in AbstractMovieWriter.saving(self, fig, outfile, dpi, *args, **kwargs)

244 finally:

--> 245 self.finish()

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:515, in PillowWriter.finish(self)

514 def finish(self):

--> 515 self._frames[0].save(

516         self.outfile, save_all=True, append_images=self._frames[1:],
517         duration=int(1000 / self.fps), loop=0)

File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2419, in Image.save(self, fp, format, **params)

2418         msg = f"unknown file extension: {ext}"

-> 2419 raise ValueError(msg) from e

2421 if format.upper() not in SAVE:

ValueError: unknown file extension: .mp4

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[8], line 11

 4     bcr.bar_chart_race(
 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

---> 11 video = dataframe_to_race_chart(first_20)

12 Video(video, embed=True)

Cell In[8], line 4, in dataframe_to_race_chart(df)

3 def dataframe_to_race_chart(df):

----> 4 bcr.bar_chart_race(

 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:783, in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

 461 '''
 462 Create an animated bar chart race using matplotlib. Data must be in 
 463 'wide' format where each row represents a single time period and each 
(...)
 776 These sizes are relative to plt.rcParams['font.size'].
 777 '''
 778 bcr = _BarChartRace(df, filename, orientation, sort, n_bars, fixed_order, fixed_max,
 779                     steps_per_period, period_length, interpolate_period, label_bars, bar_size, 
 780                     period_label, period_fmt, period_summary_func, perpendicular_bar_func, 
 781                     figsize, cmap, title, title_size, bar_label_size, tick_label_size, 
 782                     shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

--> 783 return bcr.make_animation()

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:446, in _BarChartRace.make_animation(self)

444     else:
445         message = str(e)

--> 446 raise Exception(message)

447 finally:
448     plt.rcParams = self.orig_rcParams

Exception: You do not have ffmpeg installed on your machine. Download

ffmpeg from here: https://www.ffmpeg.org/download.html.

Matplotlib's original error message below:

unknown file extension: .mp4

What output do you get after running this code, specific to this code block:

image.png (274×1 px, 25 KB)

If the code I provided would have executed correctly, then you should have a folder named ffmpeg in your home folder.

% Total % Received % Xferd Average Speed Time Time Time Current

Dload  Upload   Total   Spent    Left  Speed

100 39.4M 100 39.4M 0 0 144M 0 --:--:-- --:--:-- --:--:-- 145M
env: PATH=/srv/paws/pwb:/srv/paws/bin:/srv/paws:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/srv/openrefine:/srv/julia/bin:./ffmpeg-6.1-amd64-static
./ffmpeg-6.1-amd64-static/ffmpeg

I got this.

So this implies, you must be having a folder named ffmpeg-6.1-amd64-static in your home folder.
{F42634524}

I am only able to find ffmpeg-6.1.1 folder and I added its path to environment variable still not able to get the video. Can you please guide me step by step of installing ffmpeg again? I installed it from this link:
https://www.ffmpeg.org/download.html
Then extracted it and i got files on my laptop and then moved them to Local Disc C and then finally went to ffmpeg-6.1.1 copied its path added to environment variable right? Anything else we had to do?

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

KeyError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2416, in Image.save(self, fp, format, **params)

2415 try:

-> 2416 format = EXTENSION[ext]

2417 except KeyError as e:

KeyError: '.mp4'

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:435, in _BarChartRace.make_animation(self)

434     else:

--> 435 ret_val = anim.save(self.filename, fps=self.fps, writer=self.writer)

436 except Exception as e:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:1089, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)

1086 # canvas._is_saving = True makes the draw_event animation-starting
1087 # callback a no-op; canvas.manager = None prevents resizing the GUI
1088 # widget (both are likewise done in savefig()).

-> 1089 with writer.saving(self._fig, filename, dpi), \

1090      cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None):
1091     for anim in all_anim:

File /usr/lib/python3.10/contextlib.py:142, in _GeneratorContextManager.exit(self, typ, value, traceback)

141 try:

--> 142 next(self.gen)

143 except StopIteration:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:245, in AbstractMovieWriter.saving(self, fig, outfile, dpi, *args, **kwargs)

244 finally:

--> 245 self.finish()

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:515, in PillowWriter.finish(self)

514 def finish(self):

--> 515 self._frames[0].save(

516         self.outfile, save_all=True, append_images=self._frames[1:],
517         duration=int(1000 / self.fps), loop=0)

File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2419, in Image.save(self, fp, format, **params)

2418         msg = f"unknown file extension: {ext}"

-> 2419 raise ValueError(msg) from e

2421 if format.upper() not in SAVE:

ValueError: unknown file extension: .mp4

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[8], line 11

 4     bcr.bar_chart_race(
 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

---> 11 video = dataframe_to_race_chart(first_20)

12 Video(video, embed=True)

Cell In[8], line 4, in dataframe_to_race_chart(df)

3 def dataframe_to_race_chart(df):

----> 4 bcr.bar_chart_race(

 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:783, in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

 461 '''
 462 Create an animated bar chart race using matplotlib. Data must be in 
 463 'wide' format where each row represents a single time period and each 
(...)
 776 These sizes are relative to plt.rcParams['font.size'].
 777 '''
 778 bcr = _BarChartRace(df, filename, orientation, sort, n_bars, fixed_order, fixed_max,
 779                     steps_per_period, period_length, interpolate_period, label_bars, bar_size, 
 780                     period_label, period_fmt, period_summary_func, perpendicular_bar_func, 
 781                     figsize, cmap, title, title_size, bar_label_size, tick_label_size, 
 782                     shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

--> 783 return bcr.make_animation()

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:446, in _BarChartRace.make_animation(self)

444     else:
445         message = str(e)

--> 446 raise Exception(message)

447 finally:
448     plt.rcParams = self.orig_rcParams

Exception: You do not have ffmpeg installed on your machine. Download

ffmpeg from here: https://www.ffmpeg.org/download.html.

Matplotlib's original error message below:

unknown file extension: .mp4

What output do you get after running this code, specific to this code block:

image.png (274×1 px, 25 KB)

If the code I provided would have executed correctly, then you should have a folder named ffmpeg in your home folder.

% Total % Received % Xferd Average Speed Time Time Time Current

Dload  Upload   Total   Spent    Left  Speed

100 39.4M 100 39.4M 0 0 144M 0 --:--:-- --:--:-- --:--:-- 145M
env: PATH=/srv/paws/pwb:/srv/paws/bin:/srv/paws:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/srv/openrefine:/srv/julia/bin:./ffmpeg-6.1-amd64-static
./ffmpeg-6.1-amd64-static/ffmpeg

I got this.

So this implies, you must be having a folder named ffmpeg-6.1-amd64-static in your home folder.
{F42634524}

I am only able to find ffmpeg-6.1.1 folder and I added its path to environment variable still not able to get the video. Can you please guide me step by step of installing ffmpeg again? I installed it from this link:
https://www.ffmpeg.org/download.html
Then extracted it and i got files on my laptop and then moved them to Local Disc C and then finally went to ffmpeg-6.1.1 copied its path added to environment variable right? Anything else we had to do?

Is the folder present in yours paws-hub Jupyter_Lab Folder Structure?

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

KeyError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2416, in Image.save(self, fp, format, **params)

2415 try:

-> 2416 format = EXTENSION[ext]

2417 except KeyError as e:

KeyError: '.mp4'

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:435, in _BarChartRace.make_animation(self)

434     else:

--> 435 ret_val = anim.save(self.filename, fps=self.fps, writer=self.writer)

436 except Exception as e:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:1089, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)

1086 # canvas._is_saving = True makes the draw_event animation-starting
1087 # callback a no-op; canvas.manager = None prevents resizing the GUI
1088 # widget (both are likewise done in savefig()).

-> 1089 with writer.saving(self._fig, filename, dpi), \

1090      cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None):
1091     for anim in all_anim:

File /usr/lib/python3.10/contextlib.py:142, in _GeneratorContextManager.exit(self, typ, value, traceback)

141 try:

--> 142 next(self.gen)

143 except StopIteration:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:245, in AbstractMovieWriter.saving(self, fig, outfile, dpi, *args, **kwargs)

244 finally:

--> 245 self.finish()

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:515, in PillowWriter.finish(self)

514 def finish(self):

--> 515 self._frames[0].save(

516         self.outfile, save_all=True, append_images=self._frames[1:],
517         duration=int(1000 / self.fps), loop=0)

File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2419, in Image.save(self, fp, format, **params)

2418         msg = f"unknown file extension: {ext}"

-> 2419 raise ValueError(msg) from e

2421 if format.upper() not in SAVE:

ValueError: unknown file extension: .mp4

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[8], line 11

 4     bcr.bar_chart_race(
 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

---> 11 video = dataframe_to_race_chart(first_20)

12 Video(video, embed=True)

Cell In[8], line 4, in dataframe_to_race_chart(df)

3 def dataframe_to_race_chart(df):

----> 4 bcr.bar_chart_race(

 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:783, in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

 461 '''
 462 Create an animated bar chart race using matplotlib. Data must be in 
 463 'wide' format where each row represents a single time period and each 
(...)
 776 These sizes are relative to plt.rcParams['font.size'].
 777 '''
 778 bcr = _BarChartRace(df, filename, orientation, sort, n_bars, fixed_order, fixed_max,
 779                     steps_per_period, period_length, interpolate_period, label_bars, bar_size, 
 780                     period_label, period_fmt, period_summary_func, perpendicular_bar_func, 
 781                     figsize, cmap, title, title_size, bar_label_size, tick_label_size, 
 782                     shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

--> 783 return bcr.make_animation()

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:446, in _BarChartRace.make_animation(self)

444     else:
445         message = str(e)

--> 446 raise Exception(message)

447 finally:
448     plt.rcParams = self.orig_rcParams

Exception: You do not have ffmpeg installed on your machine. Download

ffmpeg from here: https://www.ffmpeg.org/download.html.

Matplotlib's original error message below:

unknown file extension: .mp4

What output do you get after running this code, specific to this code block:

image.png (274×1 px, 25 KB)

If the code I provided would have executed correctly, then you should have a folder named ffmpeg in your home folder.

% Total % Received % Xferd Average Speed Time Time Time Current

Dload  Upload   Total   Spent    Left  Speed

100 39.4M 100 39.4M 0 0 144M 0 --:--:-- --:--:-- --:--:-- 145M
env: PATH=/srv/paws/pwb:/srv/paws/bin:/srv/paws:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/srv/openrefine:/srv/julia/bin:./ffmpeg-6.1-amd64-static
./ffmpeg-6.1-amd64-static/ffmpeg

I got this.

So this implies, you must be having a folder named ffmpeg-6.1-amd64-static in your home folder.
{F42634524}

I am only able to find ffmpeg-6.1.1 folder and I added its path to environment variable still not able to get the video. Can you please guide me step by step of installing ffmpeg again? I installed it from this link:
https://www.ffmpeg.org/download.html
Then extracted it and i got files on my laptop and then moved them to Local Disc C and then finally went to ffmpeg-6.1.1 copied its path added to environment variable right? Anything else we had to do?

If this method is not working you can try the steps mentioned by me to install ffmpeg.

Not able to generate video from the data frame? What might the reason be? As we have 7k+ columns and it's taking time can we generate a bar chart race video of only a few columns as an example?
And I read in the documentation that we should have 'ffmpeg' installed on our device as I am working on web paws Jupyter notebook and not locally do I also have to install 'ffmpeg'?

Download latest FFmpeg static build.

exist = !which ffmpeg
if not exist:

!curl https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz -o ffmpeg.tar.xz \
   && tar -xf ffmpeg.tar.xz && rm ffmpeg.tar.xz
ffmdir = !find . -iname ffmpeg-*-static
path = %env PATH
path = path + ':' + ffmdir[0]
%env PATH $path

!which ffmpeg
Add this code to your notebook , and you will be good to go.

Getting same error again.

Can you share the exact error, What are the errors you are getting Exactly?

KeyError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2416, in Image.save(self, fp, format, **params)

2415 try:

-> 2416 format = EXTENSION[ext]

2417 except KeyError as e:

KeyError: '.mp4'

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:435, in _BarChartRace.make_animation(self)

434     else:

--> 435 ret_val = anim.save(self.filename, fps=self.fps, writer=self.writer)

436 except Exception as e:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:1089, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback)

1086 # canvas._is_saving = True makes the draw_event animation-starting
1087 # callback a no-op; canvas.manager = None prevents resizing the GUI
1088 # widget (both are likewise done in savefig()).

-> 1089 with writer.saving(self._fig, filename, dpi), \

1090      cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None):
1091     for anim in all_anim:

File /usr/lib/python3.10/contextlib.py:142, in _GeneratorContextManager.exit(self, typ, value, traceback)

141 try:

--> 142 next(self.gen)

143 except StopIteration:

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:245, in AbstractMovieWriter.saving(self, fig, outfile, dpi, *args, **kwargs)

244 finally:

--> 245 self.finish()

File /srv/paws/lib/python3.10/site-packages/matplotlib/animation.py:515, in PillowWriter.finish(self)

514 def finish(self):

--> 515 self._frames[0].save(

516         self.outfile, save_all=True, append_images=self._frames[1:],
517         duration=int(1000 / self.fps), loop=0)

File /srv/paws/lib/python3.10/site-packages/PIL/Image.py:2419, in Image.save(self, fp, format, **params)

2418         msg = f"unknown file extension: {ext}"

-> 2419 raise ValueError(msg) from e

2421 if format.upper() not in SAVE:

ValueError: unknown file extension: .mp4

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[8], line 11

 4     bcr.bar_chart_race(
 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

---> 11 video = dataframe_to_race_chart(first_20)

12 Video(video, embed=True)

Cell In[8], line 4, in dataframe_to_race_chart(df)

3 def dataframe_to_race_chart(df):

----> 4 bcr.bar_chart_race(

 5         df=df,
 6         filename='AnalysisVideo.mp4',  
 7         title='Bar Chart Race',
 8         writer='matplotlib'
 9     )
10     return 'AnalysisVideo.mp4'

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:783, in bar_chart_race(df, filename, orientation, sort, n_bars, fixed_order, fixed_max, steps_per_period, period_length, interpolate_period, label_bars, bar_size, period_label, period_fmt, period_summary_func, perpendicular_bar_func, figsize, cmap, title, title_size, bar_label_size, tick_label_size, shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

 461 '''
 462 Create an animated bar chart race using matplotlib. Data must be in 
 463 'wide' format where each row represents a single time period and each 
(...)
 776 These sizes are relative to plt.rcParams['font.size'].
 777 '''
 778 bcr = _BarChartRace(df, filename, orientation, sort, n_bars, fixed_order, fixed_max,
 779                     steps_per_period, period_length, interpolate_period, label_bars, bar_size, 
 780                     period_label, period_fmt, period_summary_func, perpendicular_bar_func, 
 781                     figsize, cmap, title, title_size, bar_label_size, tick_label_size, 
 782                     shared_fontdict, scale, writer, fig, dpi, bar_kwargs, filter_column_colors)

--> 783 return bcr.make_animation()

File /srv/paws/lib/python3.10/site-packages/bar_chart_race/_make_chart.py:446, in _BarChartRace.make_animation(self)

444     else:
445         message = str(e)

--> 446 raise Exception(message)

447 finally:
448     plt.rcParams = self.orig_rcParams

Exception: You do not have ffmpeg installed on your machine. Download

ffmpeg from here: https://www.ffmpeg.org/download.html.

Matplotlib's original error message below:

unknown file extension: .mp4

What output do you get after running this code, specific to this code block:

image.png (274×1 px, 25 KB)

If the code I provided would have executed correctly, then you should have a folder named ffmpeg in your home folder.

% Total % Received % Xferd Average Speed Time Time Time Current

Dload  Upload   Total   Spent    Left  Speed

100 39.4M 100 39.4M 0 0 144M 0 --:--:-- --:--:-- --:--:-- 145M
env: PATH=/srv/paws/pwb:/srv/paws/bin:/srv/paws:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/srv/openrefine:/srv/julia/bin:./ffmpeg-6.1-amd64-static
./ffmpeg-6.1-amd64-static/ffmpeg

I got this.

So this implies, you must be having a folder named ffmpeg-6.1-amd64-static in your home folder.
{F42634524}

I am only able to find ffmpeg-6.1.1 folder and I added its path to environment variable still not able to get the video. Can you please guide me step by step of installing ffmpeg again? I installed it from this link:
https://www.ffmpeg.org/download.html
Then extracted it and i got files on my laptop and then moved them to Local Disc C and then finally went to ffmpeg-6.1.1 copied its path added to environment variable right? Anything else we had to do?

If this method is not working you can try the steps mentioned by me to install ffmpeg.

Yeah the steps mentioned are very detailed and will surely solve your issue.

Please, you all have transformed this thread in a chat. It is impossible for me to keep up with any valid message asking for help because of that. Please, avoid this here at all costs and talk with each other in Zulip, if necessary.

I'm interested in your approaches to resolve the task. You can share errors and ask for help, but please, do not share your entire functions, as this defeats the purpose of getting to know how you write your code. That is the reason I asked to be delivered via email, and not publicly.

No need to respond this message.

Mentor @Ederporto had a doubt,
When calculating total number of article views suppose XXx in the month of January I am getting 459261 articles using the Wikimedia API link "https://wikimedia.org/api/rest_v1/metrics/pageviews/top/pt.wikipedia.org/all-access/2024/01/all-days"
But when calculating views of XXx each day in January and summing up the views getting 456323.
Even getting different of articles in a month as a whole using API link for whole month and different articles for whole month per day when summed up individually, common articles of each day are not counted again
Why is there such a difference?

Hello @Ederporto ,
I am confused about the proposal as I don't know what to do.

Hello @Ederporto ,
I am confused about the proposal as I don't know what to do.

Same here. Is it only to record a contribution? Others have said to apply for the project.

Hello @Ederporto or any of my colleagues,
Help me with this issue.

Please work with your mentor to provide a timeline of the work you plan to accomplish on the project and what tasks you will finish at each step. Make sure take into account any time commitments you have during the Outreachy internship round. If you are still working on your contributions and need more time, you can leave this blank and edit your application later.

Hello @Ederporto or any of my colleagues,
Help me with this issue.

Please work with your mentor to provide a timeline of the work you plan to accomplish on the project and what tasks you will finish at each step. Make sure take into account any time commitments you have during the Outreachy internship round. If you are still working on your contributions and need more time, you can leave this blank and edit your application later.

I think that for now, we need to record our contributions on the Outreachy website by the 17th, then we'll get feedback from our mentor, improve the contribution and start working on the project proposal for the final application.

I just wanted to know if any more details about the project will be shared, such as a timeline, so that we can plan the work

@Aixvik, @Aananditaa001, @Anju_Maurya, @ElvisGicharu, @Abishekdascs, @Damiodunuga, @Abishek_Das, @Keamybams, @MahimaSinghal, @Andreas_Sune, @Udonels, @Omolade1414, @Chimezee, @BruceMahagwa, @GonzaGertrude, @Anachimuco, @DevJames1 and @Sheilakaruku

I have been abscent from answering questions here and through email, because I'm mostly interested in learning how you code and how you approach development challenges (they will appear in this and other projects in your journey).

But some of the questions and challenges I saw might need clarification, other have been resolved by kind and thoughtful individuals in this thread. Let's tackle the exercise here, and take in mind that you all will receive personal feedback in your submissions next week.

About the task instructions

  1. You should create an Wikimedia account, if you don't already have one. You can do so at https://meta.wikimedia.org/w/index.php?title=Special:CreateAccount;
  2. Log in into the PAWS service with your wikimedia account: https://paws.wmflabs.org/paws/hub;

These two seems to not be a challenge.

  1. Fork this notebook in your repository in PAWS (see the instructions here). Name your file as "T357409 - YourWikiUsername";
  2. Follow the specific directions in the notebook. If you have questions or need assistance, comment your inquiry in this subtask and make sure to ping @Ederporto;

You are not required to code in PAWs, feel free to do this locally, in your Jupyter Notebook instance, for example.
If the Data visualization doesn't work properly in your PAWs instance, but works locally, that's fine for me.
The Completing the gaps section needs to work in PAWs.

  1. Once you feel you have completed your task, generate the public link of your notebook on PAWS (see the instructions here) and send it through email to @Ederporto (you can find his email in Outreachy);

If you are developing locally, you can upload it to PAWs and then generate the public link and send me.

  1. You can request feedback on your task until March 17, and we will answer to you until March 22, in order to give you ample time to work on the feedback and your final submission;

That will happen next week, as announced

  1. Make sure to register the public link as a contribution on the Outreachy website. Your final contribution has to be submitted before April 2, at 4pm UTC.

You all have to make at least a draft proposal in the Outreachy platform by March 17th, as we will close new applications in the 18th, you can update it later, but your draft needs to be up by then.

About the notebook instructions:

  • Your first function is supposed to return a list of the most viewed articles in ptwiki for January;
    • You can check if your function is returning the articles in the correct order by looking at this page.
  • Your second function is supposed to return a dataframe of the most viewed articles in ptwiki for January and February;
  • You are free to use auxiliar functions and libraries as you wish;
  • Your third function, in the Data visualization section, is supposed to get the dataframe you generated in the second function and make a bar chart visualization of it.
    • You can pivot the table.

I hope this helps everyone!

@Ederporto
I have some doubts about the list returned for January 2024 most viewed articles on this website PageViews you shared. When I toggle off the "Show only mainspace pages" option I get the exact result with my solution, where the top 2 seem to be the wiki main page and special: search. Does my solution need to match the result on the website when "Show only mainspace pages" is toggled on or off?

According to wiki definition of mainspace:

mainspace (countable and uncountable, plural mainspaces)
(Internet) The primary namespace of a wiki, excluding secondary content such as discussion pages.

Most articles consist of paragraphs and images (perhaps with other types of audiovisual media). However, articles may also be formatted as stand-alone lists or tables (not to be confused with disambiguation pages, which are purely navigation aids). These lists or tables are also considered articles for Wikipedia's purposes and are included in the Main/Article namespace, the one without a title prefix followed by a colon (:).

@Aixvik, @Aananditaa001, @Anju_Maurya, @ElvisGicharu, @Abishekdascs, @Damiodunuga, @Abishek_Das, @Keamybams, @MahimaSinghal, @Andreas_Sune, @Udonels, @Omolade1414, @Chimezee, @BruceMahagwa, @GonzaGertrude, @Anachimuco, @DevJames1 and @Sheilakaruku

I have been abscent from answering questions here and through email, because I'm mostly interested in learning how you code and how you approach development challenges (they will appear in this and other projects in your journey).

But some of the questions and challenges I saw might need clarification, other have been resolved by kind and thoughtful individuals in this thread. Let's tackle the exercise here, and take in mind that you all will receive personal feedback in your submissions next week.

About the task instructions

  1. You should create an Wikimedia account, if you don't already have one. You can do so at https://meta.wikimedia.org/w/index.php?title=Special:CreateAccount;
  2. Log in into the PAWS service with your wikimedia account: https://paws.wmflabs.org/paws/hub;

These two seems to not be a challenge.

  1. Fork this notebook in your repository in PAWS (see the instructions here). Name your file as "T357409 - YourWikiUsername";
  2. Follow the specific directions in the notebook. If you have questions or need assistance, comment your inquiry in this subtask and make sure to ping @Ederporto;

You are not required to code in PAWs, feel free to do this locally, in your Jupyter Notebook instance, for example.
If the Data visualization doesn't work properly in your PAWs instance, but works locally, that's fine for me.
The Completing the gaps section needs to work in PAWs.

  1. Once you feel you have completed your task, generate the public link of your notebook on PAWS (see the instructions here) and send it through email to @Ederporto (you can find his email in Outreachy);

If you are developing locally, you can upload it to PAWs and then generate the public link and send me.

  1. You can request feedback on your task until March 17, and we will answer to you until March 22, in order to give you ample time to work on the feedback and your final submission;

That will happen next week, as announced

  1. Make sure to register the public link as a contribution on the Outreachy website. Your final contribution has to be submitted before April 2, at 4pm UTC.

You all have to make at least a draft proposal in the Outreachy platform by March 17th, as we will close new applications in the 18th, you can update it later, but your draft needs to be up by then.

About the notebook instructions:

  • Your first function is supposed to return a list of the most viewed articles in ptwiki for January;
    • You can check if your function is returning the articles in the correct order by looking at this page.
  • Your second function is supposed to return a dataframe of the most viewed articles in ptwiki for January and February;
  • You are free to use auxiliar functions and libraries as you wish;
  • Your third function, in the Data visualization section, is supposed to get the dataframe you generated in the second function and make a bar chart visualization of it.
    • You can pivot the table.

I hope this helps everyone!

@Ederporto
I have some doubts about the list returned for January 2024 most viewed articles on this website PageViews you shared. When I toggle off the "Show only mainspace pages" option I get the exact result with my solution, where the top 2 seem to be the wiki main page and special: search. Does my solution need to match the result on the website when "Show only mainspace pages" is toggled on or off?

According to wiki definition of mainspace:

mainspace (countable and uncountable, plural mainspaces)
(Internet) The primary namespace of a wiki, excluding secondary content such as discussion pages.

Most articles consist of paragraphs and images (perhaps with other types of audiovisual media). However, articles may also be formatted as stand-alone lists or tables (not to be confused with disambiguation pages, which are purely navigation aids). These lists or tables are also considered articles for Wikipedia's purposes and are included in the Main/Article namespace, the one without a title prefix followed by a colon (:).

I don't think these fine grained details matter. As @Ederporto has always mentioned, he's more interested in our code and how we solved the problem.

@Ederporto, When can we expect to receive feedback on the public-paws-notebook submission?

@Ederporto, When can we expect to receive feedback on the public-paws-notebook submission?

You all should receive the feedback via email in less than 2 hours (at 21 UTC). Sorry for the delay, we had too many applicants to review the code and could not finish yesterday.

@Ederporto, When can we expect to receive feedback on the public-paws-notebook submission?

You all should receive the feedback via email in less than 2 hours (at 21 UTC). Sorry for the delay, we had too many applicants to review the code and could not finish yesterday.

Ok , Thankyou for your response.

@Ederporto, When can we expect to receive feedback on the public-paws-notebook submission?

You all should receive the feedback via email in less than 2 hours (at 21 UTC). Sorry for the delay, we had too many applicants to review the code and could not finish yesterday.

Thank you so much, @Ederporto for your response.

Thank you for the feedback @Ederporto . I had question regarding the bar-chart-race is it necessary that we have to use bar-chart-race 0.1.0 or can we use bar-chart-race 0.2.0 since 0.2.0 has some bug fixes like ValueError: Image size of 27822028x436 pixels is too large.

Hello @Ederporto and everyone
How can I find my WikiUsername? In my case, I thought GonzaGertrude was my Wikiusername.

@Ederporto I've submitted the task on 9th Match from email medatwalnimish@gmail.com kindly give it a review, thanks in advance.

Hello @Ederporto and everyone
How can I find my WikiUsername? In my case, I thought GonzaGertrude was my Wikiusername.

Try checking your PAWS link …/user/your_username/lab…
Can you confirm if it’s the same as GonzaGertrude

Hello @Ederporto and everyone
How can I find my WikiUsername? In my case, I thought GonzaGertrude was my Wikiusername.

Try checking your PAWS link …/user/your_username/lab…
Can you confirm if it’s the same as GonzaGertrude

Yes it is. I named my notebook T357409-GonzaGertrude.ipynb but part of the feedback I received was that It is incorrect. I am confused.

Hello @Ederporto and everyone
How can I find my WikiUsername? In my case, I thought GonzaGertrude was my Wikiusername.

Try checking your PAWS link …/user/your_username/lab…
Can you confirm if it’s the same as GonzaGertrude

Yes it is. I named my notebook T357409-GonzaGertrude.ipynb but part of the feedback I received was that It is incorrect. I am confused.

It’s not the notebook name, I mean the link, check the link compare with what I showed previously.
We can also talk on Zulipchat

Hello @Ederporto and everyone
What is the base URI for testing the documented endpoints please?
I do not see it anywhere.

Hello @Ederporto and everyone
What is the base URI for testing the documented endpoints please?
I do not see it anywhere.

I just tested it and got the base URL.
Thanks very much!