You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,10 @@ These links are a more secure and scalable way to create shareable demos!
19
19
20
20
## Bug Fixes:
21
21
* Allows `gr.Dataframe()` to take a `pandas.DataFrame` that includes numpy array and other types as its initial value, by [@abidlabs](https://github.com/abidlabs) in [PR 2804](https://github.com/gradio-app/gradio/pull/2804)
22
+
* Add `altair` to requirements.txt by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2811](https://github.com/gradio-app/gradio/pull/2811)
22
23
23
24
## Documentation Changes:
24
-
No changes to highlight.
25
+
* Fixed some typos in the "Plot Component for Maps" guide by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2811](https://github.com/gradio-app/gradio/pull/2811)
25
26
26
27
## Testing and Infrastructure Changes:
27
28
* Fixed test for IP address by [@abidlabs](https://github.com/abidlabs) in [PR 2808](https://github.com/gradio-app/gradio/pull/2808)
Copy file name to clipboardExpand all lines: guides/05_tabular_data_science_and_plots/plot_component_for_maps.md
+8-65Lines changed: 8 additions & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,30 +9,29 @@ This guide explains how you can use Gradio to plot geographical data on a map us
9
9
10
10
## Overview
11
11
12
-
We will be using the New York City Airbnb dataset, which is hosted on kaggle [here](https://www.kaggle.com/datasets/dgomonov/new-york-city-airbnb-open-data). I've uploaded it to the Hugging Face Hub as a dataset [here](https://huggingface.co/datasets/gradio/NYC-Airbnb-Open-Data) for easier use and download. Using this data we will plot Airbnb locations on a map output and allow filtering based on price and location. Below is the demo that we will be buiding. ⚡️
We will be using the New York City Airbnb dataset, which is hosted on kaggle [here](https://www.kaggle.com/datasets/dgomonov/new-york-city-airbnb-open-data). I've uploaded it to the Hugging Face Hub as a dataset [here](https://huggingface.co/datasets/gradio/NYC-Airbnb-Open-Data) for easier use and download. Using this data we will plot Airbnb locations on a map output and allow filtering based on price and location. Below is the demo that we will be building. ⚡️
15
13
14
+
$demo_map_airbnb
16
15
17
16
## Step 1 - Loading CSV data 💾
18
17
19
18
Let's start by loading the Airbnb NYC data from the Hugging Face Hub.
text_list = [(names[i], prices[i]) for i inrange(0, len(names))]
33
32
```
34
33
35
-
In the code above, we first load the csv data into a pandas dataframe. Let's begin by defining a function that we will use as the prediction fuction for the gradio app. This function will accept the minimum price and maximum price range as well as the list of boroughs to filter the resulting map. We can use the passed in values (`min_price`, `max_price`, and list of `boroughs`) to filter the dataframe and create `new_df`. Next we will create `text_list` of the names and prices of each Airbnb to use as labels on the map.
34
+
In the code above, we first load the csv data into a pandas dataframe. Let's begin by defining a function that we will use as the prediction function for the gradio app. This function will accept the minimum price and maximum price range as well as the list of boroughs to filter the resulting map. We can use the passed in values (`min_price`, `max_price`, and list of `boroughs`) to filter the dataframe and create `new_df`. Next we will create `text_list` of the names and prices of each Airbnb to use as labels on the map.
36
35
37
36
## Step 2 - Map Figure 🌐
38
37
@@ -93,63 +92,7 @@ We layout these components using the `gr.Column` and `gr.Row` and wel also add e
If you run the code above, your app will start running locally.
@@ -163,4 +106,4 @@ If you haven't used Spaces before, follow the previous guide [here](/using_huggi
163
106
## Conclusion 🎉
164
107
And you're all done! That's all the code you need to build a map demo.
165
108
166
-
Here's a link to the demo [Map demo](https://huggingface.co/spaces/gradio/NYC-Airbnb-Map) and [complete code](https://huggingface.co/spaces/gradio/NYC-Airbnb-Map/blob/main/app.py) (on Hugging Face Spaces)
109
+
Here's a link to the demo [Map demo](https://huggingface.co/spaces/gradio/map_airbnb) and [complete code](https://huggingface.co/spaces/gradio/map_airbnb/blob/main/run.py) (on Hugging Face Spaces)
0 commit comments