fabiochiu/medium-articles huggingface dataset:
Redemption Song
By: April Alessandra Rubio
Tags: Songs, Music, Bob Marley, Record Collecting, Vinyl

March 24th, 2019.

It’s Sunday morning, and I’ve chosen Uprising by Bob Marley & the Wailers. This album came out June 10th 1980, a year before Marley died. It’s already special to me because my older brother and I used to draw together (the only person I can really draw in front of) at my grandparent’s house and we’d always listen to Bob Marley. But today I chose “Redemption Song” in particular because I was reading the lyrics on the backside, and it stuck out to me because it’s something I’ve been trying to do in my own life…

“Emancipate yourselves from mental slavery

None but ourselves can free our minds

Have no fear for atomic energy

Cause none a them can stop the time.”

https://www.youtube.com/watch?v=kOFu6b3w6c0

I know first hand it’s hard to get out of your own head when your thoughts are spiraling into an overthinking frenzy, but I’m starting to learn you need to balance the scary thoughts with good ones, because they’re just as important and valid and real.

The way Marley sings “Cause all I ever had, these songs of freedom, redemption songs” makes this song and his entire discography really special (even more so than it already is) because the way I interpret it, he’s talking about all his music as a whole, and it’s the last song on the album, and it kind of wraps it all up. But it’s not at all the end, because his music transcended time and continues to be special to a lot of us today. And you can never really know what kind of legacy you’re leaving behind once you’re gone; but having these records from my Uncle and feeling so passionately about music means it continues to carry the same spirit and light through time, even in different forms. Which I think is really neat!

So aside from all the sad themes that this song may carry on the surface… music can carry so many feelings, of happiness, love, despair, loss, but most of all, freedom to feel whatever you want. These songs of freedom…
Songs of the Week (Mar. 18 – 24)
By: Tony Cooper
Tags: Musicians, Songs, Music, Lists, Songwriting

Each week I give you five tracks I’m digging at the time. Follow along to my own personal playlist!

This week has a couple brand new releases, as well as some songs from my favourite artists! Let’s dive in.

1. One More Cup of Coffee – Bob Dylan

Album: Desire (1976)

Starting things off with the king of songwriting isn’t a bad way to get this Sunday list going. I’ll be honest: the first time I heard this song was actually The White Stripes’ cover of it, but I really like Dylan’s original. The verses have an unsettling almost-Arabic-sounding melody to them, and of course the material in the lyrics themselves are – in true Bob Dylan fashion – otherworldly. Definitely an under-appreciated track from the master. Bravo!

2. By the Way – Red Hot Chili Peppers

Album: By the Way (2002)

It’s weird that this is the first RHCP song to be put on these lists, as they’re one of my favourite groups. But if I’m gonna put one song by them on here, it’s got to be from my favourite of their albums. No matter how many times I hear his song, I’ll never not sing the chorus to the heavens as if Anthony and the guys can somehow hear me in California or wherever they are. Nothing will stop me.

3. On the Dotted Line – Accidental Indies

Album: N/A (single release) (2019)

That’s right ladies and gentlemen, I’m not above promoting myself in my own list. Deal with it. In all seriousness, this song comes from a deep place, and I remember the emotional attachment it had to me when I wrote it, so yes I’m proud that it’s finally in the world for all to see! It’s been too long coming for this one and I’m glad that it’s out for you to hear! Give er a listen for your favourite list-making songwriter!

4. Patience – Tame Impala

Album: N/A (single release) (2019)

I find it way cooler than I should that my song and this one are twins, having both come out this Friday past! Although I’ll never compare myself to Kevin Parker and his excessively creative brain, I’ll still hold myself on the grounds that we have at least this one small thing in common. Go team!! Also this song is a killer jam, all the phase that you’d expect from Tame Impala but a cool spin on his writing, although still unmistakenly him.

5. Little Black Submarines – The Black Keys

Album: El Camino – 2011

Say what you will about new Black Keys material – and yes I’ll agree with this: they definitely aren’t the same as they were – they still have some great tunes! El Camino gets a bad rap sometimes for being the album they “sold out” on, but when you get past the one or two tracks you heard everywhere in 2011/12, there are some real gems! One of those gems is “Little Black Submarines” which actually gives me some “Stairway” vibes with its slow, vulnerable start building to a raucous finish. It’s one song I don’t hear enough, even though it’s possibly my favourite track off this album. I will therefore make up for that by giving Dan and Pat “dig it” status for this one. You guys take some flak so consider this a consolation. You’re welcome!
K_Dinero- Creating Music
By: Discovering Artists
Tags: Songs, Music, Hip Hop, Artist, Rapper

Meet our featured artist K_Dinero, who is a 23-year-old musician from Toronto, Canada. K_Dinero first started writing music for fun in 2016 but developed a passion for it as he gained more fans that could relate to his music.

He identifies solely as a hip-hop rapper. His most successful track is “Black Lives Matter”. K_Dinero created this song after George Floyd’s death and all the killings of Black lives. He woke up one morning after hearing that he died and wrote “Black Lives Matter” in tears. He used his passion for music to unite and strengthen the black community.

INSPIRATION

The artists that inspire him the most are Tupac and Meek Mill. He states how they are the OG’s and admits the massive influence that they have had on his music. K_Dinero respects them for being authentic and real with their audiences.

K_Dinero ends the interview by stating that “I want to create the best life for my two children and family and will let nothing get in the way of that.”

Instagram: k_dinerooo

Apple Music
Booba RATPI WORLD Lyrics English Version Song
Tags: Songs, Music, Lyrics, News, Social Media

[Lyrics of “RATPI WORLD”]

[Intro]

Automatic weapons, it’s fantastic

What are the bails, my mouth?

I’m in my Ratpi World, eh

[Verse 1]

They came at six in the morning, rangers, no fishnet stockings

They want to make us like city rats, surrounded like in Palestine

The bumper hugs the window , DUC: no Cristalline

