avatarN.V. Foxes

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

1238

Abstract

me Python code to retrieve Tesla stock prices from 2022 using Yahoo Finance. I want the output to be in a csv file called ‘stock_prices.csv’ The CSV file mys have a column named “Date” representing the dates and a column named “Price” representing the stock prices.”</p><p id="e110">And then the output will be:</p><figure id="f70f"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*4cgK5TnDtjHmV_MaFnGNCw.png"><figcaption></figcaption></figure><h1 id="df02">Step 2: Copy this code using the botton “copy code” at the top right</h1><h1 id="f854">Step 3: Paste the code in Google Colab</h1><p id="38fa">Navigate to <a href="https://colab.research.google.com/">https://colab.research.google.com/</a> . The create a new notebook by logging in using your Google account.</p><p id="0eee">This is the full code I got from Chat GPT.</p><p id="77be">But remember, you can customise the prompt to get any other stock.</p><div id="eeb1"><pre><span class="hljs-keyword">import</span> yfinance <span class="hljs-keyword">as</span> yf <span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd

<span class="hljs-comment"># Define the stock symbol and the time range for which you want the data</span> sym

Options

bol = <span class="hljs-string">"TSLA"</span> start_date = <span class="hljs-string">"2022-01-01"</span> end_date = <span class="hljs-string">"2022-12-31"</span>

<span class="hljs-comment"># Fetch the stock data using Yahoo Finance</span> stock_data = yf.download(symbol, start=start_date, end=end_date)

<span class="hljs-comment"># Extract the 'Date' and 'Close' columns from the stock data</span> stock_data = stock_data[[<span class="hljs-string">'Close'</span>]].reset_index()

<span class="hljs-comment"># Rename the columns to 'Date' and 'Price'</span> stock_data.columns = [<span class="hljs-string">'Date'</span>, <span class="hljs-string">'Price'</span>]

<span class="hljs-comment"># Save the stock data to a CSV file</span> stock_data.to_csv(<span class="hljs-string">'stock_prices.csv'</span>, index=<span class="hljs-literal">False</span>)

<span class="hljs-built_in">print</span>(<span class="hljs-string">"Stock data saved to 'stock_prices.csv'"</span>)</pre></div><h1 id="dbca">Step 4: Use the CSV file with the stock data</h1><p id="db5f">As simple as that!</p><figure id="4c88"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*lpNgMNRzr3oNIaAX.png"><figcaption></figcaption></figure></article></body>

Italy’s Most Under-appreciated Island

Just north of the more famous Capri lies Ischia, one of Italian tourism’s hidden gems

A view of Il Borgo di Sant’Angelo. (photo courtesy of Maria Olsen)

Something gradually shifts in the universe as you ride on a southbound train in Italy. The bar coach gets restocked with water that is less aggressively sparkling, the personnel are seemingly more courteous and passengers even start to speak to one another. The most noticeable change however is in pace. After Rome the minutes start to pile onto what was originally a five minute delay but nobody seems to be bothered by it. In fact, people seem to not even notice that as we near Napoli our delay has, without explanation, turned into thirty-something minutes. This is in part due to the fact that everyone is by now engrossed in the private affairs of one middle aged lady sitting a few rows ahead of us. She is having an animated discussion with her lover on speaker phone and in a near indecipherable accent. The peak of the indiscreet drama occurs when we all hear on speaker phone: “If I die before your husband, will you still come to my funeral?” Intriguing stuff. If only there were popcorn served on Trenitalia. At this stage, her lover must have heard a few muffled giggles from the train compartment, because he proceeded to ask “do you have your earphones in?” To which a passenger (who may or may not have been me) from a couple of rows back, clearly frustrated from being unable to finish a paragraph in his book for the past thirty minutes replies “No! We can all hear you!” The entire compartment gets a good laugh in and before we know it we are pulling into the station in Napoli, right on schedule, give or take a thirty-five minute delay.

