<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Piotr</title>
    <description>The latest articles on DEV Community by Piotr (@pplonski).</description>
    <link>https://dev.to/pplonski</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F380593%2F022d66eb-55c7-43a3-9dfa-46df4ac538c7.jpeg</url>
      <title>DEV Community: Piotr</title>
      <link>https://dev.to/pplonski</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pplonski"/>
    <language>en</language>
    <item>
      <title>AI-Generated Code Looked Right, but the Data Was Wrong</title>
      <dc:creator>Piotr</dc:creator>
      <pubDate>Tue, 05 May 2026 09:08:22 +0000</pubDate>
      <link>https://dev.to/pplonski/ai-generated-code-looked-right-but-the-data-was-wrong-53d1</link>
      <guid>https://dev.to/pplonski/ai-generated-code-looked-right-but-the-data-was-wrong-53d1</guid>
      <description>&lt;p&gt;I'm working on an AI Data Analyst in MLJAR Studio.&lt;/p&gt;

&lt;p&gt;The idea is simple: you ask a question in natural language, AI writes Python code, executes it, and shows the result.&lt;/p&gt;

&lt;p&gt;But recently I found a small example that reminded me why AI data analysis needs more than code generation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The code worked
&lt;/h2&gt;

&lt;p&gt;I was testing a medical data analysis use case with a diabetes CSV file.&lt;/p&gt;

&lt;p&gt;The first task was simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;load data from this URL&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;AI generated Pandas code with &lt;code&gt;read_csv()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The code executed without errors.&lt;br&gt;&lt;br&gt;
The dataframe was displayed.&lt;br&gt;&lt;br&gt;
The shape looked correct: 768 rows and 9 columns.&lt;/p&gt;

&lt;p&gt;So everything looked fine.&lt;/p&gt;

&lt;p&gt;But then I looked at the dataframe.&lt;/p&gt;

&lt;h2&gt;
  
  
  148 pregnancies?
&lt;/h2&gt;

&lt;p&gt;In the first row, the &lt;code&gt;Pregnancies&lt;/code&gt; column had value &lt;code&gt;148&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That immediately looked wrong.&lt;/p&gt;

&lt;p&gt;Values like &lt;code&gt;0&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt;, &lt;code&gt;2&lt;/code&gt;, &lt;code&gt;6&lt;/code&gt;, or &lt;code&gt;8&lt;/code&gt; make sense for number of pregnancies.&lt;/p&gt;

&lt;p&gt;But &lt;code&gt;148&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;No.&lt;/p&gt;

&lt;p&gt;Then I noticed more strange things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Pregnancies&lt;/code&gt; had values like &lt;code&gt;148&lt;/code&gt;, &lt;code&gt;85&lt;/code&gt;, &lt;code&gt;183&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Age&lt;/code&gt; had values like &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Outcome&lt;/code&gt; was empty&lt;/li&gt;
&lt;li&gt;the whole dataframe looked shifted&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The code worked, but the data was wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI also checked the output
&lt;/h2&gt;

&lt;p&gt;In MLJAR Studio, my AI Data Analyst is not a one-step workflow.&lt;/p&gt;

&lt;p&gt;It doesn't only:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;generate code&lt;/li&gt;
&lt;li&gt;execute code&lt;/li&gt;
&lt;li&gt;show result&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After the code is executed, there is another step. The LLM analyzes the generated output.&lt;/p&gt;

&lt;p&gt;So AI doesn't only ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Did the code run?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It also asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Does the output make sense?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this case, AI also noticed that something was wrong. It found suspicious values, missing values in the last column, and strange statistics.&lt;/p&gt;

&lt;p&gt;This was very useful because Pandas didn't raise an error. The dataframe was created. But the output was incorrect.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened?
&lt;/h2&gt;

&lt;p&gt;The CSV had a small formatting issue: an extra comma in the header row.&lt;/p&gt;

&lt;p&gt;Because of that, Pandas treated the first value in each row as the dataframe index.&lt;/p&gt;

&lt;p&gt;So the columns were shifted.&lt;/p&gt;

&lt;p&gt;The value &lt;code&gt;148&lt;/code&gt; was not the number of pregnancies. It was the glucose value.&lt;/p&gt;

&lt;p&gt;That is why &lt;code&gt;Glucose&lt;/code&gt; appeared as &lt;code&gt;Pregnancies&lt;/code&gt;, &lt;code&gt;Outcome&lt;/code&gt; appeared as &lt;code&gt;Age&lt;/code&gt;, and the real &lt;code&gt;Outcome&lt;/code&gt; column was empty.&lt;/p&gt;

&lt;h2&gt;
  
  
  The lesson
&lt;/h2&gt;

&lt;p&gt;This example is small, but the lesson is important.&lt;/p&gt;

&lt;p&gt;AI-generated code can look correct.&lt;br&gt;&lt;br&gt;
The notebook can run without errors.&lt;br&gt;&lt;br&gt;
The dataframe can be displayed.&lt;/p&gt;

&lt;p&gt;And the data can still be wrong.&lt;/p&gt;

&lt;p&gt;That is why AI data analysis needs output verification.&lt;/p&gt;

&lt;p&gt;We need a human in the loop, because humans can use common sense. In this case, &lt;code&gt;148&lt;/code&gt; pregnancies was clearly impossible.&lt;/p&gt;

