https://software.codidact.com/categories/38/tags/6206.rssNew Posts Tagged 'pandas' - Software DevelopmentSoftware Development - Codidact2023-10-06T03:50:30Zhttps://software.codidact.com/posts/288068Remove entries by two-column ID everywhere, that meet a condition somewheremcphttps://software.codidact.com/users/568022023-04-20T17:51:26Z2023-10-06T03:50:30Z<h1>MWE</h1>
<pre><code class="language-py">import random
import pandas as pd
from itertools import product
random.seed(12345)
dies = [1, 2]
cells = list(range(10))
currents = [100, ...https://software.codidact.com/posts/287884How to compress columns of dataframe by functionmcphttps://software.codidact.com/users/568022023-02-13T20:27:44Z2023-08-04T12:07:21Z<h1>Problem</h1>
<p>How can I compress each column of a dataframe to the output of a
function (i.e., mean), preserving columns?</p>
<h1>MWE</h1>
<pre><code class="language-py">import pandas as ...https://software.codidact.com/posts/288883Can pandas be used as a database backend for persistent storage?mcphttps://software.codidact.com/users/568022023-07-06T18:43:23Z2023-07-07T04:03:22Z<h1>Question</h1>
<p>What is the current state of the art database app? How does it compare to SQL? Can pandas be used in place of either?</p>
<p>If not, is there something that bridges the gap b...https://software.codidact.com/posts/287509Built-in way to compute coefficient of variation in pandasmcphttps://software.codidact.com/users/568022022-11-30T15:58:36Z2022-11-30T20:35:51Z<h1>Background</h1>
<p>The <a href="https://en.wikipedia.org/wiki/Coefficient_of_variation">coefficient of
variation</a> is:</p>
<blockquote>
<p>defined as the ratio of the standard deviation t...https://software.codidact.com/posts/286789How to plot table from pandas dataframemcphttps://software.codidact.com/users/568022022-07-22T19:12:18Z2022-08-11T14:10:46Z<h1>MWE</h1>
<pre><code class="language-py">import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df = pd.DataFrame(np.random.rand(9, 4), columns=['a', 'b', 'c', 'd'])
df....https://software.codidact.com/posts/286776How to add vertical lines for visual separation in pandas plotmcphttps://software.codidact.com/users/568022022-07-21T17:45:33Z2022-07-23T18:11:43Z<h1>MWE</h1>
<pre><code class="language-py">import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df = pd.DataFrame(np.random.rand(9, 4), columns=['a', 'b', 'c', 'd'])
df....https://software.codidact.com/posts/285244Comparing two excel files with Python based on changessfrowhttps://software.codidact.com/users/546492021-12-14T15:00:18Z2022-03-01T19:22:59Z<p>I have two tables:</p>
<p><b>Table1:</b></p>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>123</td>
<td>Description123</td>...