As much fun as we had, at this stage my wife, Maria, and I are officially in a rush. Our ferry for Ischia leaves in twenty minutes and the odds are not in our favor. Google maps forecasts twenty-seven minutes to cross the notorious Napoli traffic. Oh, Napoli. From the moment we step off the train and start our jog to the taxi stand, you can smell the chaos. There is no discernible queue at the taxi stand, nor is there a particular order of operations for which cab driver gets which fare. One of the drivers nonchalantly but determinedly points at us saying “Due?” and proceeds to put our bags in the back. Upon entering he asks us where we are going. We tell him we need to catch a ferry to Ischia in fifteen minutes and thus begins an exhilarating yet rewarding ride through the heart of the most chaotic city in Europe. The driver manages to honk his horn three times before even exiting the taxi stand. And we’re off to the races. This would be the point where you buckle up and hold on for dear life, knowing that the driver will do whatever it takes to bypass the traffic in order to get you to the ferry on time. Minor detail, only one of the seatbelts in the back actually works. I close my eyes and summon the patron saint of Napoli, Diego Armando Maradona, to protect us, but I am interrupted. As he’s swerving through head-on traffic without the slightest hint of panic, the driver proceeds to tell us how beautiful Ischia is and how we should remember to not just stick to eating fish while there but also try the local coniglio all’ischitana. An illegal u-turn here and there and he comes back with a “se vi posso dare un consiglio.” From which he proceeds to recommend three or four different local restaurants on the island. Unfortunately both Maria and I are too busy hanging on for dear life to jot any of these recommendations down but it’s a nice gesture nonetheless. Within seven minutes we arrive at the ferry terminal with all our limbs intact and time to spare. Since our professional traffic-swerver never put on the meter (nor his seat belt for that matter), he names the price and we gladly pay. Neapolitan cab driver 1, google maps 0.

Maria and I settled on Ischia as a location for our mini-moon out of pure haste two days before our wedding. We could not swing any of the connections between Tuscany and Sardinia or Sicily, so in a moment of last-minute desperation we booked a place in Ischia. In essence, we had absolutely no clue where we were going apart from the fact that it was just a short fifty minute ferry ride from Napoli (if you made your connection and survived the cab ride through town, that is). Neither of us knew what to expect. We just knew we had a good chance of getting some sun and enjoying the beach. In all my years of traveling through Italy, I had never stopped twice to reflect on Italy’s third most populous island as a concept let alone as a holiday destination. It turns out that this is often the case. Ischia is constantly undermined and overshadowed by its more luxurious cousin, Capri, to the southeast and the instagram-friendly Amalfi coast. On top of that, as we later found out, the Ischitani are not necessarily brilliant marketeers, a trait which does not lend itself to mass-tourism. Then again, it may be this very lack of mass-tourism which made us fall in love with the island.

Upon disembarking from the ferry, the first thing we noticed was the relative calm at the taxi stand and the tall green mountains overlooking the coast. We were a world away from the chaos of those seven Neapolitan minutes. The only weaving this cab driver did was in line with the twisty Ischian roads on the short journey to the hotel in Casamicciola on the north coast. The seatbelts even worked. We seemed to have reached an oasis. This was exactly the vibe we needed after six months of moonlighting as Tuscan wedding planners.

The southern hospitality which we got a sneak peek of on the journey southward manifested itself again in the courtesy shown by the hotel receptionist checking us in. The leisurely hotel tour she gave us with a smile on her face while her colleague carried our bags to the room was a far cry from the “get out of my way” style of the milanese or the “you should be honored that I let you stay here” attitude of tuscan hoteliers. The hotel was a gorgeous renovated spa hotel, with different hand painted tiled flooring in every room. One of the protagonists of Italian unification, Giuseppe Garibaldi, had stayed here to nurse an injury before one of the final legs of his military push. Our guide did not include this anecdote in her tour however, despite the fact that we passed right in front of the bathtub Garibaldi allegedly used. Nor did she mention that as far as modern political leaders go, former German Chancellor Angela Merkel has become a mainstay on Ischia. As said, the Ischitani are not marketeers at heart. In the entirety of the ten minutes strolling around the spacious foyers of the hotel, one thing stood out above all: the lack of people. I half-joked to Maria that this was eerily reminiscent of The Shining. Following our grand tour, we settled in for an easy night and opted to have pizza in the hotel restaurant which proved another pleasant surprise. What would turn out to be a recurring theme is that the Ischians may actually make superior pizza to the Neapolitans. I might live to regret that last sentence on my next stay in the Campanian capital.

The rooftop pool at the Manzi hotel in Casamicciola. (photo courtesy of Maria Olsen)

The next morning we showed up to breakfast and found all the other guests. The average age seemed to be closer to seventy than sixty. It was now clear that the reason we found nobody the previous evening was that we arrived at peak nap time. Upon enquiring why there were so many senior citizens, we were enlightened to the fact that because of the climate and the natural thermal baths dotting the island, it has become a pensioners paradise. This was a welcome development after having spent a week in August fighting off angry German mothers for poolside chairs in Mallorca. Another point to Ischia.