Wallaye, I’m on you like a Djinn, it’s more serious than you imagine

Gargoyles on a blessed roof, miss-pi patrol day and night

If you don’t know who I am , your flat screen comes from Momo Henni

Everything is written but I don’t like reading, you’re wrong, your skin is not leather

Lots of people that I love but I don’t like to say it, lots of people that I embarrass want to destroy me

So be it, I’ve always let the Devil seduce me

In Tony’s office , loaded grenade launcher, big ceremony

It’s hard, bro, the pandemic, bring me a kilo ‘and mi

9–2, Porte de Chatillon, Lamborghini, butterfly doors (I’m too gang, she can’t say “no”)

[Chorus]

What are the bails, my face? I’m in my Ratpi World

Automatic weapons, it’s fantastic

What are the bails, my mouth? I’m in my Ratpi World

Full Lyrics Visit Now :
DaniLeigh Apologizes For “Yellow Bone” After Facing Colorism Controversy
By: Sarah Sanders
Tags: Songs, Music, News, Danileigh Apologizes, Social Media

“I’m not a colorist. I’m not a racist. I date a whole chocolate man. I have beautiful dark-skinned friends.” Over the weekend, DaniLeigh apologized after receiving intense criticism for her song “Yellow Bone.”

Last week, the Def Jam singer was facing a huge backlash after previewing the unreleased track. Fans accused Leigh, who is dating DaBaby, of being a colorist for promoting a song using the term “yellow bone,” which typically used to refer to light-skinned or mixed-race Black women.

After initially defending herself in Instagram comments and on Twitter (she also temporarily disabled her Twitter), he offered a full apology in an Instagram video on Sunday.

In the clip, which is no longer live on her Instagram, she says: “Hey guys, it’s DaniLeigh. I just wanted to address what’s going on with me right now. I think it’s super important, because I definitely feel super misunderstood. My song ‘Yellow bone is what he want,’

I think people twisted it into thinking, like, I’m trying to bash another woman, another skin tone, that was never my intention. I wasn’t brought up like that, I never looked at my skin as a privilege. I never looked at me as ‘I’m better than somebody because of my skin tone.’

I see brown skin women flaunt their skin all the time in music, why can’t I talk about mine? If you look at me, I’m light-skinned, I’m a yellow bone. In my opinion, that’s just what I am. So, it wasn’t something that I looked at so deeply. Which,

I can see why people will take it deeply, so I understand and I’m sorry that I wasn’t sensitive to the topic when I wrote my comment ‘why are you guys taking so personal?’ Because, it can be a personal thing to certain people, because colorist is a real thing so I do get it. But I’m not that. I’m not a colorist. I’m not a racist. I date a whole chocolate man. I have beautiful dark-skinned friends.

Full Article Read More :
Liberal Arts Blog — Keys to the Hearts of Seven Billion People VII: “Ode to Joy”
By: John Muresianu
Tags: Ode To Joy, Songs, Music, Liberal Arts Blog, Europe

Liberal Arts Blog — Thursday is Joy of Music Day

Today’s Topic: Keys to the Hearts of Seven Billion People VII: “Ode to Joy” (Beethoven/Schiller)

After a quick tour of Asia (China, Japan, Korea), and Africa (Nigeria, Kenya, South Africa), today, Europe, First stop: “Ode to Joy” (Beethoven/Schiller). Not only was this tune chosen as the European anthem — it’s appeal is so universal that it has become an integral part of Japanese New Year’s celebrations! Experts — please chime in. Correct, elaborate, elucidate.

Flashmob Flash Mob — Ode an die Freude ( Ode to Joy ) Beethoven Symphony №9 classical music

LYRICS — An Die Freude (“Ode to Joy”) — Friedrich Schiller (1759–1805)

1. Freude! schoner Gotterfunken (Joy! Beautiful, Divine Spark!’) Tochter aus Elysium (Daughter from Elysium)

2. Wir betreten feuertrunken (Fire-drunk we enter), Himmlische, dein Heiligtum (Heavenly one, your sanctuary)

3. Deine Zauber binden wieder (Your magic binds us again) was die Mode streng geteilt (what custom has divided)

All Menschen werden bruder (All men become brothers) wo dein sanfter Flugel weilt (where thy gentle wing hovers)

LUDWIG VAN BEETHOVEN (1770–1827) — written in 1824–5, when he was basically deaf

1. The theme is introduced by cellos and double basses.

2. The first human voice is a bass-baritone solo.

3. Then comes the chorus with Schiller’s poem.

BEETHOVEN HIMSELF WROTE THE WORDS OF THE BASS-BARITONE SOLO THAT PRECEDES THE CHORUS

1. “O Freunde, nicht diese Tone! (Oh friends, not these sounds!)

2. “Sondern lasst uns angenehmere anstimmen!” (Instead let’s strike up more pleasing sounds!)

3. “und freudenvollere” (and more joyful ones!) Freude! (Joy!) Freude! (Joy!)

Bass-baritone solo with lyrics:

(Some of) the lyrics to Ode to Joy

Ode to Joy

10000 Japanese singing Beethoven’s Ode to Joy in Osaka Japan — Oda a la alegría

YOUR TURN

Time to share the coolest thing you learned in the last week related to music.

Or the coolest thing you learned in your life related to music. Say your favorite song or songs. Or your favorite tips for breathing, posture, or relaxation. Or some insight into the history of music….Or just something random about music… like a joke about drummers. jazz, rock….or share an episode or chapter in your musical autobiography.

This is your chance to make someone else’s day. And perhaps to cement in your memory something important you would otherwise forget. Or to think more deeply than you otherwise would about something that matters to you.
‘Stuck With U’ becomes #1 on the Billboard Hot 100
By: Ariana Grande
Tags: Songs, Music, Ariana Grande, Stuck With U, Justin Bieber

