What are regular expressions — and how to use them in Google Sheets to get data from text

In an extract from a new chapter in the ebook Finding Stories in Spreadsheets, I explain what regular expressions are — and how they can be used to extract information from spreadsheets. The ebook version of this tutorial includes a dataset and exercise to employ these techniques.

The story was an unusual one: the BBC Data Unit had been given access to a dataset on more than 200,000 works of art in galleries across the UK. What patterns could we find in the data that would allow us to tell a story about the nature of the nation’s paintings?

Some of the data was straightforward to work with: the ‘artist’ column was relatively clean, and allowed us to identify the most common male and female artist. It turned out that the latter – the Victorian botanist Marianne North – was relatively unknown. So, that was one story we could tell.

ukart

But other parts of the data were more problematic. The date column, for example, contained inconsistently formatted data: in the majority of cases a specific year had been entered, but in many others the data contained text such as “18th century” or “1900-1920” or “1800s”.

We also noticed that monarchs featured heavily in the art – but understandably there was no column that was specifically dedicated to classifying those. If we wanted to identify the most-painted monarchs we would have to create new data that somehow extracted those names from the paintings’ titles.

These problems – extracting data from existing data, particular text data – are what regular expressions are designed for. In this chapter I will explain what regular expressions are, and how to use them in spreadsheets.

Continue reading →

Os ângulos mais usados por jornalistas para contar histórias com dados

Nas minhas aulas e treinamentos de jornalismo de dados, costumo falar sobre os tipos mais comuns de histórias que podem ser encontradas em bancos de dados. Então, selecionei 100 reportagens baseadas em  dados, analisei-as e verifiquei com qual frequência cada um desses ângulos é utilizado.

Cheguei à conclusão de que, na verdade, existem sete ângulos principais para reportagens e histórias baseadas em dados. Muitas histórias incorporam outros ângulos como dimensões secundárias da narrativa (uma história de mudança pode passar a falar sobre a escala de algo, por exemplo), mas todas as histórias de jornalismo de dados que examinei levaram um desses ângulos como fio-condutor.

Neste post, examino como os sete ângulos mais comuns podem ajudar você a ter ideias para histórias e reportagens, assim como a variedade de execuções e as principais considerações para se ter em mente.

Continue reading →

Brazilian government attacks data journalist for reporting app that prescribes ineffective treatments for COVID-19

Mayra Pinheiro fala à CPI da Covid

Government says journalist “extracted data improperly” — but the journalist affirms that he only used a browser’s Inspect Element tool, reports Beatriz Farrugia.

Data journalism has been at the centre of a political debate in Brazil for two weeks after President Jair Bolsonaro’s government made allegations against a data journalist — for extracting data from a web app developed by the Brazilian Ministry of Health to prescribe treatments against COVID-19. 

The TrateCov app was launched in January 2021 for Brazilian doctors. Professionals were told they would be able to enter a patient’s profile and symptoms into the app, which would then suggest medication. 

However, the data journalist Rodrigo Menegat analyzed the app’s source code and found that, regardless of the patient’s symptoms, age and health conditions, TrateCov indicated the use of chloroquine, hydroxychloroquine and ivermectin — drugs with no scientific evidence supporting their use in the treatment of coronavirus. 

He announced his discovery on 20 January in a series of tweets. “Guys,” he wrote:

“I just put in the TrateCov app that my patient is a one week-old newborn who has a stomach ache and a runny nose. The app recommended chloroquine, ivermectin, azithromycin and everything else. Crime, crime, crime, crime.”

Other journalists and broadcasters tested the app and came to the same conclusion.

CNN Brazil reported that it simulated a query for a baby aged five months, with symptoms of fever and nasal congestion. The treatment recommended by TrateCov was chloroquine, hydroxychloroquine and ivermectin.

Soon after the complaints, the app was removed by the Brazilian Government.

Accused of committing cyber crime

Then on May 25th, during a public session of a parliamentary inquiry, Menegat was accused of having committed cyber crime by an official of the Brazilian Ministry of Health: Mayra Pinheiro. 

The parliamentary inquiry, opened late last month, is investigating the Bolsonaro government’s response to the pandemic. More than 461,000 people have died in Brazil so far. 

Approved by Brazil’s Supreme Court, the inquiry is pursuing multiple lines of investigation, such as why the Brazilian government promoted ineffective treatments and why three health ministers were removed over the pandemic. 

Naming the data journalist, Pinheiro said Menegat performed an “improper data extraction”. 

“He was unable to hack,” said Mayra. “He did an improper data extraction. Hacking is when you use someone’s password, enter a platform, a system. The term is not hacking. Today we have the official report that classifies it as improper data extraction.

“He did improper simulations. [The system] was taken down for investigation.”

In another testimony session to the parliamentary inquiry the previous week the former Health Minister General Eduardo Pazuello said that the app had been “stolen and hacked by a citizen”. 

After the allegations the data journalist explained that he had only used the browser’s Inspect Element tool to analyse the source code. 