But I digress. The point of writing about the colazione was to highlight its grandiosity. If you ever wondered what an ancient imperial Roman banquet was like, then look no further than the breakfast room at the Manzi hotel in Casamicciola. Picture one long, marbled oval table in the middle of a gorgeously tiled room. On that table is everything you could ever imagine for a start to the day and more. As you make your way around this table in clockwise fashion, you find the finest prosciutti, salumi, formaggi including the local bufala mozzarella (more on that later), a few fruits and vegetables are thrown in to add color to the mix, a dozen varieties of bread (actually salted, unlike in other regions of Italy), seven different varieties of milk (take that Copenhagen hipsters) and freshly squeezed juices with seasonal fruits. Phew. We are only halfway around the table. As you round the top end of the table things start to get really interesting. Your senses are overcome by various freshly baked cakes of all shapes and sizes, brownies of the perfect consistency, a spreadable pistachio paste (think nutella but green) and local pastries with infinite varieties of filling. This is the corner of the table where you pose yourself the timeless enigma of how Italians are seemingly so fit, when they start the day with such calorie bombs. Good luck with that one. I’ve been trying to figure it out for nearly three decades.

At the breakfast we also met Sergio the waiter. Sergio turned out to be much more than a waiter over the course of the next five mornings. Like everyone else, he also came ready with countless restaurant recommendations (As did every other restaurateur on the trip. We even received recommendations for our own hometown, Copenhagen, where everyone seemed to have a cousin or friend with a restaurant). He emphasized on multiple occasions that he does not receive any commissions for this free concierge service and that Ischians are “honest people, not camorristi.” Something we never doubted, but I guess it was nice to be reassured. Seniority is king and the synonym of competence in Italy. Sergio made this clear by reminding us every morning that he had been in the business for fifty years. He also pushed me out of my comfort zone by constantly urging me to have an espresso on the side of my cappuccino. I politely declined the offer the first few days but then finally caved. It’s a hell of a way to start a morning, especially if your bloodstream is not used to excess amounts of caffeine.

It was on our way out of the breakfast room that morning that we ran into a beautiful seventy year old woman who was living her best life. With the aura of a diva reminiscent of Sofia Loren, she strolled into the room in a bathrobe, slippers and oversized sunglasses. Three waiters, including Sergio, immediately rushed to her. One pulled out her chair, one had her cappuccino ready to be served at just the right temperature and Sergio offered his usual pearls of wisdom. This episode would repeat itself every morning for the entirety of our stay. La dolce vita, I thought to myself. Maria, on the other hand, took note and by the end of the trip was walking around the premises in a similar fashion.

The spa at the Manzi hotel. (photo courtesy of Maria Olsen)

After spending way more time than intended at the breakfast table every morning, our days usually consisted of texting Beppe–a local taxi legend–and asking for a ride to different beaches on the island. Beppe was a well-built, quiet man who was always punctual, only accepted cash and though a man of few words was one of very powerful recommendations. We quickly learned that the slightest hesitation or smirk when we mentioned a restaurant was a clear sign that we should avoid going there.

Being in Ischia at the end of peak tourist season meant we got to keep the beaches mostly to ourselves. Additionally most holidayers in this time period are more keen on the thermal baths than the sea water. Every beach we toured was distinct in its panorama. For instance, at Maronti beach you could admire the full mass of Capri to the east, the backdrop of the lusciously green–and surprisingly tall–Ischian mountains behind you and the quaint fishing village of Sant’Angelo to the west. In addition to the breathtaking scenery, the water was superbly refreshing and crystal clear for every dip we took. Our morning beach sessions were always punctuated by a wonderful meal (by now you should be getting an idea of where our travel priorities lie). One meal in particular–at La Casa Colonica in San Montano Bay–remained in my heart and stomach for a long time afterwards. It was fireworks from the beginning with four spheres of mozzarella di bufala on a bed of fresh tomatoes. I have never in my life tasted a bufala as fresh and marvelous as that. It was to die for. The perfect consistency with enough texture but that still melts in your mouth. A touch of olive oil and it was game, set and match. Absolutely sublime. If I could have one dish everyday for the rest of my life, this one would be a strong contender. I could go on and on about it but that was just the entree. Maria then ordered a bowl of perfectly al dente spaghetti in a fresh sugo di pomodoro. Even such a seemingly simple relic is done infinitely better by the Ischitani. I, on the other hand, opted for something a bit more elaborate — and heavy: the calamari fritti. Amazing in their own right but too much for what was supposed to be a light lunch at the beach. I forgot that my digestive tract turns into that of an elephant when it comes to fried food, even with calamari as fresh as these. This resulted in us still being in a trance when dinner time rolled around. We were still nursing our food babies and felt like we offended the owner of the osteria who made no secret of the fact she disapproved of us sharing the tagliata.