A collaboration between Ariana Grande and Justin Bieber, called ‘Stuck With U’ was relased on May 8, 2020, and it debuted at #1 on the Billboard Hot 100. This became Grande’s third #1 single on Billboard after ‘Thank U, Next’ and ‘7 Rings,’ and Bieber’s sixth #1 on the Hot 100, five of which were ‘What Do You Mean?’; ‘Sorry’; ‘Love Yourself’; ‘I’m The One’; and ‘Despacito.’

Grande and Bieber joins Mariah Carey and Drake as the only artists to have that many chart-toppings.

Ariana Grande and Justin Bieber announced on Instagram that the proceeds from the streams and sales of ‘Stuck With U’ will be donated to the First Responders Children’s Foundation.

Grande shared on Instagram, “Grateful to announce that my friend and I have partnered with @1strcf and @sb_projects on this release. Proceeds from the streams and sales of #stuckwithu will be donated to first responders children’s foundation to fund grants and scholarships for children of healthcare workers, emergency medical technicians (EMTs), paramedics, police officers and firefighters serving at the front lines during the global pandemic.”

Bieber shared on Instagram, “Very excited because we have finally done it. And it’s really good. I’m releasing a new song #StuckwithU with my friend @ArianaGrande next Friday on May 8th Working with our family at @sb_projects and universal music group proceeds from the sales and streams of #StuckwithU will fund grants and scholarships for children of first responders who have been impacted by COVID-19 in partnership with the First Responders Children’s Foundation @1strcf.”
Fix you
By: Kapil Gadhire
Tags: Songs, Lovestory, Romantic, Romance, Couples

A long due dance date was finally fixed. They were supposed to go out yesterday night to a club — 15 km far.

Work kept her busy all day and she had no energy left to dance. She asked if they can go to a place nearby to have a beer and do nothing but talk.

He already had choreographed the entire night with her in his head, so canceling the plan at the last moment only made his mad and he came home without picking her up on the way.

“You came home without even informing me?” She shouted on top her voice as she entered in “We could have gone out at least!”

“Yes! To dance! Definitely!!”

“I was tired! And you left even without informing me!! You can’t do that”

“For once I did! How many times you have done that!!”

“Fuck it. I don’t want to talk”

His reactions made her furious. And she decided she will not talk to him for as long as it takes for her heated head to cool down.

Forget good night kisses and early morning sex, they didn’t even look at each other.

26 hours and still no words exchanged.

Post dinner, he was sitting on his table, trying to write a new story, he badly wanted to see her and touch her. She wanted to hug him too, but that tiny ego which always made their patch-ups cute and funny wasn’t letting them talk to each other.

He picked up his headphones and shuffled random songs. Just to distract himself from her thoughts.

“Which song is it?” She inquired.

“I don’t know. Why would you care?”

“Okay. I’m sorry.” She placed herself in the tiny space next to him.

“It’s okay. It’s totally your mistake. I’m glad you are owning it. But I know I shouldn’t have reacted that way.”

“Okay. Let’s not talk about it.”

“I’m sorry too. I missed talking to you”

“Me too” “Which song is it?” She asked again.

He took one earpiece out and put it in her ear.

‘High up above or down below

When you’re too in love to let it go

If you never try you’ll never know

Just what you’re worth

Lights will guide you home

And ignite your bones

And I will try to fix you…’

They didn’t realize how while entangling the headphones they tangled themselves into each other.

Both the headphones were on his desk now.

The silence of the night transformed the headphones into loudspeakers. Coldplay helped them fix their fight.

They didn’t have “their song” before that night.

‘Fix you’ became their song...
PUBLIC — Make You Mine Lyrics
Tags: Songs, Music, Lyrics, News, Social Media

[Verse 1]

Well, I will call you darlin’ and everything will be okay

’Cause I know that I am yours and you are mine

Doesn’t matter anyway

In the night, we’ll take a walk, it’s nothin’ funny

Just to talk

[Chorus]

Put your hand in mine

You know that I want to be with you all the time

You know that I won’t stop until I make you mine

You know that I won’t stop until I make you mine

Until I make you mine

[Verse 2]

Well, I have called you darlin’ and I’ll say it again, again

So kiss me ’til I’m sorry, babe, that you are gone and I’m a mess

And I’ll hurt you and you’ll hurt me and we’ll say things we can’t repeat

[Chorus]

Put your hand in mine

You know that I want to be with you all the time

You know that I won’t stop until I make you mine

You know that I won’t stop until I make you mine

Until I make you mine

[Bridge]

You need to know

We’ll take it slow

I miss you so

We’ll take it slow

It’s hard to feel you slipping (You need to know)

Through my fingers are so numb (We’ll take it slow)

And how was I supposed to know (I miss you so)

That you were not the one?

Full Lyrics Visit Now : Make You Mine Lyrics
15+ Romantic Couple Dance Songs for your Sangeet Night
By: Manohar Singh Panwar
Tags: Songs, Wedding Planning, Weddings, Wedding Dance, First Couple Dance

Indian weddings are known for fun and grand extravaganza. Everyone has a great time in the Ladies Sangeet. In Sangeet function, the performance of the bride and the groom is given the utmost attention. So it is expected that you choose the right romantic couple dance song for your sangeet, and everyone enjoys and loves your performance. You would be expected to perform a romantic song in which your chemistry is visible. Go for the song which goes perfect for showing your emotions and chemistry.

So, get ready to be swamped by loud oodles and whistles as you rock the dance floor. This is the moment you get to celebrate in the busy days of your life together. To help you shine, we have made an exclusive list of the best romantic couple dance songs for your sangeet night. We can guarantee these will be well-received and well-enjoyed in your sangeet night.

Best Romantic Couple Dance Songs for Sangeet Night

1. Tum Hi Ho from Aashiqui 2

2. Afreen Afreen

3. Jag Ghoomeya from Sultan

4. Sau Aasman from Baar Baar Dekho

5. Aaj Din Chadheya from Love Aaj Kal

6. Raabta from Agent Vinod

7. Saiyaan superstar From Leela

8. Deewana Hai Dekho from Kabhi Khushi Kabhi Gam

