Menu
O mnie Kontakt

VisiData - narzędzie do wizualizacji danych (arkusze kalkulacyjne, pliki CSV i inne) w... terminalu (film, a nawet cała playlista)

Na kanale Saul Pwanson omawia narzędzie o nazwie Visidata, które stworzył podczas swojego urlopu. Narzędzie to jest napisane w Pythonie 3 i jest dostępne jako open-source. Latał się tak znudzeni obsługą danych w terminalu, sięgnął po stworzenie tego wyjątkowego narzędzia. Visidata umożliwia importowanie wielu formatów plików, takich jak Excel, CSV i JSON. Dzięki łatwej obsłudze asynchronicznego ładowania i możliwości wykonywania analizy danych, Visidata jest opisane jako „szwajcarski scyzoryk dla danych”.

W demonstracji Saul pokazuje, jak łatwo można korzystać z Visidata, używając danych na temat skarg 311 z Nowego Jorku z ostatnich dwóch miesięcy. Narzędzie nam umożliwia różne operacje na danych, takie jak ukrywanie kolumn, dzielenie dat, czy przeprowadzanie analizy częstotliwości. Od razu podczas ładowania zbioru danych, użytkownicy są w stanie zobaczyć dane asynchronicznie, co zwiększa efektywność pracy z danymi.

Następnie Saul ilustruje, jak można analizować dane na przestrzeni dni i podzielić daty na dni tygodnia. Dzięki pomocy Pythona, użytkownicy mogą łatwo uzyskać dodatkowe kolumny, takie jak dni tygodnia, co pozwala na szybsze zrozumienie działających wzorców. Prezentacja narzędzia wciąż odbywa się w terminalu, co podkreśla jego funkcjonalność i elastyczność.

W dalszej części prezentacji, Saul przeprowadza analizę wizualizacji danych, podkreślając możliwość wykorzystania współrzędnych geograficznych. Wykonuje wykresy skarg na szczury lub myszy na mapie Nowego Jorku, co pokazuje skuteczność Visidata w wizualizacji lokalizacji skarg. Program oferuje także możliwość zapisywania wyników jako plik CSV, co sprawia, że narzędzie jest wygodne i praktyczne w użyciu.

Na koniec, Saul informuje swoje audytorium o nadchodzącej wersji 1.0 Visidata, który zadebiutuje po konferencji, co dodatkowo wzbudza zainteresowanie tym narzędziem. W momencie pisania tego posta, wideo miało 37116 wyświetleń oraz 845 polubień, co świadczy o rosnącym zainteresowaniu tym nowym narzędziem do analizy danych. Warto śledzić ten kanał, aby być na bieżąco z nowinkami technologicznymi i aktualizacjami narzędzi.

Toggle timeline summary

  • 00:00 Wprowadzenie i powitanie.
  • 00:08 Zapytanie o doświadczenia publiczności z danymi tabelarycznymi.
  • 00:15 Pytanie, czy ktoś woli korzystać z terminala.
  • 00:29 Podzielanie się frustracją związaną z tradycyjnymi narzędziami wiersza poleceń.
  • 00:31 Wprowadzenie Visadata, nowego narzędzia do danych.
  • 00:39 Opisanie funkcji Visadata i obsługiwanych formatów.
  • 00:44 Demonstrowanie ładowania zbioru danych dotyczących skarg na usługi 311.
  • 01:03 Wyjaśnienie, jak manipulować danymi, na przykład ukrywając kolumny.
  • 01:22 Przeprowadzenie analizy częstotliwości danych.
  • 01:35 Interpretacja wyników z danych histogramu.
  • 01:55 Używanie Pythona do wyprowadzenia dnia tygodnia z daty.
  • 02:10 Wizualizacja punktów danych na mapie.
  • 03:15 Analiza typów skarg, szczególnie dotyczących gryzoni.
  • 03:45 Pokazywanie, jak powiększyć i filtrować dane na mapie.
  • 04:03 Wyjaśnienie przepływu pracy zapisywania danych jako CSV.
  • 04:25 Dyskusja na temat rozszerzalności i funkcji niestandardowych w Visadata.
  • 04:32 Ogłoszenie nadchodzącego wydania wersji 1.0.
  • 04:40 Zaproszenie publiczności do dalszych pokazów i pomocy.
  • 04:44 Zakończenie wystąpienia i podziękowanie publiczności.

