<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lucas Lima on Medium]]></title>
        <description><![CDATA[Stories by Lucas Lima on Medium]]></description>
        <link>https://medium.com/@lucaslima_26748?source=rss-c7a3fb1c9536------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*T0UV0_knoNRd9YvqCj8j9g.png</url>
            <title>Stories by Lucas Lima on Medium</title>
            <link>https://medium.com/@lucaslima_26748?source=rss-c7a3fb1c9536------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 23:37:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lucaslima_26748/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[v1 | The Five Motivation Languages]]></title>
            <link>https://medium.com/@lucaslima_26748/v1-the-five-motivation-languages-817dfce186d9?source=rss-c7a3fb1c9536------2</link>
            <guid isPermaLink="false">https://medium.com/p/817dfce186d9</guid>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Lucas Lima]]></dc:creator>
            <pubDate>Fri, 13 Sep 2024 14:26:01 GMT</pubDate>
            <atom:updated>2024-09-13T14:26:01.497Z</atom:updated>
            <content:encoded><![CDATA[<p>People can feel motivated for different reasons. You might feel motivated after watching a <a href="https://www.ted.com/"><em>TED Talk</em></a> video, while the person next to you might feel motivated after practicing Yoga.</p><p>This can also be true at work. One person may feel motivated after the manager discusses and presents the company’s quarterly results, while another person feels motivated because the manager frees up the first hours of the morning — meeting-wise — so the team can work with more focus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvcHzGfn21Rr8Xa0d_YPlw.jpeg" /><figcaption>Image generated by Copilot (Microsoft) by the author with the prompt “image about motivation without people and words.”</figcaption></figure><p>I thought about this after reading the book “The Five Love Languages” by Gary Chapman. The author argues that people express love and feel loved in different ways:</p><ol><li>Acts of service;</li><li>Quality time;</li><li>Words of affirmation;</li><li>Physical touch;</li><li>Gifts.</li></ol><p>In this sense, people express love and feel loved by doing things like keeping the house clean or washing the dishes; spending time chatting about the day; saying how much they admire and love their partner; hugging or walking hand in hand; and giving gifts.</p><p>Of course, we can have more than one love language, with some being stronger than others. I think this can also happen with motivation.</p><p>Just like love languages, it’s worth getting to know ourselves better to understand what motivates us. And also, to better understand the people around us to know what motivates them.</p><p>What motivates you in your personal life? What motivates you at work? <br>Thinking about these questions in practical terms, in things you can apply day-to-day, is really effective!</p><p>Portuguese version: <a href="https://medium.com/@lucaslima_26748/v1-as-cinco-linguagens-da-motiva%C3%A7%C3%A3o-1541ddf6adee">https://medium.com/@lucaslima_26748/v1-as-cinco-linguagens-da-motiva%C3%A7%C3%A3o-1541ddf6adee</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=817dfce186d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[v1 | As Cinco Linguagens Da Motivação]]></title>
            <link>https://medium.com/@lucaslima_26748/v1-as-cinco-linguagens-da-motiva%C3%A7%C3%A3o-1541ddf6adee?source=rss-c7a3fb1c9536------2</link>
            <guid isPermaLink="false">https://medium.com/p/1541ddf6adee</guid>
            <category><![CDATA[motivação]]></category>
            <category><![CDATA[autoconhecimento]]></category>
            <category><![CDATA[autocuidado]]></category>
            <dc:creator><![CDATA[Lucas Lima]]></dc:creator>
            <pubDate>Fri, 13 Sep 2024 14:08:02 GMT</pubDate>
            <atom:updated>2024-09-13T14:08:02.340Z</atom:updated>
            <content:encoded><![CDATA[<p>As pessoas podem se sentir motivadas por diferentes razões. Você pode se sentir motivado após assistir um vídeo do <a href="https://www.ted.com/">TED talks</a>, enquanto a pessoa ao seu lado pode se sentir motivada após fazer Yoga.</p><p>Isso também pode ser verdade no trabalho. Uma pessoa pode se sentir motivada após o gestor discutir e apresentar os resultados da empresa no fechamento do trimestre, enquanto outra pessoa se sente motivada pelo fato de o gestor liberar as primeiras horas da manhã — em termos de reuniões — para que a equipe trabalhe com mais foco.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvcHzGfn21Rr8Xa0d_YPlw.jpeg" /><figcaption>Imagem gerada do Copilot (Microsoft) pelo autor com o prompt “imagem sobre motivação sem pessoas e sem palavras”</figcaption></figure><p>Pensei nisso após ler o livro “As cinco linguagens do amor” de Gary Chapman. O autor argumenta que as pessoas expressam amor e se sentem amadas de diferentes maneiras:</p><ol><li>atos de serviço;</li><li>tempo de qualidade;</li><li>palavras de afirmação;</li><li>toque físico;</li><li>presentes.</li></ol><p>Nesse sentido, pessoas expressam amor e sentem amadas realizando tarefas do tipo manter a casa limpa ou lavar a louça; passar um tempo trocando ideia sobre o dia; falando o quanto admira e ama a pessoa companheira; abraça ou caminha de mãos dadas; e presenteia.</p><p>Claro, podemos ter mais de uma linguagem do amor, sendo umas mais fortes que as outras. Penso que isso pode ocorrer também com a motivação.</p><p>Da mesma maneira que as linguagens do amor, vale a pena nos conhecermos melhor para saber o que nos motiva. E também, conhecer melhor as pessoas ao nosso redor para entender o que as motiva.</p><p>O que te motiva na vida pessoal? O que te motiva no trabalho?</p><p>Pensar nessas perguntas em termos práticos, em coisas aplicáveis no dia a dia é fera demais!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1541ddf6adee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[v1 | Map of feelings]]></title>
            <link>https://medium.com/@lucaslima_26748/v1-map-of-feelings-4b809136425a?source=rss-c7a3fb1c9536------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b809136425a</guid>
            <category><![CDATA[emotions]]></category>
            <category><![CDATA[journal]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[feelings]]></category>
            <category><![CDATA[therapy]]></category>
            <dc:creator><![CDATA[Lucas Lima]]></dc:creator>
            <pubDate>Mon, 08 Jul 2024 14:36:20 GMT</pubDate>
            <atom:updated>2024-07-08T14:36:20.616Z</atom:updated>
            <content:encoded><![CDATA[<p>In any therapy session you undergo, you’ll face these questions:</p><ul><li>How are you feeling?</li><li>How did this event make you feel?</li></ul><p>And you will have difficulty answering, so you might say something like “I don’t know,” “I was pissed,” “happy, I guess.”</p><p>I have always had difficulty expressing what I am feeling. There are several ways to improve how we name what we are feeling. One of them, which I practice daily, is writing about how I am feeling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*v1E8ZA0Q6mYXlzfHkDNH1w.png" /></figure><p>I thought recently that a map of feelings could help me, so I could consult this map before writing. This way, I would be more capable of identifying my feelings more accurately.</p><p>I did a quick search and built a map. It’s important to keep in mind that I edited this map to include the feelings that make the most sense to me. You can use what I created and edit it specifically for yourself.</p><h3>Map of feelings</h3><p>I built the map to include seven major emotions that group how I can feel. These seven emotions relate to Paul Ekman’s classification.</p><p>The main point is that emotions are universal. Any human being in different cultures can feel these emotions. However, the experience we have with each emotion generates different feelings in people. We can also think that we feel the emotions because of the feelings.</p><h4>1) Enjoyment / Happyness</h4><pre>ACCEPTED<br>  - joyful<br>  - involved<br>  - valued<br>LOVING<br>  - passionate<br>  - affectionate<br>  - intimate<br>PLAYFUL<br>  - excited<br>  - humorous<br>ENTHUSIASTIC<br>  - confident<br>  - creative<br>  - curious<br>  - hopeful<br>  - inspired<br>  - interested<br>  - optimistic<br>PROUD<br>  - independent<br>  - respected<br>  - recognized<br>  - admired<br>PEACEFUL<br>  - calm<br>SATISFIED<br>  - fulfilled<br>  - accomplished</pre><h4>2) Sadness</h4><pre>DISTRESSED<br>  - desperate<br>  - grieving<br>LONGING<br>  - isolated<br>  - nostalgic<br>DEPRESSED<br>  - empty<br>HURT<br>  - sulky<br>  - ashamed<br>  - inferior<br>  - disappointed<br>VULNERABLE<br>  - abandoned<br>  - fragile<br>  - helpless</pre><h4>3) Anger</h4><pre>AGGRESSIVE<br>  - provoked<br>  - hostile<br>  - paranoid<br>BITTER<br>  - embittered<br>  - indignant<br>  - impatient<br>SKEPTICAL<br>DISAPPOINTED<br>DISTANT<br>  - upset<br>HUMILIATED<br>  - disrespected<br>  - ridiculed</pre><h4>4) Fear</h4><pre>THREATENED<br>  - cornered<br>  - persecuted<br>SCARED<br>  - frightened<br>  - helpless<br>FRAGILE<br>  - inferior<br>  - insignificant<br>  - inadequate<br>  - irrelevant<br>UNCERTAIN<br>INSECURE<br>  - worried<br>  - sensitive<br>  - vulnerable<br>REJECTED<br>  - excluded<br>  - small</pre><h4>5) Surprise</h4><pre>SCARED<br>  - astonished<br>  - shocked<br>CONFUSED<br>  - disillusioned<br>  - perplexed<br>ENTHUSIASTIC<br>  - anxious<br>  - energetic</pre><h4>6) Disgust</h4><pre>DISAPPOINTED<br>  - let down<br>  - disgusted<br>  - repulsed<br>CONTEMPT<br>  - antipathy</pre><h4>7) Indifference</h4><pre>BORED<br>- Uninterested<br>- Dull<br>- Lethargic<br><br>APATHETIC<br>- Numb<br>- Detached<br>- Unconcerned<br>- Apathetic<br><br>DISTRACTED<br>- Inattentive<br>- Unfocused</pre><h3>Examples of use</h3><ul><li>Today I was <strong>happy</strong> in the first meeting of the day. I managed to collaborate and was listened to, so I felt <strong>accepted</strong> and <strong>involved</strong>.</li><li>Later this afternoon, I got <strong>angry</strong> at a guy who didn’t stop his car at the pedestrian crossing and sped through. This made me feel <strong>indignation</strong>, <strong>impatience</strong>, and I felt <strong>bitter</strong> for a while after the incident.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b809136425a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[v1 | Mapa dos Sentimentos]]></title>
            <link>https://medium.com/@lucaslima_26748/v1-mapa-dos-sentimentos-0a129a54d379?source=rss-c7a3fb1c9536------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a129a54d379</guid>
            <category><![CDATA[sentimentos]]></category>
            <category><![CDATA[terapia]]></category>
            <category><![CDATA[sentimentos-no-papel]]></category>
            <category><![CDATA[diário]]></category>
            <category><![CDATA[escrita]]></category>
            <dc:creator><![CDATA[Lucas Lima]]></dc:creator>
            <pubDate>Wed, 26 Jun 2024 00:26:40 GMT</pubDate>
            <atom:updated>2024-06-26T00:26:40.450Z</atom:updated>
            <content:encoded><![CDATA[<p>Em qualquer terapia que você fizer, você vai se deparar com as perguntas:</p><ul><li>como está se sentindo?</li><li>como esse acontecimento fez você se sentir?</li></ul><p>E você vai ter dificuldade pra responder, de modo que falará algo do tipo “sei lá”; “fiquei puto” ; “feliz, eu acho”.</p><p>Eu sempre tive essa dificuldade de falar o que estou sentindo. Há diversas formas de melhorar como nomeamos o que estamos sentindo. Uma delas, pratico diariamente, que é escrever sobre como estou me sentindo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*v1E8ZA0Q6mYXlzfHkDNH1w.png" /></figure><p>Pensei esses dias que um mapa dos sentimentos poderia me ajudar, de modo que eu pudesse consultar esse mapa antes de escrever. Com isso, estaria mais apto a identificar com mais precisão meus sentimentos.</p><p>Fiz uma pesquisa rápida e construí um mapa. É importante ter em mente que editei esse mapa para os sentimentos que fazem mais sentido pra mim. Você pode aproveitar o que construí e editar um especificamente para você.</p><h3>Mapa dos sentimentos</h3><p>Construí o mapa de modo a ter <strong>sete grandes emoções</strong> que agrupam como posso me sentir. Essas sete emoções têm a ver com a classificação de <a href="https://pt.wikipedia.org/wiki/Paul_Ekman#:~:text=Classifica%C3%A7%C3%A3o%20das%20emo%C3%A7%C3%B5es,-A%20Ekman%20desenvolveu&amp;text=Com%20essas%20informa%C3%A7%C3%B5es%2C%20ele%20concluiu,tristeza%20como%20as%20emo%C3%A7%C3%B5es%20humanas.">Paulo Ekman</a>.</p><p>O ponto principal é que as emoções são universais. Qualquer ser humano em diferentes culturas podem sentir essas emoções. Porém, a experiência que passamos com cada emoção gera sentimentos diferentes nas pessoas. Podemos pensar também que sentimos as emoções por causa dos sentimentos.</p><h4>1) Felicidade / Alegria</h4><pre>ACEITO<br>  - alegre<br>  - participante<br>  - valorizado<br>AMOROSO<br>  - apaixonado<br>  - carinhoso<br>  - íntimo<br>BRINCALHÃO<br>  - animado<br>  - bem humorado<br>EMPOLGADO<br>  - confiante<br>  - criativo<br>  - curioso<br>  - esperançoso<br>  - inspirado<br>  - interessado<br>  - otimista<br>ORGULHOSO<br>  - independente<br>  - respeitado<br>  - reconhecido<br>  - admirado<br>PACÍFICO<br>  - tranquilo<br>SATISFEITO<br>  - saciado<br>  - realizado</pre><h4>2) Tristeza</h4><pre>AFLITO<br>  - desesperado<br>  - em luto<br>SAUDOSO<br>  - isolado<br>  - nostálgico<br>DEPRIMIDO<br>  - vazio<br>FERIDO<br>  - amuado<br>  - envergonhado<br>  - inferior<br>  - decepcionado<br>VULNERÁVEL<br>  - abandonado<br>  - frágil<br>  - impotente</pre><h4>3) Raiva</h4><pre>AGRESSIVO<br>  - provocado<br>  - hostil<br>  - noiado<br>AMARGO<br>  - amargurado<br>  - indignado<br>  - impaciente<br>CÉTICO<br>DECEPCIONADO<br>DISTANTE<br>  - chateado<br>HUMILHADO<br>  - desrespeitado<br>  - ridicularizado</pre><h4>4) Medo</h4><pre>AMEAÇADO<br>  - acuado<br>  - perseguido<br>ASSUSTADO<br>  - amedrontado<br>  - desamparado<br>FRÁGIL<br>  - inferior<br>  - insignificante<br>  - insuficiente<br>  - irrelevante<br>INCERTO<br>INSEGURO<br>  - preocupado<br>  - sensível<br>  - vulnerável<br>REJEITADO<br>  - excluído<br>  - pequeno<br></pre><h4>5) Surpresa</h4><pre>ADMIRADO<br>ASSUSTADO<br>  - atônito<br>  - chocado<br>CONFUSO<br>  - desiludido<br>  - perplexo<br>ENTUSIASMADO<br>  - ansioso<br>  - energético</pre><h4>6) Aversão / Nojo / Asco</h4><pre>DECEPCIONADO<br>  - desapontado<br>  - enjoado<br>  - repulsa<br>DESPREZO<br>  - antipatia</pre><h4>7) Indiferença</h4><pre>ENTEDIADO<br>APÁTICO<br>DISPERSO</pre><p>Vira e mexe, eu pego uma palavra do mapa e jogo no dicionário <a href="https://dicionario.priberam.org/">Priberam</a>, que abre mais um leque de possibilidades.</p><p>Exemplos de uso do mapa</p><ul><li>Hoje fiquei <strong>feliz</strong> na primeira reunião do dia. Consegui colaborar e fui ouvido, de modo que me senti <strong>aceito</strong> e <strong>participante</strong>.</li><li>Na tarde de hoje, fiquei com <strong>raiva</strong> de um cara que não parou o carro na faixa de pedestre e passou em alta velocidade. Isso me fez sentir <strong>indignação</strong>, <strong>impaciência</strong> e fiquei <strong>amargo</strong> por um tempo depois do acontecimento.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a129a54d379" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[v1 | Versionamento de artigos]]></title>
            <link>https://medium.com/@lucaslima_26748/v1-versionamento-de-artigos-350a1b2f749e?source=rss-c7a3fb1c9536------2</link>
            <guid isPermaLink="false">https://medium.com/p/350a1b2f749e</guid>
            <category><![CDATA[escrita]]></category>
            <category><![CDATA[publicações]]></category>
            <category><![CDATA[organização-de-artigos]]></category>
            <category><![CDATA[organização-pessoal]]></category>
            <dc:creator><![CDATA[Lucas Lima]]></dc:creator>
            <pubDate>Wed, 26 Jun 2024 00:19:12 GMT</pubDate>
            <atom:updated>2024-06-26T00:19:12.397Z</atom:updated>
            <content:encoded><![CDATA[<p>Penso que no dia a dia de publicações de artigos, muitos deles podem ser revisados. Com isso, pensei em publica-los novamente com o devido versionamento. Dessa maneira, conseguirei rastrear as alterações em um artigo e o leitor também terá essa informação.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GgFoni9O3jwZQki7pOqPrg.jpeg" /><figcaption>imagem gerada por IA com prompt do autor.</figcaption></figure><p>A organização do versionamento seguirá os seguintes preceitos:</p><ul><li>no começo do nome do artigo, teremos o indicador da versão antes de um <em>pipe</em> da seguinte maneira: “v1 | nome do artigo”. Para versões subsequentes, novas publicações serão feitas com o mesmo nome de artigo e o número atualizado (“v2 | nome do artigo”);</li><li>quando o artigo for superior a “v1”, logo após a introdução, colarei uma tabela com a seguinte estrutura:</li></ul><pre>|    data    | versão | alterações        | link<br>|------------|--------|-----------------------------<br>| dd/mm/yyyy |   v1   | primeira versão   | link<br>| dd/mm/yyyy |   v2   | adição da seção X | link</pre><h3>Por que isso é importante?</h3><p>Atualmente, trabalho como coordenador de Ciência de Dados. Nessa área, a importância da documentação detalhada de projetos, análises, códigos e estudos é gigante. As documentações nos ajudam com o seguinte:</p><ul><li>deixar claro o propósito sobre o qual estamos trabalhando;</li><li>exercitar o <em>story telling </em>do projeto;</li><li>facilitar que outras pessoas entendam o que foi feito naquele projeto sem que haja a necessidade de consultar os desenvolvedores.</li></ul><p>No entanto, as documentações são dinâmicas e precisam ser constantemente atualizadas durante o desenvolvimento do projeto e após a conclusão, sempre que revisitamos os documentos. Para isso, fazemos uso do versionamento de documentações e de códigos. Essa prática garante que todas as alterações sejam registradas e que possamos rastrear o histórico de modificações de maneira eficiente.</p><p>Inspirado por essa abordagem, resolvi aplicar a mesma lógica aos artigos que publico. O versionamento em artigos aqui no <em>Medium</em> permitirá o mapeamento da atualização de artigos já publicados, sem a necessidade de publicar o mesmo tema com um título diferente.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=350a1b2f749e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Objects Iteratively With Python]]></title>
            <link>https://medium.com/@lucaslima_26748/creating-objects-iteratively-with-python-caeb86ff2583?source=rss-c7a3fb1c9536------2</link>
            <guid isPermaLink="false">https://medium.com/p/caeb86ff2583</guid>
            <category><![CDATA[iteration]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[for]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Lucas Lima]]></dc:creator>
            <pubDate>Wed, 20 Jul 2022 18:44:56 GMT</pubDate>
            <atom:updated>2022-07-20T18:44:56.229Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lZkkDqYTFqbD6sVJD4u8iw.png" /></figure><p>In the daily work with programming, often I need to create many objects with Python. This task can be boring if we decide to do this with “copy and paste” changing just the suffix for example. Could be more efficient create these objects in a iteratively way.</p><p>Looking up for this on the web, I found many ways to do this. I’ll share the way that I found more practical.</p><p>In a simple way, we can create de objects obj1 , obj2 e obj3 like this:</p><pre>for n in [1,2,3]:<br>    globals()[f&#39;obj{n}&#39;] = n**2</pre><p>The results of the code above are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*wpdsa-tKF6hOk64f6fb9rA.png" /></figure><p>A very common situation is when you need to ‘break’ your dataset by the categories of a variable.</p><p>Consider this dataset:</p><pre>import pandas as pd<br>df=pd.DataFrame({<br>    &#39;month&#39;:[&#39;2022-01&#39;,&#39;2022-02&#39;,&#39;2022-03&#39;,&#39;2022-04&#39;,&#39;2022-06&#39;]*10,<br>    &#39;x1&#39;:[1,4,9,1.737,2.333]*10<br>})</pre><p>We have the following entries for the variable ‘month’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*l8zKhtSh8eXkDsTBBhhMWQ.png" /></figure><p>Thus, we can create a dataset for each ‘month’ like this:</p><pre>for nmonth in list(df.month.unique()):<br>    globals()[f&#39;df_{nmonth}&#39;]=df[df.month==nmonth]</pre><p>With this, we have the following result for the first dataset:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*JHLZTntRYjHgFPOw_qV7NQ.png" /></figure><p>And we have results like the above for the other 4 datasets.</p><p>That’s it! Thanks for reading.</p><p>Para a versão em português desta publicação, acesse o link abaixo:</p><p><a href="https://medium.com/@lucaslima_26748/criando-objetos-iterativamente-em-python-5687bf736fec">Criando objetos iterativamente em Python</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caeb86ff2583" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Criando objetos iterativamente em Python]]></title>
            <link>https://medium.com/@lucaslima_26748/criando-objetos-iterativamente-em-python-5687bf736fec?source=rss-c7a3fb1c9536------2</link>
            <guid isPermaLink="false">https://medium.com/p/5687bf736fec</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Lucas Lima]]></dc:creator>
            <pubDate>Tue, 19 Jul 2022 00:06:29 GMT</pubDate>
            <atom:updated>2022-07-20T18:46:03.504Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jdE8QNKrmV49a5g9SxQijQ.png" /></figure><p>No dia a dia do trabalho com programação, me deparo frequentemente com a necessidade de criar objetos de maneira iterativa no Python (em um for, por exemplo).</p><p>Pesquisando na internet, encontrei várias maneiras de fazer isso, mas vou compartilhar aqui aquela que achei mais prática.</p><p>De maneira bem simples, podemos criar os objetos obj1 , obj2 e obj3 da seguinte forma:</p><pre>for n in list(range(1,3)):<br>    globals()[f&#39;obj{n}&#39;] = n**2</pre><p>O resultado das duas linhas de código acima são objetos obj1 , obj2 e obj3com os conteúdos 1, 4 e 9, respectivamente.</p><p>Uma situação bem comum pra usar isso é separar uma base que contém vários meses em uma base por mês, por exemplo.</p><p>Considere essa base:</p><pre>import pandas as pd<br>dados=pd.DataFrame({<br>    &#39;month&#39;:[&#39;2022-01&#39;,&#39;2022-02&#39;,&#39;2022-03&#39;,&#39;2022-04&#39;,&#39;2022-06&#39;]*10,<br>    &#39;x1&#39;:[1,4,9,1.737,2.333]*10<br>})</pre><p>Temos o seguinte em termos da variável “month”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*Z2ntUgxfQKmzIJ3HGgl35A.png" /></figure><p>Com isso, podemos criar uma base para cada “month” da seguinte maneira:</p><pre>for nmonth in list(dados.month.unique()):<br>    globals()[f&#39;base_{nmonth}&#39;]=dados[dados.month==nmonth]</pre><p>Dessa forma, temos o seguinte para a primeira base:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*15RDcIyr5nIwuobtJwYzjw.png" /></figure><p>E assim suscetivamente para cada uma das entradas da variável “month”.</p><p>É isso! Obrigado pela leitura!</p><p>For the english version, click the link bellow:</p><p><a href="https://medium.com/@lucaslima_26748/creating-objects-iteratively-with-python-caeb86ff2583">Creating Objects Iteratively With Python</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5687bf736fec" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>