9. Kaun Tujhe from MS Dhoni

10. Prem Ratan Dhan Payo from Prem Ratan Dhan Payo

11. Mera Piya Ghar Aaya from Yaraana

12. Salamat Rhe from Sarbjit

13. Better Palace

14. Soch Na Sake from Airlift

15. Tum ho from Rockstar

16. Love me like you do

17. Love All of Me from Love In The Future

18. Hasi Ban Gaye from Humari Adhuri Kahani

19. Hamdard Hai from Villain
Up cardi b lyrics english
Tags: Songs, Music, Lyrics, News, Social Media

[Intro]

Up, up, up (Ayy), up (Uh), up, look (This is fire)

[Verse 1]

Once upon a time, man, I heard that I was ugly

Came from a bitch who nigga wanna fuck on me

I said my face bomb, ass tight

Racks stack up Shaq height

Jewelry on me, flashlight

I been lit since last night

Hit him with that good good

Make a nigga act right

Broke boys don’t deserve no pussy

(I know that’s right)

[Pre-Chorus]

Big bag bussin’ out the Bentley Bentayga

Man, Balenciaga Bardi back and all these bitches fucked

It’s big bags bussin’ out the Bentley Bentayga, man

Birkin bag, Bardi back and all you bitches fucked (Woo)

[Chorus]

If it’s up, then it’s up, then it’s up, then it’s stuck

If it’s up, then it’s up, then it’s up, then it’s stuck, huh (Ayy)

Up, then it’s up, if it’s up, then it’s stuck (Huh)

If it’s up, then it’s up, then it’s up, then it’s stuck, huh (Woo)

[Verse 2]

I could make the party hot, I could make your body rock

Bitches say they fuckin’ with me, chances are they probably not

If I had a dick, you’d probably lick it like a lollipop

Hoes speakin’ cap-enese, hit ’em with karate chop

I’m forever poppin’ shit, pullin’ up and droppin’ shit

Gotta argue with him ’cause a nigga love a toxic bitch

Niggas out here playin’, gotta make ’em understand

If ain’t no ring on my finger, you ain’t goin’ on my ‘Gram

I said my face bomb, ass tight

Racks stack up Shaq height (Yeah)

Full Lyrics Visit Now :
So maybe you know somewhere people like us can go…
By: Frank Portman
Tags: Nostalgia, Songs, Music, Culture, Art

So maybe you know somewhere people like us can go…

yours truly and our host, Grant Lawrence

… where we won’t get kicked out, ’cause we’ve got a lot to talk about. After years of research I think I’ve figured it out. And, to one’s surprise, it’s a livestream featuring Lookout Records alumni playing their old songs. Joe said it “felt like old times” and I agree it sort of did, and how likely was that, all awkward virtual and over the internet?

Well, yeah, so the Lookout Zoomout #1 happened, and despite my initial skepticism about my own ability to pull off a “virtual” set, it turned out just great overall and even I didn’t mess up too bad. So I’m really glad Grant talked me into it.

As I said in my wrap up post, it was fun, quirky, and even rather moving in a few places. Even after all these years, everyone playing looked and sounded great, each sounding great in a totally different way from each other, which is, now that I think of it, very “Lookout” in and of itself.

But for me it’s always mostly about the songs, the writing, and to quote myself:

I find it impossible to imagine that many genuinely great songs packed into two hours sprung from any other context.

By which I meant, not naming any names, any other little label or “scene” or whatever that I can think of. The Lookout stable was always given pretty short shrift by music journalists, and I doubt if any such people, then or now, would consider it a songwriting powerhouse. But it was. It was.

Dr Frank, Lisa Marr, Joe King, Grant Lawrence, Raf Classic, Jon Ginoli

And, still is I bet. In fact, though it wouldn’t have the same nostalgic frisson, I’d be quite interested in seeing this same crew do sets of entirely new, un-published material in the same format. I know they have the material, as I do, and I’m sure it’d be super, and also very interesting to note what’s different and what has remained. Maybe one day.

In the meantime, though, nostalgia is still king and I’m not knocking it at all. My set was all old favorites: “Ba Ba Ba Ba Ba,” “Swiss Army Girlfriend,” “She All Right,” “Even Hitler Had a Girlfriend,” “I’d Do Anything for You,” and “Last Time I Listened to You.” Four of these were among the most requested in my various posts on the subject (with “Swiss Army Girlfriend” and “She All Right” thrown in just to make it interesting.) I’m still keeping track of these “votes,” and I’ll do my best to take you to Nostalgia Town next time, so let me know, through the usual channels, if there’s something you’d like to hear and I will take note of it.

Because yes, I’m returning for part two, along with Rose Melberg, Dan Vapid, Kepi, and Larry Livermore, on Feb. 28, same basic format. You can sign up here:

Great big huge thanks to Joe, Lisa, Raf, Jon, Grant, and, er, especially you.
Matplotlib VS Ggplot2
By: Rebecca Patro
Tags: Machine Learning, Data Visualization, Ggplot2, Data Science, Matplotlib

Back story

I primarily work in python, but I needed to use R for a few recent projects. There are a lot of differences between R and Python, but the graphs grated me the most. The visualizations produced in R tend to look dated. I usually use matplotlib while working in python, and the closest comparable package in R is ggplot2.

But which language, or in this case which package is better at visualization? I decided the only way to settle this was a head-to-head comparison of the same graphs made using matplotlib and ggplot2.

Rules of engagement

For the comparison, we will have seven rounds and a bonus round. In each round, I used the same data and tried to make identical graphs in both packages. The rounds are as follows:

Scatter Plot Contour plot Heatmap Regression multiline graph Multiline connected graph Polar bar chart Multiple Boxplots Bonus round

In each round, the packages are scored out of 5 based on aesthetics and ease of use. The results are at the end of this blog. I will try and keep my bias to a minimum and be as objective as possible.

A few things to remember:

