Posts

Showing posts with the label help

La lucha contra la recesión en EE.UU.: medidas de corto plazo, desafíos de largo plazo

Posible ensayo persuasivo sobre las medidas que se están tomando para evitar la recesión económica en Estados Unidos: Introducción La economía de Estados Unidos se enfrenta a grandes desafíos en la actualidad. La pandemia de COVID-19 provocó una fuerte contracción económica en 2020, con una caída del PIB del 3,4%. A esto se suma la alta inflación que alcanzó el 9,1% en junio de 2022, la más alta en los últimos 40 años. Ante este complejo panorama, el gobierno de Estados Unidos ha implementado una serie de medidas para tratar de evitar que la economía entre en recesión. Sin embargo, estas medidas tienen claroscuros y es discutible su real efectividad para lograr el objetivo deseado.  Desarrollo Entre las principales medidas que se han tomado para evitar la recesión se encuentran los estímulos fiscales, la flexibilización monetaria, los salvatajes a sectores estratégicos y el impulso al empleo.  Los estímulos fiscales han implicado millonarios paquetes de gasto público, como el ...

Algunos pasos esenciales para obtener los mejores resultados con ChatGPT

 Cómo escribir instrucciones efectivas para ChatGPT: 7 pasos esenciales para obtener los mejores resultados Lucas Pimentel, un desarrollador de inteligencia artificial y autoproclamado "adicto a las instrucciones", ha compartido su enfoque para crear instrucciones efectivas para ChatGPT. Según Pimentel, si no sabes cómo dar instrucciones de manera efectiva, esta herramienta seguirá siendo una novedad sin valor real. Para evitar crear mediocridad genérica y perder más tiempo del que ahorras, es importante aprender cómo dar instrucciones de manera efectiva. Aquí tienes 7 pasos para escribir buenas instrucciones para ChatGPT: 1. Asigna un rol: Dile a ChatGPT quién quieres que sea para ti. Asignar un rol hará que adopte el comportamiento correspondiente. Por ejemplo, podrías decir: "Tomarás el rol de un experto en redes sociales" o "Serás un coach de desarrollo personal". Es importante encontrar un equilibrio entre controlar el comportamiento del modelo y perm...

ChatGPT created this guide to Prompt Engineering

Image
These prompts provide specific instructions on how a piece of content should be written. They help in setting the tone, format, objective, and scope of the content, among other things. Let's analyze and illustrate some of these prompts with examples: 1. **Tone**: This describes the mood or attitude that the content should convey. If the tone is "formal," the language used should be structured, polite, and professional. For instance, "We appreciate your inquiry and are committed to resolving the issue promptly."   2. **Format**: This refers to the layout or structure of the content. In an "outline" format, the content might be structured like this:                                                                                      ...
 Hello, Here's a snipet that I found and modify to get input from user. Hope you like it. Please let me know if it is "pythonic" enough for you! Enjoy # SCRAPING TOOL TO GET RECIPIE SITES FROM THE INTERNET: # Documentation:  https://pypi.org/project/recipe-scrapers/ from recipe_scrapers import scrape_me # give the url as a string, it can be url from any site listed below scraper = scrape_me('https://www.allrecipes.com/recipe/158968/spinach-and-feta-turkey-burgers/') # Q: What if the recipe site I want to extract information from is not listed below? # A: You can give it a try with the wild_mode option! If there is Schema/Recipe available it will work just fine. scraper = scrape_me('https://www.feastingathome.com/tomato-risotto/', wild_mode=True) scraper.title() scraper.total_time() scraper.yields() scraper.ingredients() scraper.instructions() scraper.image() scraper.host() scraper.links() scraper.nutrients()  # if available scrape_dict = scraper.links() # ...
USEFUL PYTHON TIPS AND TRICKS 👀 I'd like to share this today!!!  # Swap two variables with one line of code. Shorten your code a = 1 b =2 a, b = b, a # Duplicate strings without looping fruit_names = "Banana", "Mango" print (fruit_names * 4) # Reverse a string my_words = "The Quick Brown Fox" reverse_words = my_words[::-1] print(reverse_words) # Compress a list of strings into one string my_words = ["This", "is", "a", "Test"] combine_all = " ".join(my_words) print(combine_all) # You can also compare or evaluate in a line of code x = 100 res = 0 < x < 1000 > 50 print(res) # Find the most frequest element in a list test_list = [4, 3, 2, 3, 2, 4, 3, 6, 9, 41, 2, 3, 4] most_frequent = max(set(test_list), key = test_list.count) print(most_frequent) # Unpack list to separate variables (or assign list to separate varabiels) arr_list = [1,2,3] a,b,c = arr_list print(a,b,c) # One-liner if-else statemen...
Image
  Here are different ways to create a dataframe in PYTHON USING PANDAS LIBRARY  code In [2]: # from a Python lis # Import the library - in this case pandas import pandas as pd # create and initialize a list of multiple lists multilist = [[ 'george' , 2 ], [ 'peter' , 25 ], [ 'alice' , 24 ]] # Create DataFrame df = pd . DataFrame ( multilist , columns = [ 'First Name' , 'Age' ]) # print (show) dataframe. df Out[2]: First Name Age 0 george 2 1 peter 25 2 alice 24 In [3]: # Method #2: Creating DataFrame from dict of an narray/lists # To create DataFrame from a python dictionary of narray/list, all the narray must be of same length. # If index is passed then the length index should be equal to the length of arrays. If no index is passed, then by default, index will # be range(n) where n is the array length. In [3]: # DataFrame from dict narray / lists # Addresses by default import pandas as pd ...