The best mozzarella di bufala in the world. (photo courtesy of Nicola Volpi)

On one of our last mornings our routine was broken. The ever reliable Beppe did not show up at the agreed upon time. Instead a man with a permanent tan, a silver crown of hair on his head and the relaxed demeanor that only an islander can have showed up claiming to be Beppe’s uncle. We stepped into his makeshift Subaru taxi van which was a cross between an Ape-car and an old VW bus. Maria, ever the law-abiding Danish citizen, attempted to buckle her seat belt but only half the belt was there. The uncle, noticed this, turned around and with an air of nonchalance combined with a hint of outrage exclaimed “No, don’t worry, you can even sleep here. No problem!” Another common theme: apparently car safety campaigns did not reach this part of the world. As reassuring as the uncle actually was, I still cannot wrap my head around this one. Seatbelts save lives, people! He even allowed Maria to stand and take a picture of the view from high above Casamicciola out of the sun roof, while he kept edging the taxi forward to give her a better view. What the uncle lacked in safety measures, however he made up for with wisdom and initiative. Without being prompted, he gave us a tour of the entire island. We passed through the filming locations of The Talented Mr. Ripley and got spectacular views from the mountains all the way to Mount Vesuvius. We also learned a few things about the evolution of the island. Rabbit has been one of the staples on the island ever since the war, when the families living in upper Ischia pooled their resources to create a massive rabbit farm. To this day it supplies all the local restaurants with a delicacy paradoxical for a mediterranean island. The uncle also explained how it was German holidayers in the fifties and sixties who saw the potential in the natural hot springs and created the first spa villages on the island, which stand to this day and are filled year round with German pensioners. Finally he took us to see the ruins of the 2017 Casamicciola earthquake whose occurrence was sandwiched in between two other national emergencies–the 2016 earthquake in central Italy and the 2018 Morandi bridge collapse in Genova. We drove right through the epicenter, which is yet to be funded or rebuilt. Five years on, people are still displaced and unable to return home. Amongst the rubble stood a sign saying basta chiacchiere, vogliamo i fatti (no more chit-chat, we want facts) in front of which were three elderly men calmly playing cards. When I asked the uncle what he thought about this–being a Casamicciola native himself–he replied “We wait, that’s what we do.” It seems that Ischia has not only been overlooked as a tourist destination but has also been disregarded by its own government. Despite the uncle’s nonchalance, this was quite a somber note with which to end our unsolicited daily tour of the island and a reminder of the dysfunctional institutional ecosystem which Italians have to navigate on a daily basis.

We rounded off our last day with a sail around the island, which provided yet another perspective and countless postcard worthy shots of this paradise. By this stage, Maria and I had already decided that we would be coming back. Potentially even further out of season for some hiking. For our last Ischian supper, we took up one of Sergio’s recommendations and had Beppe drive us up a sequence of unmarked, dark, narrow, windy roads to a mountain rifugio called La Cantinola di Zio Jack–yet another uncle. Here, on top of the Monte Epomeo, I was finally able to eat the renowned bucatini al coniglio. Maria was not so keen on eating rabbit and instead opted for some sort of pasta/potato pie which, although we still have not fully grasped what exactly it was, was brilliant in its own right. We topped things off by sharing a regina margherita and confirming that the Ischitani do pizza better than the Napoletani.

The next morning we said arrivederci to Beppe and began mentally preparing for our arrival back to the chaos of Napoli on the ferry. Upon arrival we managed to sneak into a taxi while the other would-be passengers were busy partaking in a heated argument on where the queue began. Matters were only made worse by the fact that the taxi drivers themselves were soliciting rides from all corners of the piazza in front of the port. Our stay on the idyllic Ischia had officially ended. As our taxi got ready to take us to the station, the driver all of a sudden pulled in another random passenger to sit in the front. But, hey, at least our seatbelts functioned this time.

View of the Neapolitan gulf from the Ischian mountains. (photo courtesy of Maria Olsen)

My travel storytelling centers on long form first-hand accounts with a focus on vivid depictions of the local culture through the people I meet along the way. I also work as a travel advisor tailoring travel adventures all over the world, more info here: https://www.foratravel.com/advisor/nicola-volpi

Stay tuned! In the meantime you can find some of my other pieces below:

Travel
Travel Writing
Traveling
Travel Tips
Travellers
Recommended from ReadMedium