In all the rounds, except for the bonus, I am trying to build the same graph in both packages. I am using the same data and the same color scheme.

In some cases, I could not use the same data due to the limitations of the package or my skill level. I produced a similar graph using mock data.

This a package visualization showdown, which means if matplotlib or ggplot2 cant produce the same graph but another package in the same language can say seaborn or plotly, that does not count.

Even though this is not a tutorial, I have added code snippets but did not go into detail.

In all the images below, the graphs and the code, matplotlib(python) is first, then ggplot2(R).

Finally, all the scoring is in the results section at the end.

So without further adieu,

Let the games begin, and let the best package win!!!

Round 1: Scatter plot

For the scatter plot, I used the fat dataset. This dataset has body measurements of individuals from their neck, chest, abdomen, and other areas. Brozek is a response variable and is a measure of fat in the body. The plots show the height and weight of the sample data. The color gradation and the size of the dots are based on the brozek value of the individual.

Both packages were able to achieve similar results and were relatively easy to make. Matplotlib has better color gradients schemes available. I tried to get the same gradation in gglpot2, but the medium colors look drab. Also, the color gradation legend is more decipherable in matplotlib.

Matplotlib (python) scatterplot
Visualizing Clusters with Python’s Matplotlib
By: Thiago Carvalho
Tags: Data Visualization, Data Science, Clustering, Matplotlib, Python

Multiple Dimensions

We’ll often use multiple variables to cluster our data, and scatter plots can only display two variables. There are several options for visualizing more than three variables, but all of them have disadvantages that should be considered.

We could use the markers' size and make it a bubble chart, but that’s not an optimal solution. We couldn’t compare this third variable with the others since they would have different encodings.

For example, by looking at the chart we made earlier, we can tell if a record has a higher Attack or Defense. But if we added Speed as the size, we couldn’t compare it with the other two variables.

plt.scatter(df.Attack, df.Defense, c=df.c, s=df.Speed, alpha = 0.6)

Bubble chart — Image by the author

3D plots can also encode a third variable, but it can also get confusing, sometimes even misleading — That’s because depending on how we look at the chart, it may give us the wrong impression.

3D Scatter Plot — Image by the author

Still, 3D scatter plots can be useful, especially if they’re not static.

Depending on your environment, it’s easy to add some interactivity with Matplotlib.

Some IDEs will have this by default; other environments will require extensions and a magic command such as “Matplotlib Widget” on Jupyter Lab or “Matplotlib Notebook” on Jupyter notebooks.

By changing the angle we’re looking at the chart, we can examine it more carefully and avoid misinterpreting the data.
Building a complex reinforcement learning crypto-trading environment in python
By: Mohammad Abdin
Tags: Machine Learning, Matplotlib, Reinforcement Learning, Cryptocurrency Investment, Python

Building our environment

I’ll be using Tensorflow’s agents to interact with the environment later on, so I will be building a custom environment class that extends the py_environment class provided by the TF environments library.

The most important two vectors to note are the actions and observations. With each step our agent will choose a coin to buy, sell, or hold for a % amount of what it currently owns, hence we have the numpy array with the shape (3) of type ints where the first value is the number of pairs we’ll be working with, 2nd is the buy, sell, or hold, and last is the amount where 1 is 10%, 2 is 20% and so on.

As for the observation space, I want my agent to observe the market as a whole and not just the coin that it just traded in. So for now it’s (4, 5, 40), where 4 is the pairs, 5 is the volume, open, high, low, and close values for each step, and 40 is the look back window which is basically how far back should our agent look at the data. This might not be the optimal observation space we want but my focus for this article is to just to have a fully fledged environment that we can start experimenting with and engineering every component later on.

Also we defined our wallet as a list where the first value is the initial USD balance. Note that I’m using locally stored data in the form of an excel spreadsheet, I used Binance’s API to basically download market data for each pair seperated by sheets:

Excel file for market data

I won’t be going over the script I used to extract data into this format but you find it here.

Next, we define our reset() method to reset our environment with each episode:

Similar to the constructor in the reset() method we reinitialize everything, except constants such as our price data for example.

Now, moving to our step function which the agent will be passing an ‘action’ to and receiving a ‘timestep’ object containing the reward, state, and discount with each step.

First I initialized a list ‘data’ which will contain the dataframes necessary for the state at that step (i.e taking the rows in the range of the current step and 40 steps behind it which is our look back window). Then I added the condition for when our episode ends which is when our agent loses all it’s money.

We will then either buy, sell, or hold, based on which the wallet will be updated and lastly we increment our step and return the timestep object as a transition to the next state.

Again, I’m leaving all the action reinforcement learning engineering for a seperate article and so our reward currently does not function at all. The end goal of this part is to just have an environment that an agent can interact with and that can be visually rendered.
資料視覺化之 contour ( matplotlib.pyplot ) 教學與用法
Tags: Machine Learning, Sklearn, Datavisualisering, Matplotlib, Python

資料視覺化之 contour ( matplotlib.pyplot ) 教學與用法

前言

資料視覺化 ( Data Visiual ) 對於 Machine Learning 是非常有幫助的方法

特別是一些 Model 結果 ( Predict ) 的呈現

而 python 的 matplotlib 中， pyplot.contour ( contourf ) 可以用來呈現等高線圖，深度 ( Z ) 或是顯示不同的 Y ( output ) 值 ( 意即有多種 Y 輸出 )，我們會透過本文的範例來觀察 ( 使用 sklearn )

本文之教學範例主要使用 Jupyter 來執行，如果是其他方式使用須注意 plt.imshow 之類呼叫

Contour / Contourf 基本介紹

直接先看範例程式

左圖為 contour / 右圖為 contourf

解說

基本上 plt.pyplot 的 contour / contourf 使用上其實是大同小異，主要差別是是否會填滿色塊 （ contour 為線條， contourf 為填滿的色塊），因本人比較喜歡使用 contourf ，故後以 contourf 為主