&lt;p&gt;But AI in the loop is helpful as well. AI can scan the output, check basic statistics, and warn us about suspicious values.&lt;/p&gt;

&lt;p&gt;For me, the best workflow is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ask AI to generate code&lt;/li&gt;
&lt;li&gt;execute the code&lt;/li&gt;
&lt;li&gt;display the output&lt;/li&gt;
&lt;li&gt;let AI inspect the output&lt;/li&gt;
&lt;li&gt;let the human review the result&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;AI can help us move faster.&lt;/p&gt;

&lt;p&gt;But in data analysis, the real question is not:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Did the code run?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Does the output make sense?&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>datascience</category>
      <category>pandas</category>
    </item>
    <item>
      <title>Reimagine Python Notebooks in the AI Era: What If You Didn’t Write Code First?</title>
      <dc:creator>Piotr</dc:creator>
      <pubDate>Fri, 17 Apr 2026 10:21:35 +0000</pubDate>
      <link>https://dev.to/pplonski/reimagine-python-notebooks-in-the-ai-era-what-if-you-didnt-write-code-first-n6l</link>
      <guid>https://dev.to/pplonski/reimagine-python-notebooks-in-the-ai-era-what-if-you-didnt-write-code-first-n6l</guid>
      <description>&lt;p&gt;For years, Jupyter Notebook has been the default tool for data analysis in Python.&lt;/p&gt;

&lt;p&gt;But it assumes one thing:&lt;/p&gt;

&lt;p&gt;👉 you start with code.&lt;/p&gt;

&lt;h2&gt;
  
  
  What if you didn’t?
&lt;/h2&gt;

&lt;p&gt;I’ve been experimenting with a different workflow.&lt;/p&gt;

&lt;p&gt;Instead of writing Python, you describe what you want in plain English — and the system generates and runs the code for you.&lt;/p&gt;

&lt;p&gt;The flow becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prompt → LLM-generated code → auto-execution → results
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code is still there.&lt;br&gt;
But it’s no longer the starting point.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why this might matter
&lt;/h2&gt;

&lt;p&gt;The idea came from a simple observation.&lt;/p&gt;

&lt;p&gt;Someone told me:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I don’t care about the code. I care about the results.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And honestly, that stuck with me.&lt;/p&gt;

&lt;p&gt;As engineers, we often treat code as the main interface.&lt;br&gt;
But for many people, it’s just a tool to get answers.&lt;/p&gt;
&lt;h2&gt;
  
  
  Old problems... less important?
&lt;/h2&gt;

&lt;p&gt;There has been a lot of criticism of notebooks over the years:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;hidden state&lt;/li&gt;
&lt;li&gt;mixing code and outputs&lt;/li&gt;
&lt;li&gt;hard to review in git&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These problems are real.&lt;/p&gt;

&lt;p&gt;But I’m starting to wonder if AI changes which of them actually matter.&lt;/p&gt;

&lt;p&gt;If:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;code is generated&lt;/li&gt;
&lt;li&gt;execution is automated&lt;/li&gt;
&lt;li&gt;results become the main interface&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;then some of these issues feel... less central.&lt;/p&gt;
&lt;h2&gt;
  
  
  New problems appear
&lt;/h2&gt;

&lt;p&gt;Of course, we are not removing complexity — we are shifting it.&lt;/p&gt;

&lt;p&gt;New challenges show up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;trusting LLM-generated code&lt;/li&gt;
&lt;li&gt;debugging when something goes wrong&lt;/li&gt;
&lt;li&gt;less visibility into what is actually happening&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In some cases, these might be even harder than the original problems.&lt;/p&gt;
&lt;h2&gt;
  
  
  A small but important detail
&lt;/h2&gt;

&lt;p&gt;One thing I care about a lot:&lt;/p&gt;

&lt;p&gt;👉 everything is still saved as a standard &lt;code&gt;.ipynb&lt;/code&gt; file&lt;/p&gt;

&lt;p&gt;So you can always:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;open it in a classic notebook&lt;/li&gt;
&lt;li&gt;inspect the code&lt;/li&gt;
&lt;li&gt;edit anything manually&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nothing is locked in.&lt;/p&gt;
&lt;h2&gt;
  
  
  So what’s really changing?
&lt;/h2&gt;

&lt;p&gt;Maybe the biggest shift is this:&lt;/p&gt;

&lt;p&gt;We are moving from:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;code → results
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;intent → results
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code becomes an implementation detail, not the main interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open question
&lt;/h2&gt;

&lt;p&gt;Are we solving notebook problems — or just hiding them behind AI?&lt;/p&gt;

&lt;p&gt;I wrote a longer version with screenshots and implementation details here:&lt;br&gt;
👉 &lt;a href="https://mljar.com/blog/reimagine-python-notebook-in-ai-era/" rel="noopener noreferrer"&gt;https://mljar.com/blog/reimagine-python-notebook-in-ai-era/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’d love to hear your perspective:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Would you use a prompt-first notebook?&lt;/li&gt;
&lt;li&gt;Does this make notebooks better — or just different?&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>jupyter</category>
      <category>ai</category>
      <category>datascience</category>
    </item>
  </channel>
</rss>