Transcription

You're good to go. Hello. So has anyone ever had to use any kind of tabular data? By a show of hands. OK, a couple people. Does anyone prefer to use the terminal? And has anyone ever used grep, cut, awk, sort, unique with a CSV file? OK, right, exactly. Well, I did that way too much, and I got kind of fed up with it. So I made a tool called Visadata, which I've been working on for the past year on my sabbatical. It's written in Python 3. It's open source. It's in PyPy now. We're working on getting it through an app. It supports a whole lot of formats, Excel files, and CSV files, and JSON. It's extensible via Python 3. And it's kind of like a Swiss Army chainsaw for data. And this is a lightning demo. So I have a data set of two months of 311 service complaints from New York. And so it's loading it now. You can see it's loading it asynchronously down there in the corner. You can do all kinds of fun stuff. For instance, you can hide columns with a minus key. And if you wanted to, for instance, we have a created date. Let me split this based on, it's got a date and time. I just want to see the date. So I just split that. And I've got another column here for just the date. If I wanted to do a frequency analysis on that date, for instance, I would just press Shift-F, and here we go. And it tallies it asynchronously. And then if I hide these columns, you can actually make the sky a little bigger here. And you can see the stuff. If we sort by the date, then you can see basic patterns with this simple histogram. And so for some reason, there's a cycle of seven days. I don't know. Let's see here. So if I type this date column as a date, I'm going to rename it to create date. And then I can use that as an expression, or in an expression, to make another column. So let's say I just wanted to get the weekday. This is just Python here. And so you can see the weekday. And that was just the date time we just converted to weekday there. And so you can see, OK, right. It's day five and six, which happens to be Saturday and Sunday. That makes sense. So if I quit out of this then, and I want to do some simple visualizations of this, let's say, there's a bunch of different fields in here, like the latitude and longitude. So let me make these just floats here, because it turns out that latitude and longitude, even though they're on a sphere, you think of them as xy-coordinates. So I'm going to make the longitude be an x-coordinate. And actually, I'm going to go get the borough here. I'll make that be a key column, so you can get a little bit of color. And I'm just going to plot that with dot. This is all in the terminal still, by the way. And so I'm not sure if you guys have ever seen a map of New York. These are the complaints. Thank you. If we wanted to see all the things we had done to get to this point, we could press Shift-D to get to a command log. And this is all the things that we did in order. If we wanted to, I could actually save this off and replay it later. That took 20 seconds earlier, so I'm not going to waste that time right now. But if we wanted to do some more fun stuff with this, let's say this is a simple map of just the complaints. Let's do some more things here. I'm going to keep the borough out of there. And oh, here we go, complaint type. So I'll do a frequency analysis on that. And after that's done here, let's find something interesting. Oh, it's rodents. That's always fun. So I pressed Enter just to go to all the rodent complaint types. Let's see whether rat sightings or mouse sightings or whatever is the exact same plot here. And so here's the map of those. And if I want to, I can turn those layers on and off with the numbers here so you can see only the mouse sightings or only the rat sightings, et cetera. Bounce back and forth between them if you want to, et cetera. And just because I think it's fun, you can use the mouse to zoom in, for instance, on Manhattan. And then you can select a region and just press Enter to go to just those rows for that. And then, thank you. And then you can save those off as a CSV file. And that's the very simple workflow with Visidata. Like I said, it's extensible with Python. You can do all kinds of expressions. You can create a Visidata RC with custom functions in there. I have a gender function in there. So anybody's first name, I can just make a column with their supposed gender based on their first name. It's just a great tool if you're ever doing data and just want to do something really quickly before you even know what's even in there. So we're working on releasing 1.0, actually, right after this conference next week. And so if you're interested in this and using this, I would love to give you either a more hands-on demo or show how we could help you. So please hit me up after the lightning talks. Anyway, thank you very much. Thank you.