我們這邊使用上有 X, Y, Z 這三個值，分別是 X 座標，Y 座標，Z 深度（如前述，用來表示等高線很合理）

題外話 : 我們要產生出平面的大量 X, Y 與 Z 其實是很麻煩的，所幸 numpy 有個方法叫做 meshgrid，透過 np.mashgrid ( X, Y ) 就可以得到 contour 所需的座標，可以想像是產生出

p = [

[(0,0), (1,0), (2,0), (3,0)],

[(0,1), (1,1), (2,1), (3,1)],

[(0,2), (1,2), (2,2), (3,2)],

[(0,3), (1,3), (2,3), (3,3)]

]

( 類似這種形式 )

不使用 meshgrid, 要將上述的 p 套用的話還需要以下方法轉換

x, y = zip(*[list(zip(*l)) for l in p])

x = np.array(x)

y = np.array(y)

示意圖

當需要更大個範圍時很麻煩，所以我們使用此方法方便些

回到正題 :

x = range(4)

y = range(4)

x, y = np.meshgrid(x, y)

range(4) 可以看作是解析度，當我們需要更多的描繪點只要改動這邊即可

z 矩陣就是我們的深度 ( 可以是 Y 輸出結果 )

如果不用 contour ，使用單純的 plot 只會得到點，而且還要過濾 Z 值分開上色 ( 如下範例程式與圖 )

z = np.array(z)

for idx, color in [

(z == 0, '#000'),

(z == 1, '#F00')

]:

plt.plot(x[idx], y[idx], '*', color=color)

只使用 plot 不使用 contour

Python Matplotlib 之 Contourf 應用

再暸解基本的 contour / contourf 應用之後，我們搭配 sklearn 來做簡單應用示範，以下皆是亂數即時產生，所以相同的程式碼所產生的圖表不一定會和本文相同

準備資料

這裡我們使用 make_moons 來做資料示範，這可以使用 from sklearn.datasets import make_moons 來產生，此測試資料包含了一個座標系與 0 或 1 的結果 ( x1 + x2 = y )

Model 預測

其實用什麼 Model 都行，我們這邊用 RandomForestClassifier 來做示範

範例程式

直接看以下範例

make_moon 得到的預測圖

解說

import 與 資料準備我們就不多做介紹，我們直接看到這段

resolution = 50

dx = np.linspace(np.min(X[:, 0]), np.max(X[:, 0]), resolution)

dy = np.linspace(np.min(X[:, 1]), np.max(X[:, 1]), resolution)

dx, dy = np.meshgrid(dx, dy)

其實就等同我們上面基本教學的

x = range(4)

y = range(4)

x, y = np.meshgrid(x, y)

只是我們有技巧地透過 numpy min / max 去找出適當的值，resolution 相當於我們基礎教學裡 range 的數值，然後使用 linspace 來做節點分割，大家在跑範例程式時可以改看看 resolution 會發現 contour 精度的變化

再來看 test_x = np.c_[dx.flatten(), dy.flatten()]

其實這是因為 model prdict 需要 x1, x2 ，所以我們將 x, y 合併

然後送入 model ( clf ) 得到 z

最後 z 輸出的 shape 並不符合 contour 使用，所以我們要 reshape

z = z.reshape(dx.shape)

我們就可以畫出簡單的圖

# draw

plt.contourf(dx, dy, z, alpha=0.2)

plt.contourf 結果

然後我們還需要看一下原始資料 ( dataset )

確認我們的 Model 運作是正確的，所以我們使用 plot 來把原本資料繪上

# draw all dataset

colors = ['#FF0', '#000']

for i in [0, 1]:

idx = y == i

plt.plot(X[idx, 0], X[idx, 1], '*', color=colors[i])

就會得到類似這樣的結果

底色就是我們 Model 訓練的分類結果

另外

plot_z = clf.predict(test_x)

colors = ['#F00', '#00F']

for i in [0, 1]:

idx = plot_z == i

plt.plot(test_x[idx, 0], test_x[idx, 1], '*', alpha=0.3, color=colors[i])

也可以將預測結果 plot 在圖上，可以透過配合改變 resolution 來觀看

這是 contour 與 plot 比較

透過降低 resolution ( 下圖降為 10 ) 可以發現， 和單純 plot 將比，contour 明顯在資料視覺化上面容易許多

左圖使用 contour / 右圖單純只用 plt

結語

希望以上教學有幫助到大家

參考資料 : https://matplotlib.org/3.3.2/api/_as_gen/matplotlib.pyplot.contourf.html

https://www.python-course.eu/matplotlib_contour_plot.php
Performing Analysis Of Meteorological Data
By: Anmol Arora
Tags: Matplotlib, Data Analysis, Python

Is there any change due in weather to global warming in of Finland by using Data analytics ?

Effect of global warming on weather.

In this blog we will discuss about a data_analysis which is based on the following dataset.

“Has the Apparent temperature and humidity compared monthly across 10 years of the data indicate an increase due to Global warming” following is the Hypothesis for the analysis.

The Hypothesis means we need to find whether the average Apparent temperature for the month of a month say April starting from 2006 to 2016 and the average humidity for the same period have increased or not. This monthly analysis has to be done for all 12 months over the 10 year period. So you are basically resampling your data from hourly to monthly, then comparing the same month over the 10 year period. Support your analysis by appropriate visualizations using matplotlib and / or seaborn library.

Step 1: Importing of libraries and Dataset.

Required libraries

Importing dataset

Step 2: Looking at the dataset.

Details of dataset

Step 3: Cleaning Dataset

In this step we will prepare our data for the plotting , we will first drop the unwanted columns (all except temperature and humidity) .

Dropping the unwanted columns

Then ,we will convert the Timezone to +00:00 UTC .

Converting the Timezone to +00:00 UTC

Step 4: Plotting of Data

In is final step we will plot the data to for the analysis ,

> Firstly we will plot the whole dataset for all months .

Graph for all months

> Now we will plot graph for a specific month(April).

Graph for month of April