“As a data journalist and developer, I only analyzed the source code which was public and available on the website of the TrateCov app, saved on a government server (https://tratecov.saude.gov.br) and accessible to any internet user curious enough to do this verification on their own.”

“The procedure has in no way altered any content on the platform”, he added. 

Since the allegations Menegat has limited his social media accounts to avoid online attacks by government supporters. 

“I am closing my Twitter account for more than an obvious reason, but I will be very pleased to show who wants to know how to use the Element Inspector to access source code from any website in the world,” wrote the journalist. 

Other Brazilian data journalists showed support for Menegat and published content explaining the technique used to analyse the app.

“The alleged hacking of the TrateCov application was nothing more than a journalistic investigation technique already used in newsrooms around the world,” said Daniel Trielli, journalist and researcher in media, technology and society, in an article published by the Folha de S.Paulo newspaper.

Here’s how one journalist used all sorts of company account techniques to tell a story about a social media platform for sex workers

Eariler this week I came across a fantastic example of using company accounts in journalism: Guardian media editor Jim Waterson‘s article on how the family that founded the sex-worker social media platform OnlyFans “extracted tens of millions of pounds from its parent company in the last year”.

The article uses so many different techniques that I put together a Twitter thread reverse-engineering the story, paragraph by paragraph. The thread can be followed below, and has also been pulled together into a single page by Threadreader here.

Here are 8 ideas for helping journalism students develop strategies to deal with online abuse

Online abuse of journalists has become so routine that a study this week recommends that journalism students need training to prepare them for it.

But how do you incorporate online abuse into journalism curricula? Over the past year I’ve been trying to do just that — here are some ideas.

1. Ask about online abuse on news days

Most journalism courses already have news days, so considering online abuse in news meetings is a simple way to incorporate the topic into teaching without having to create new classes or materials.

Continue reading →

FAQ: The changing ethics of 21st century journalism

Question mark
Image: Alexander Henning Drachmann

The latest frequently asked questions post focuses on questions from a Masters student interested in the effect of the rise of online news on journalism ethics.

Do you think that the ethical codes of journalism have changed in the transition from traditional journalism to digital?

I think the ethics of journalism have changed, yes, for a range of reasons, and in both negative and positive ways. For example, transparency has become much more highly valued as a journalistic value: journalists are expected to earn the trust of readers much more than was previously the case, and I would argue that is a positive development. Linking to sources, sharing methodologies, etc. forces journalists to hold themselves to higher standards. Continue reading →

“Don’t give me more data — give me a story.” AJ Labs’ Mohammed Haddad on spotlighting human driven data journalism

The Arab Spring: Retweeted

Al Jazeera’s interactive team AJ Labs have a mantra: “human driven data journalism”. In a guest post for OJB Hanna Duggal speaks to the team’s lead Mohammed Haddad on what this means and how he tackles big data, including a recent story commemorating the Arab Spring. 

Mohammed Haddad joined Al Jazeera just as the Egyptian revolution began to unfold in 2011. Since then he has been behind some of Al Jazeera’s most prolific data stories, covering everything from UN General Assembly voting to mapping India and China’s disputed borders.

And, while many of the issues Al Jazeera covers are deeply complex, AJ Labs often help to explain such narratives using data journalism. Continue reading →

“Systems would go offline for days just to delay the release of data” – Rodrigo Menegat on Covid-19 data journalism in Brazil

In a guest post for OJB, Rodrigo George Willoughby spoke to data journalist Rodrigo Menegat about reporting on Covid-19 in Brazil, managing uncertainty and how data journalism could help debunk misinformation.

At the height of the first wave of the coronavirus pandemic in March, data on the disease was in high demand. It required collaboration — something made more difficult with data lacking in quality.

Having spent most of his career covering politics, last year Rodrigo Menegat realised that science data — particularly Covid-19 data — was fast becoming a staple in the newsroom. 

“The first challenge was learning how to cover data which is very different to sport or politics,” he says.

The difficulty was understanding something that, as a country, Brazil was not ready to face. Continue reading →

Striking the balance between graphic design and data journalism: “Design is a conversation”

Beirut blast scrollytell

Reuters’ Graphics Team is renowned for creating a myriad of innovative news stories under tight deadlines, from Covid-19 coverage to mapping the movement of shifting smoke from California wildfires. In a guest post for OJB, Hanna Duggal speaks to the team’s Simon Scarr and Marco Hernandez about pushing the boundaries of visual storytelling in the newsroom and the relationship between data and design. 

In a world that has become increasingly data-prolific and hardwired towards visual content, visualisation provides the newsroom with both a way to communicate complex data effectively and to engage audiences.

Data graphics have become more immersive, compelling and revealing, — and for Reuters, an integral part of how stories are told.

“I’m incredibly proud of our breaking news work,” says Simon Scarr, Reuters’ Deputy Head of Graphics. Continue reading →

From passion to disillusionment and back again — developing the 7th habit of successful journalists

Most journalists are restless voyeurs who see the warts on the world, the imperfections in people and places. . . . gloom is their game, the spectacle their passion, normality their nemesis.

Image: A-Z Quotes

Over the last few weeks I’ve been exploring the habits of successful journalists that are often described as being “innate” or “unteachable”: from curiosity and scepticism, persistence and empathy, to creativity and discipline. In this final post I look at a quality underpinning them all: passion.

Are journalists only ever born with a passion for their craft — or is it something that can be taught?

Of all the seven habits that have been explored in this series, passion is perhaps the one that seems most innate — a quality that you “either have or don’t have”.

Can we teach passion? Well, we can provide the reasons why someone might be passionate about their craft — we can inspire passion and we can create opportunities to experience the things that have stimulated passion in others. Continue reading →