Conclusion

As we can analyze there isn’t any change in humidity in past 10 years(2006–2010) for the month of April. where as , temperature increases sharply in 2009 and drops in 2015 for rest of the years there isn’t any sharp change in the temperature.

Note: This conclusion statement is for only month of April , please refer to the model for all the months.
How To Perform Sentiment Analysis Using Python
By: Darshita Patel
Tags: Naturallanguageprocessing, AI, Sentiment Analysis, Matplotlib, Python

#100DaysOfCoding

Sentiment analysis is a common part of Natural language processing, which involves classifying texts into a pre-defined sentiment. Here we’ll use the Natural Language Toolkit (NLTK), a commonly used NLP library in Python, to analyze textual data.

Github: https://github.com/DARSHITA188/RSSfeedParser_SentimentAnalysis/blob/master/BBCsentiment.ipynb

Install necessary packages in the Anaconda environment. In other Python IDEs one can install python packages using pip command.

To install matplotlib package with conda run one of the following:

conda install -c conda-forge matplotlib

To install pandas package with conda run one of the following:

conda install -c conda-forge pandas

To install textblob package with conda run one of the following:

conda install -c conda-forge textblob

What is the Sentiment Analysis? Essentially, sentiment analysis or sentiment classification fall into the broad category of text classification tasks where you are supplied with a phrase, or a list of phrases and your classifier is supposed to tell if the sentiment behind that is positive, negative or neutral.

Polarity is a float value within the range [-1.0 to 1.0] where 0 indicates neutral, +1 indicates a very positive sentiment and -1 represents a very negative sentiment.

Subjectivity is a float value within the range [0.0 to 1.0] where 0.0 is very objective and 1.0 is very subjective. The subjective sentence expresses some personal feelings, views, beliefs, opinions, allegations, desires, beliefs, suspicions, and speculations whereas Objective sentences are factual.

Now, Let’s call the csv we have parsed in the previous tutorial which contains RSS feed data from BCC.

And so on, you’ll get the sentiment of each cell that contains text data. Now let’s save sentiment and polarity of each statement in a separate file for further analytics.

After creating a dataframe import dataframe to csv file.

And both the parameters are now saved into a separate CSV file.

Next, we’ll focus on visualization.

#100DaysOfCoding

#Day2
Wind Energy in Europe and Data Science
By: Afonso Lugo
Tags: Data Visualization, Wind Energy, Data Science, Matplotlib, Python

The programming language that I use is Python because is the most known for data science. There areplenty of IDEs (Integrated Development Environment)to use in data science so I will not focus on it. I like to use Jupyter Notebook with Anaconda distribution because it is simple and easy to use. For the combination with other scripts I use the text editor Atom which is light and has a beautiful interface.

The next graph shows the new installations of wind plants in Europe in 2019, showing the gross installations in MW by country, with a division between onshore and offshore plants. This graph was made using Pandas to manipulate the data and Matplotlib to crate the graph.

For those who know Python language, this plot is simple. The “tricks” that we need to know for this plot are: two data values per country, rotate the labels from X axis and remove the top and right axis lines.

First let’s take a look at the bar chart. To plot two data values, one on top and the other in the bottom, you need to assign the bottom value in the line where you are plotting the top value (line 25). To rotate the X label sticks, you just need to use “rotate = n” where n is the angle that you want to rotate (line 27) and to remove the top and right axis you can use the subclass ‘spines’ from matplotlib (lines 29 and 30). The next image show the code that I used for this plot in Atom text editor.
Docker, Tensorflow, GUI, matplotlib
By: Lijo Jose
Tags: TensorFlow, Docker, Matplotlib

In the previous post, we discussed about using tensorflow on a dockerized container. With that, we can work on tensorflow environment. But, how will we do visualization of results? Copy the data to local computer and view it separetely? We can do that.. but, is there a better way? Yes. We can enable docker with GUI capabilities and display contents from docker itself.

First enable docker to use the display. We will do this by ‘xhost’ command as below

xhost +

Next, we need to run the docker with display settings.

docker run -it --gpus=all --name <name> -v <algo folder>:/algo -v <data folder>:/data --net=host --env="DISPLAY" --volume="$HOME/.Xauthority:/root/.Xauthority:rw" tensorflow/tensorflow:1.15.2-gpu-py3 /bin/bash

Inside the docker container, install python3-tk.

apt install -y python3-tk

Install matplotlib using pip

pip install matplotlib

For easy editing in python, we can have ipython. Installing ipython can be done as below

pip install ipython

The below code is taken from matplotlib website.

import numpy as np

import matplotlib.pyplot as plt





= 5

= (20, 35, 30, 35, 27)

= (25, 32, 34, 20, 25)

= (2, 3, 4, 1, 2)

= (3, 5, 2, 3, 3)

ind = np.arange(

= 0.35 # the width of the bars: can also be len(x) sequence



p1 = plt.bar(ind, menMeans,

p2 = plt.bar(ind, womenMeans, width,

bottom=



('Scores')

('Scores by group and gender')

plt.xticks(

plt.yticks(

((



() N = 5 menMeans = (20, 35, 30, 35, 27) womenMeans = (25, 32, 34, 20, 25) menStd = (2, 3, 4, 1, 2) womenStd = (3, 5, 2, 3, 3) N ) # the x locations for the groups width = 0.35 # the width of the bars: can also be len(x) sequence width , yerr= menStd bottom= menMeans , yerr= womenStd plt.ylabel ('Scores') plt.title ('Scores by group and gender') ind , ('G1', 'G2', 'G3', 'G4', 'G5')) np.arange (0, 81, 10)) plt.legend (( p1 [0], p2 [0]), ('Men', 'Women')) plt.show ()

Copy the above code and paste it in ipython environment and run it. You will be able to see the display on your host machine.
Line Charts and Subplots with Matplotlib
By: Karan Sharma
Tags: Data Visualization, Graph, Data Science, Matplotlib, Python

Line Charts and Subplots with Matplotlib

Photo by Markus Spiske on Unsplash

A line graph is one of the most commonly utilized plots to visualize continuous and time-dependent data. This type of data helps in understanding a particular trend over a specific period of time. You must have definitely come across line charts in wide range of presentations and sales pitches.

Line Graphs

Let’s begin by making a simple line chart on a sample sales dataset from Kaggle 😊. Before we get into hands-on coding, I prefer creating np.arrays of the selective columns.

The above graph is an example of poor visualization. Let’s make it more intuitive with the following aspects:

Title and Axis Labels

Ticks and Rotation

Annotation

Improve the Figure Size

Heavy graphs are not successful in displaying high density data; this is where figsize will come to your rescue. In our graph, figure(figsize = (10, 5)) has created an inch-by-inch image. The y-axis has been distributed within the range of 0 to 90000, with an interval of 5000.

The x-axis label has been rotated to 90 degrees, in order to prevent the cluster as seen in the previous graph. Both x-ticks and y-ticks can be subject to rotation. You can even customize the format of the annotations. Here, the respective value is divided by 1000.

Subplots

A subplot is nothing but a plot within a plot, plot next to a plot, and plot below a plot; like an array of plots. The purpose is to represent multiple plots within a single graph. This is useful when you want to visualize multiple plots inside a single graph

Let’s create a plot with multiple line graphs.

You can customize each line with respect to color, linewidth, linestyle and alpha . Alpha denotes transparency; simply assign a number to it. Bbox_to_anchor=(1.31, 0.4) will shift the legend outside the main plot.

The dashes can be arranged in a specific format with set.dashes() .

Now that you know how to create the above plot. Let’s recreate the same in separate graphs!

In Simple Words

When you are creating stacked subplots, make sure you define the number of rows and columns respectively; ncols and nrows . Forward = True will automatically assign the size of the canvas. Sharex and Sharey determines how the axis is shared for all the subplots. Feel free to experiment and create different types of line graphs.

Check the entire code here https://github.com/kashamcrash/MattyPlotty.
Numeric data visualization with seaborn library
By: Sydney Teo
Tags: Data Visualization, Programming, Data Science, Matplotlib, Seaborn

First, let’s import the libraries.

import seaborn as sb

import matplotlib as plt

sb.set()#this sets the default Seaborn style for graphics

The purpose of using plt.figure() is to create a figure object. Figsize takes in 2 parameters (width,height) and is for you to specify the dimensions of your figure in inches.

Insert your own csv dataset into your data.

Orientation of the plot (vertical or horizontal) is optional. However, it is usually used when dealing with numeric variables to resolve ambiguity when both x and y are numeric or when plotting wide-form data.

Boxplot:

f = plt.figure(figsize=(24, 4))

sb.boxplot(data = yourdata, orient = "h")

Histplot:

f = plt.figure(figsize=(16, 8))

sb.histplot(data = yourdata)

Violinplot:

f = plt.figure(figsize=(16, 8))

sb.violinplot(data = yourdata, orient = "h")

There’s actually a shortcut to plot all the vizualisation using a for loop

f, axes = plt.subplots(6, 3, figsize=(18, 24)) count = 0

for var in numDF:

sb.boxplot(data = numDF[var], orient = "h", ax = axes[count,0])

sb.histplot(data = numDF[var], ax = axes[count,1])

sb.violinplot(data = numDF[var], orient = "h", ax = axes[count,2])

count += 1

My tip is to use the documentation whenever in doubt. Happy learning!
Performing Analysis Of Meteorological Data
By: Suryansh Pandey
Tags: Pandas, Matplotlib, Python, Seaborn, Data Analytics

In This blog we are going to perform data analysis over weather data. The link for dataset is given here. Our goal in this Internship (of data analysis) is to transform the raw data into information and then convert it into knowledge.

This is my first project of Suven Consultants & Technology Pvt. Ltd data analytics internship.

The dataset has hourly temperature recorded for last 10 years starting from 2006–04–01 00:00:00.000 +0200 to 2016–09–09 23:00:00.000 +0200. It corresponds to Finland, a country in the Northern Europe.

Goal

Following are the goal of this project -

Perform data cleaning.

Perform analysis for testing the Hypothesis.

The Null Hypothesis H0 is “Has the Apparent temperature and humidity compared monthly across 10 years of the data indicate an increase due to Global warming”.

The H0 means we need to find whether the average Apparent temperature for the month of a month say April starting from 2006 to 2016 and the average humidity for the same period have increased or not.

Implementation :-

This is the implementation of analysis in python.

Step 1 : Importing Libraries and dataset.

importing libraries

Step 2 : Check the datatypes of our dataset.

datatypes

Step 3 : Describe the dataset to gain more insights.

describing dataset

Step 4 : Perform data cleaning.

removing unwanted data

Step 5 : Resample our Formatted Date.

resampling convert Formatted date to datetime and set this column as a index in the dataset.

resampling

Step 6 : Plotting of data.

Plot of variation in Apparent Temperature and Humidity with time.

Firstly we will plot the whole dataset for all months.

yearly graph

Step 7 : plot graph for a specific month(April).

Graph for April month

Step 8 : Bargraph plot.

Plotting the variation in Apparent Temperature and Average Humidity of each month over the years.

barplot of each month in year

Step 9 : Plot of Apparent Temperature v/s Humidity with time(in year).

year wise graph

Step 9 : Monthly analysis of all 12 months over the 10 year period.

january

february

March

April

May

June

July

August

September

October

November

December

Step 10 : Histogram.

Step 11 : Relplot.

Conclusion :

From this analysis we infer that there are either sharp rise in temperatures or sharp falls over the 10 yrs. Hence we can conclude that Global Warming has caused a major difference and unreliability in temperature predictability also taking humidity into consideration we can say that it has almost remained same throughout the past years.

According to Null Hypothesis (H0) both increases due to Global Warming is proven wrong here, and thus null hypothesis failed.

Thank you.