Unnamed: 0 int64 0 378k | id int64 49.9k 73.8M | title stringlengths 15 150 | question stringlengths 37 64.2k | answer stringlengths 37 44.1k | tags stringlengths 5 106 | score int64 -10 5.87k |
|---|---|---|---|---|---|---|
364,000 | 68,922,339 | How to solve Dataframe to_numeric Error (Python)? | <p>I have dataframe that contains float numbers. I want to do numeric operations as sum mult. etc. .
Columns types are object. So i have to change this columns into a numeric columns.
I use to_numeric function but it gives me NaN as a result.</p>
<p>How can i solve this problem?</p>
<p>Code :</p>
<pre><code>#import lib... | <p>If you change <code>errors</code> from <code>coerce</code> to <code>raise</code>, you will see that <code>pandas</code> cannot convert these values to numerical datatype. This is because it does not recognize <code>,</code> as a decimal separator (by default, it is <code>.</code>). Which means having <code>errors = ... | python|pandas | 1 |
364,001 | 69,126,374 | Automatically Normalizing a Postgres JSON Column into a New Table | <p>I have a <em>very large</em> Postgres table with millions of rows. One of the columns is called <code>data</code> and is of type <code>JSONB</code> with nested JSON (but thankfully no sub-arrays). The "schema" for the JSON is mostly consistent, but has evolved a bit over time, gaining and losing new keys a... | <p>You can try to create a new table via the <a href="https://www.postgresql.org/docs/13/sql-createtableas.html" rel="nofollow noreferrer">CREATE TABLE AS</a> statement.</p>
<pre class="lang-sql prettyprint-override"><code>CREATE TABLE newtable AS
SELECT
id,
(data->>'hi')::text AS data_hi,
(data->>'... | python|sql|pandas|postgresql|jsonb | 1 |
364,002 | 68,943,709 | Dropping the Indexed Column | <p>I am trying to use pandas to read the Excel file and then format the columns for my API call. Here is the excel file:</p>
<pre class="lang-none prettyprint-override"><code>country_code,name
US,Site1-DualBand
US,Site2-DualBand
US,Site3-DualBand
</code></pre>
<p>This is my script:</p>
<p>I tried the <code>index_col=N... | <p>This should give you the output you want.</p>
<pre><code>import pandas as pd
from io import StringIO
mycsv = StringIO("""country_code,name
US,Site1-DualBand
US,Site2-DualBand
US,Site3-DualBand
""")
df = pd.read_csv(mycsv, index_col=0)
df.reset_index(inplace=True)
print(df... | python|pandas | 1 |
364,003 | 69,154,426 | Pandas get all the groups created through ID | <p>I have a dataframe:</p>
<p><a href="https://i.stack.imgur.com/eqqS3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eqqS3.png" alt="enter image description here" /></a></p>
<p>I want to group each passenger id so that I can see all the values from <code>'from'</code> and <code>'to'</code> columns ... | <p>You can do it like so:</p>
<pre><code>flights = flights.set_index(['passengerId','from', 'to'])
</code></pre> | python|pandas|dataframe | 0 |
364,004 | 68,898,250 | Modelling a moving window with a shift( ) function in python problem | <p>Problem: Lets suppose that we supply robots to a factory. Each of these robots is programmed to switch into the work mode after 3 days (e.g. if it arrives on day 1, it starts working on day 3), and then they work for 5 days. after that, the battery runs out and they stop working. The number of robots supplied each d... | <p>Let's try <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.shift.html" rel="nofollow noreferrer"><code>shift</code></a> forward first the window (5) less the rolling window length (2) and taking <a href="https://pandas.pydata.org/docs/reference/api/pandas.core.window.rolling.Rolling.sum.html" rel=... | python-3.x|pandas|sum|rolling-computation | 1 |
364,005 | 69,094,695 | Number of rows between two dates | <p>Let's say I have a pandas df with a Date column (datetime64[ns]):</p>
<pre><code> Date rows_num
0 2020-01-01 NaN
1 2020-02-25 NaN
2 2020-04-23 NaN
3 2020-06-28 NaN
4 2020-08-17 NaN
5 2020-10-11 NaN
6 2020-12-06 NaN
7 2021-01-26 7.0
8 2021-03... | <p>Edited to reflect OP's original question. Created a demo dataframe. Created a column to hold that row_count value to reflect number of business days. Then, for each row, create a filter to grab all rows between the start date and 365 days later. the shape[0] of that filtered dataframe represents the number of busine... | python|pandas|dataframe|date | 1 |
364,006 | 68,955,290 | How to pass variable to Pandas merge left_on parameter? | <p>I'm new on Python.
I have this code:</p>
<pre><code>on_left = "id,flg_active"
on_right = "id_test,flg_new_active"
result = pd.merge(left, right, how= how.lower(), left_on=[on_left],right_on=[on_right])
</code></pre>
<p>This is the error I receive</p>
<pre><code>KeyError: 'id,flg_active'
</code></... | <p>So the question is: <strong>What's the difference between <code>"id,flg_active"</code> and <code>['id','flg_active']</code>?</strong></p>
<p><code>"id,flg_active"</code> is a string containing some alphabetic characters and a comma. If you pass this to the <code>left_on</code> parameter, pandas w... | python|pandas | 0 |
364,007 | 69,253,970 | How to refer to other rows in Pandas DataFrame in context of a single row? | <p>I have the following example Pandas DataFrame</p>
<blockquote>
<p>df</p>
</blockquote>
<pre><code>UserID Total Date
1 20 2019-01-01
1 18 2019-01-02
1 22 2019-01-03
1 16 2019-01-04
1 17 2019-01-05
1 26 2019-01-06
1 30 2019-01-07
1 28 2019-01-08
1 28... | <pre><code>totals = []
for i in len(df.index):
if i < 3:
totals.append(0)
elif df['UserID'].iloc[i] == df['UserID'].iloc[i-3]:
total = df['Total'].iloc[i-1] +
df['Total'].iloc[i-2] +
df['Total'].iloc[i-3]
totals.append(total)
else:
to... | python|python-3.x|pandas|dataframe|feature-engineering | 2 |
364,008 | 68,963,157 | How to extract contents of multiple text files into a pandas dataframe using Python? | <p>I have 2 text files that contain contents like below :</p>
<pre><code>
/*foo1.txt*/
Number of data records: 1000
Number of attributes: 231
Class attribute index: 231
Monotonic Transformation: None
Number of class labels: 10
Number of folds: 10
Test fold: 1
Random seed: 0
(Dis)similarity measure: Test_SVM
Task: SVMi... | <p>Update (based on the text files you shared in the comments and as per the discussion)</p>
<p>Using a regular expression pattern extract the relevant sections from the text contents of the file, then using another regex pattern find all col-value value pairs and map these pairs to the dictionary in order to create re... | python-3.x|pandas|dataframe | 1 |
364,009 | 69,010,271 | Problem converting time into pandas datetime | <p>I am trying to convert a date column containing only hours, minutes and seconds ito a datetime form using pandas.to_datetime(). However, it adds year and date automatically. I also tried using
pandas.to_datetime(df["time"], format = %H:%M:%S").dt.time, again the data type remains object.
Is there any ... | <p>put .dt.time on the end</p>
<pre><code>df['Time'] = pd.to_datetime(df['Time'], format='%H:%M:%S', errors='ignore').dt.time
</code></pre> | python|pandas|datetime|hour|minute | 0 |
364,010 | 69,197,572 | Pandas: How to match / filter same key / id values (duplicates) from 2 different dataframes and replace values? | <p>I have 2 dataframes of different sizes. The first dataframe(<code>df1</code>) has 4 columns, but two of those columns have the same name as the columns in the second dataframe(<code>df2</code>), which is only comprised of 2 columns. The columns in common are <code>['ID']</code> and <code>['Department']</code>.</p>
<... | <p>You can use <code>ID</code> of <code>df1</code> to map with the Pandas series formed by setting <code>ID</code> on <code>df2</code> as index and taking the column of <code>Department</code> from <code>df2</code> (this acts as a mapping table).</p>
<p>Then, in case of no match of <code>ID</code> from <code>df2</code>... | python|pandas|dataframe|duplicates|dataset | 1 |
364,011 | 69,036,871 | Multi level lookup values in dataframe with nested data | <p>I have the following dataframe:</p>
<p><a href="https://i.stack.imgur.com/EOhuk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EOhuk.png" alt="enter image description here" /></a></p>
<p>The different Red colors (row 1-3) are grouped together in group "Dark Red". They are part of the &q... | <p>I solved it with the <code>networx</code> library:</p>
<p><strong>Sample data:</strong></p>
<pre><code>import pandas as pd
df = pd.DataFrame({'ID': {0: 'Dark Red', 1: 'Scarlet Red', 2: 'Cherry Red', 3: 'Dark Blue', 4: 'Steel Blue', 5: 'Coral Blue', 6: 'Red', 7: 'Dark Red', 8: 'Blue', 9: 'Dark Blue', 10: 'C... | python|pandas | 0 |
364,012 | 69,198,556 | Create an (n,1) array from int values in a for loop | <p>I simply want to create an (n,1) array from the int values (dist) in my for a loop.
For now, I only have a succession of int values, since I'm printing the "dist" value in each iteration.
How do I incorporate each dist into an array (in this case only an n-vector), so that array[i][0] is the dist value fro... | <p>Eventually I used a simple list, and append my "dist" values to it.
If someone has something quicker than passing by the list, then creating the array...
here is my new code (the commented lines don't matter)</p>
<pre><code>disttodepot=[]
lat = CoordNodesRad[:,0]
lng = CoordNodesRad[:,1]
for i in range(len... | python|arrays|numpy|for-loop|integer | -1 |
364,013 | 69,193,252 | All possible combinations that differ by "N" elements in Python | <p>I am looking for a simple way to find all possible ways to switch <code>N</code>elements between two lists <code>list1</code> and <code>list2</code>, such that the new lists <code>list1'</code> differ from <code>list1</code> by <code>N</code> elements. The two lists will not have common elements (they contain a set ... | <p>Rather than generate all possible combinations and filter after, you can track what swaps have already been made so that duplicate recursive calls are eliminated:</p>
<pre><code>import copy
def swaps(d, s_w):
if not s_w:
yield tuple([tuple([k[1] if isinstance(k, tuple) else k for k in b]) for b in d])
el... | python|numpy|combinations|combinatorics | 1 |
364,014 | 68,965,100 | why my PCA and PCA from sklearn get different results? | <p>I tried to use the PCA provided in "machine learning in action", but I found that the results obtained by it are not the same as those obtained by the PCA in sklearn. I don't quite understand what is going on.</p>
<p>Below is my code:</p>
<pre class="lang-py prettyprint-override"><code>import numpy as np
f... | <p>The issue relates to your function, in particular the part where you calculate your eigenvector and eigenvalues:</p>
<pre><code>eig_val, eig_vec = np.linalg.eig(np.mat(cov_data))
</code></pre>
<p>It appears that ScitKit learn uses "eigh" instead of "eig", so if you change the code snippet from np... | python|numpy|scikit-learn|pca | 0 |
364,015 | 68,904,476 | After some number of epochs fake image creation become worst in GAN | <p>I'm trying to create GAN model.
This is my discriminator.py</p>
<pre><code>import torch.nn as nn
class D(nn.Module):
feature_maps = 64
kernel_size = 4
stride = 2
padding = 1
bias = False
inplace = True
def __init__(self):
super(D, self).__init__()
self.main = nn.Sequentia... | <p>The GAN training is inherently unstable because of simultaneous dynamic training of two competing models. Tried plotting the loss values from your question and the loss of discriminator and generator looks like below:</p>
<p><a href="https://i.stack.imgur.com/9KZjG.png" rel="nofollow noreferrer"><img src="https://i.... | python|pytorch|conv-neural-network|artificial-intelligence|generative-adversarial-network | 4 |
364,016 | 69,233,619 | How can I extract data from a web page and turn it into proper Pandas dataframe? | <p>For example, here is an address: <a href="https://pesdb.net/pes2021/?id=44379" rel="nofollow noreferrer">https://pesdb.net/pes2021/?id=44379</a><br>
There seems to be no api call (I am pretty new to this but I checked XHR in network monitor and there are no relevant json calls).</p> | <p>There's an example <a href="https://stackoverflow.com/a/61448317/14266189">here</a> of how to parse an html table, with just the Pandas/requests library.</p>
<p>According to <a href="https://pythonbasics.org/pandas-web-scraping/" rel="nofollow noreferrer">the latest docs</a>, you can skip the requests call in that a... | python|pandas|dataframe | 0 |
364,017 | 69,161,075 | Remove duplicate values while group by in pandas data frame | <p><a href="https://i.stack.imgur.com/29ypR.png" rel="nofollow noreferrer">given input data frame</a></p>
<p><a href="https://i.stack.imgur.com/RPbhG.png" rel="nofollow noreferrer">Required output</a></p>
<p><a href="https://i.stack.imgur.com/urW5w.png" rel="nofollow noreferrer">I am able to achieve this using groupby ... | <p>You can use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.SeriesGroupBy.unique.html" rel="nofollow noreferrer"><code>SeriesGroupBy.unique()</code></a> to get the unique values of <code>entity_text</code> before applying <code>tuple</code> to the list, as follows:</p>
<pre><c... | python|pandas|dataframe|pandas-groupby | 1 |
364,018 | 69,214,498 | How to use count over 2d list in pandas | <p>I have a Dataframe like this:</p>
<pre><code>df = pd.DataFrame({'text':['No thank you', 'They didnt respond me'],
'pred':['positive', 'negative'],
'score':["[[0, 0, 1], [1, 0, 2], [1, 0, 0]]", "[[], [0, 1, 0], [], []]"]
})
</code></pre>
<p... | <p>You can use <code>sum()</code> to count number of non-zero elements:</p>
<pre class="lang-py prettyprint-override"><code># if not converted already, convert the "score" column to list:
# from ast import literal_eval
# df["score"] = df["score"].apply(literal_eval)
m_sum = {"positiv... | python|pandas|multidimensional-array | 2 |
364,019 | 68,936,425 | Pandas dataframe to multikey dictionary | <p>I'm trying to transform df like this into the dictionary with multiple nested keys.</p>
<pre><code>import pandas as pd
import datetime
columns = ['country', 'city', 'from_date', 'to_date', 'sales']
data = [['UK', 'London', datetime.date(2021, 8, 26), datetime.date(2099, 5,5), 2500], ['Mexico', 'Mexico City', dateti... | <p>You can create <code>MultiIndex Series</code> by lambda function in <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.GroupBy.apply.html" rel="nofollow noreferrer"><code>GroupBy.apply</code></a> with <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFr... | python|pandas|dataframe|dictionary | 3 |
364,020 | 68,921,253 | Plotly line chart with confidence interval using groupby | <p>I'd like to plot time series simulation data as a mean with confidence intervals and compare multiple scenarios.
Using the pandas <code>groupby()</code> and <code>agg()</code> functions a calculate the mean and confidence interval (upper and lower limit) <a href="https://i.stack.imgur.com/ZSi3G.png" rel="nofollow no... | <p><em>( this is work in progress )</em></p>
<hr />
<p>It's still not 100% clear to me how you'd like to display your data here. In your code sample:</p>
<pre><code>px.line(reset_df, x = "tick", y="mean", color="first_factor",facet_col="second_factor")
</code></pre>
<p>... you're... | python|pandas|plotly|pandas-groupby | 1 |
364,021 | 69,092,220 | convert or least remove non-english/unwanted(non-ascii) values from pandas column or convert it to English characters | <p><a href="https://i.stack.imgur.com/wauxS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wauxS.jpg" alt="enter image description here" /></a>I have values like '<U+6B66>'... in my one column(company_name). Please suggest a robust method to remove or convert it to readable strings.</p> | <p>try using <code>regex</code> and <code>encode</code>:</p>
<pre><code>string_unicode = " xyz <U+6B66> Æ for \u200c ab 23#. "
string_encode = re.sub(r'\<[^)]*\>', '', string_unicode)
string_encode = string_encode.encode("ascii", "ignore")
</code></pre>
<p><strong>string_encode... | python|pandas|dataframe | 0 |
364,022 | 69,271,316 | SQL Query returns same results running on docker, but not on server | <p>We recently moved our database to a centralised server for our whole team to use the same data source instead of using dumps from the database and spinning it up in a docker container.</p>
<p>Recently, I noticed that when executing the same SQL-query multiple times on the server returns different results whereas whe... | <p>Your SQL query does not enforce any order. This means that the DB engine is free to choose any. If the same result is returned with a different order from the two deployments, your <code>tail</code> will likely be different.</p>
<p>I can imagine a number of reasons why two deployments of the same database may return... | python|sql|pandas|docker | 1 |
364,023 | 69,260,037 | Python print and write output end in ". . ." rather than the complete line | <p>I have tried moving around the strings and variables I am concatenating, using while loops, moved the line and method that I am opening the outfile, etc. No matter what I do my output prints/writes "curl" + my <em>url</em> variable. From there it ends in "..." <strong>ex: curl "https://examp... | <p>Solved. As Imre Kerr suggested in the comments the problem was with the length of the output.</p>
<p>I changed my for loop to be <code>for i in range(len(df)):</code> this only looped through the dataframe once (as per Barmars suggestion) and changed the references to the columns in my code from <code>df.COLA</code>... | python|pandas | 0 |
364,024 | 68,983,865 | Failed to find data adapter that can handle input: <class 'NoneType'>, <class 'NoneType'> | <p>I having trouble in here:</p>
<p><strong>About the code</strong>: I create a model here. The first step is to initialize the model with Sequential(). After that, we flatten our data and add our additional 3 (or more) hidden layers.</p>
<pre><code>import pandas as pd
import numpy as np
import itertools
import keras
... | <p>I did like this. This is working properly. Pls try to do this.</p>
<pre><code>import cv2
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from sklearn.metrics import confusion_matrix
import itertools
import os, glob
from tqdm import tqdm
from efficientnet.tfkeras import EfficientNetB4
img_... | python|python-3.x|numpy|tensorflow|tf.keras | 0 |
364,025 | 68,905,876 | Substituting python list for dataframe | <p>I have a code that creates adjacencies between data from my text file. The file structure is pretty simple. It has only 2 columns which describe the connections between 2 nodes. For example:</p>
<pre><code>ANALYTICAL_BALANCE BFG_DEPOSIT
CUSTOMER_DETAIL BALANCE
BFG_2056 FFD_15
BALANCE BFG_16
BFG_16 STAT_HIST
ANALYTIC... | <p>Working with <em>pandas</em> won't speed up things for you, or at least not significantly, as pandas DataFrame is intended to work with tabular data, and is not optimized for network structure of data.</p>
<p>Working with <em>networkx</em> will definitely simplify your code, but I'm afraid it also won't significant... | python|pandas|algorithm|networkx | 0 |
364,026 | 44,769,726 | How can I test individual layers in TensorFlow? | <p>I have constructed a 7 layer convolutional network, based off of the DEEP MNIST Expert tutorial. I have added two more convolutional layers.</p>
<p>Everything runs well, but I would like to attempt to input 1024 x 10 arrays directly into the fully connected layer, and circumvent the convolutional layers.</p>
<p>Is... | <p>Between the convolutional layers and the fully connected layer, create a place holder for the input to the fully connected layer: <code>input_to_fc = tf.placeholder_with_default(previous_layer, shape=(None, 1024*10))</code>. You can bypass the convolutional layers by feeding the input directly to the <code>input_to_... | python|machine-learning|tensorflow|deep-learning|convolution | 0 |
364,027 | 44,702,584 | In Pandas, how to get the value_counts() of a Series containing lists | <p>I have a <code>pandas</code> series <code>df.files</code> which looks like this:</p>
<pre><code>In [79]: df.files
Out[79]:
0 [{'url': 'http://www.apkmirror.com/wp-content/...
1 [{'url': 'http://www.apkmirror.com/wp-content/...
2 [{'url': 'http://www.apkmirror.com/wp-content/...
3 [{'url'... | <p>You can convert to <code>tuple</code> first if want use <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.value_counts.html" rel="noreferrer"><code>value_counts</code></a>:</p>
<pre><code>vc = df.files.apply(tuple).value_counts()
</code></pre>
<p>But if need only <code>length</code> of e... | python|pandas | 12 |
364,028 | 44,598,109 | Efficiently write a movie directly from np.array using pipes | <p>I have a 4D numpy array of movie frames. I'm looking for a function to write them to a movie, at a given framerate. I have FFMPEG installed on my OS, and <a href="https://stackoverflow.com/questions/4092927/generating-movie-from-python-without-saving-individual-frames-to-files">as I can see from these answers</a>, t... | <p>The <a href="http://imageio.readthedocs.io/en/latest/userapi.html" rel="noreferrer">ImageIO API</a> offers a dead simple way to do this:</p>
<pre><code>import imageio
imageio.mimwrite('output_filename.mp4', np_array , fps = [an int])
</code></pre>
<p>While I'm not sure if this uses pipes or not, it's blazingly fas... | python|numpy|video|matplotlib|ffmpeg | 16 |
364,029 | 44,634,651 | Copy a particular column in a 3d array to a 2d array [Python/Pygame] | <p>so I have this 3d array created by <em>pygame.surfarray.array3d(image)</em> and it gives me an indexed array as [width][height] and the 3rd dimension having the RGB values (R, G, B)</p>
<p>Something like this: array[x][y] = (0, 255, 167)</p>
<p>Now, I want to take each of the RGB columns into a new 2d array (for e... | <p><code>pygame.surfarray.array3d(image)</code> will return a numpy array of dimension <em>width x height x 3</em> (where <em>3</em> are the three color components RGB). You can use <code>:</code> to access all elements in a dimension and integers to access elements at a certain index.</p>
<p>For example, to access th... | python|arrays|numpy|pygame | 1 |
364,030 | 44,733,245 | How to get batch size for `tf.PaddingFIFOQueue.dequeu_up_to` in case of fewer elements? | <p>I'm referring to the example codes in<br>
<a href="http://www.wildml.com/2016/08/rnns-in-tensorflow-a-practical-guide-and-undocumented-features/" rel="nofollow noreferrer">http://www.wildml.com/2016/08/rnns-in-tensorflow-a-practical-guide-and-undocumented-features/</a>
and<br>
<a href="https://indico.io/blog/tensorf... | <p>You can use the <code>None</code> dimension in your Tensors to specify TensorFlow that the batch dimension can be different from one run to another.</p>
<p>You might want to read this <a href="https://www.tensorflow.org/programmers_guide/faq#tensor_shapes" rel="nofollow noreferrer">faq on tensor shapes</a> to get a ... | python-3.x|machine-learning|tensorflow | 1 |
364,031 | 44,732,778 | How can I find the index that satisfies a condition in a column(numpy object) of dataframe? | <p>I have a dataframe that contains the <code>numpy object</code> column.The data is as follows:</p>
<pre><code> data
0 [1, 2, 2, 3, 4, 2]
1 [2, 4, 2, 5, 2, 3, 2]
2 [2, 2, 2, 8, 2, 3, 2, 9, 1]
...
</code></pre>
<p>I would like to get the index of every numpy in the column to... | <p>I think you need <a href="https://stackoverflow.com/a/20528566/2901002"><code>np.logical_or and reduce</code></a>:</p>
<pre><code>df['index'] = df['data'].map(lambda x: np.where(np.logical_or
.reduce(((x > x.mean() + x.std()),
... | python-3.x|pandas|numpy | 1 |
364,032 | 44,567,938 | How to integrate Image recognition with website? | <p>I am a web designer, and I am thinking of building a <strong>face recognition application</strong> using machine learning concept. I want to build a website where people will upload photos (with Face) and the website will compare the face in image with the database of images and give the matches found from it. I wan... | <p>This really depends on whether your web application (mainly the GUI portion) will be using the same platform or computer languages as the one for the machine learning portion. As you have already mentioned TensorFlow, if your backend (face recognition system) is based on Python and TensorFlow (most likely and also r... | web|machine-learning|tensorflow|image-recognition | 0 |
364,033 | 44,498,771 | Multilayer encoder output state to multilayer decoder in Seq2Seq model TF 1.0 | <p><strong>Tensorflow Version 1.0</strong></p>
<p>My question is, what dimension of <code>encoder_state</code> argument does <code>tf.contrib.seq2seq attention_decoder_fn_train</code> expects. </p>
<p>Can it take multilayered encoder state output ? </p>
<p><strong>Context</strong> : </p>
<p>I want to create a <stro... | <p>I found issue with my implementation. So posting it here.
The problem was w.r.t. concatenating the <code>encoder_fw_state</code> and <code>encoder_bw_state</code>. The right way to do is as follows : </p>
<pre><code> self.encoder_state = []
for i in range(self.num_layers):
if isinstance(encoder_fw_... | python|tensorflow | 1 |
364,034 | 44,642,939 | How do you implement variable-length recurrent neural networks? | <p>What is a full working example (not snippets) of variable-length sequence inputs into recurrent neural networks (RNNs)? </p>
<p>For example PyTorch supposedly can implement variable-length sequences as input into RNNs, but there do not seem to be examples of full working code. </p>
<p>Relevant:
<a href="https://... | <p>Sadly, there is no such thing as 'variable length' neural networks. This is because there is no way a network can 'know' which weights to use for extra input nodes that it wasn't trained for.</p>
<p>However, the reason you are seeing a 'variable length' on that page, is because they process:</p>
<pre><code>a b c d... | machine-learning|tensorflow|neural-network|recurrent-neural-network|pytorch | 2 |
364,035 | 44,511,745 | How to load checkpoint and inference with C++ for tensorflow? | <p>I have Tensorflow with python api and got these checkpoint model file:</p>
<pre><code>model.ckpt-17763.data-00000-of-00001
model.ckpt-17763.index
model.ckpt-17763.meta
</code></pre>
<p>But I want a C/C++ shared library (.so file) when integrating into production. So I need to load these model file and inference wi... | <p>You can write c++ code to load and use your graph with the instructions given <a href="https://stackoverflow.com/a/43639305/7456923">here</a>. </p>
<p>You can use the files <a href="https://github.com/cjweeks/tensorflow-cmake" rel="noreferrer">here</a> to make a Cmake project with tensorflow outside the TF reposito... | c++|tensorflow|deep-learning|conv-neural-network|tensorflow-serving | 7 |
364,036 | 44,424,091 | PANDAS how to drop columns that have numbers and combine the rest of the columns | <p>I have a DataFrame:</p>
<pre><code> A B C
0 PQ None None
1 Chieti None None
2 Gainesville None None
3 Wenzhou 325027 None
4 Boston None None
5 D-53127 Bonn None
6 SE-11282 Stockholm None
7 Birmingham None None
8 Miami None ... | <p>You could do this by applying a function over the rows with <code>apply(...,axis=1)</code>.</p>
<pre><code>import pandas as pd
def row_func(row):
def num_there(s):
return any(i.isdigit() for i in s)
result = []
for x in row:
if x and not num_there(str(x)):
result.append(str(... | python|pandas|data-cleaning | 1 |
364,037 | 44,478,470 | Reshape column to row in dataframe pandas | <p>I have a dataset with 30 rows and 1 columns. What i want is to convert each elements in 10 rows and put it in 10 columns in Pandas. So at the end the dataset would be transformed to three rows and ten columns. Can any one direct me how i can do it?</p>
<p>It is not easy to show 30 elements so below is the smaller c... | <p><strong>Toy Example</strong> </p>
<pre><code>pd.DataFrame(
df.Col1.values.reshape(-1, 3),
columns=['col%s' % i for i in range(1, 4)]
)
col1 col2 col3
0 11 12 13
1 14 15 16
</code></pre>
<p><strong>30 Row Example</strong> </p>
<pre><code>pd.DataFrame(
df.Col1.values.reshape... | python|pandas|dataframe|transpose | 1 |
364,038 | 44,457,014 | Categorical variables in input | <p>I'm trying to run <code>DNNRegressor</code> on input with two features, one of which is categorical. I think I need to represent this input in one hot encoding, but am struggling to setup <code>feature_columns</code> (error shown below).</p>
<p>How would train <code>DNNRegressor</code> with the sample data provided... | <p>You shouldn't pass a string as an argument of one_hot_column. Use "feature_column.sparse_column_with_hash_bucket" (or kinds) as follows:</p>
<pre><code>sparse_column = feature_column.sparse_column_with_hash_bucket(
'make', hash_bucket_size=6)
feature_columns = [
feature_column.one_hot_column(sparse_column)... | python|tensorflow | 1 |
364,039 | 44,634,023 | Python - How to create confusion matrix statistics using python pandas crosstab | <p>Hereunder is my Phyton script that generates the following confusion matrix</p>
<p><a href="https://i.stack.imgur.com/23OnU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/23OnU.png" alt="enter image description here"></a></p>
<pre><code># /usr/bin/python -tt
from __future__ import division
imp... | <pre><code>(df * np.eye(3)).values.sum() / df.values.sum()
</code></pre>
<p>Output:</p>
<pre><code>0.89090909090909087
</code></pre> | python|python-3.x|pandas|confusion-matrix | 2 |
364,040 | 44,569,033 | Problems using Tensorflow in PyCharm-keep getting ImportError | <p>for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.</p>
<p>Process finished with exit code 1</p> | <p>Since you have in the log</p>
<blockquote>
<p>Library not loaded: @rpath/libcublas.8.0.dylib</p>
</blockquote>
<p>I would say you've installed TF with CUDA support but didn't install CUDA libraries properly. Try to install TF CPU only.</p> | python-3.x|tensorflow|pycharm|importerror | 1 |
364,041 | 44,758,057 | How to replicate data and replace values in one column? | <p>I'm working with a dataframe such as this:</p>
<pre><code>samples countries color cost
a US, UK, France, Germany white 1.2
b France, Germany red 2.0
c US blue 2.5
</code></pre>
<p>I would like to replicate data for each country (wh... | <p>You can use <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.split.html" rel="nofollow noreferrer"><code>str.split</code></a> for <code>list</code>s, then get <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.len.html" rel="nofollow noreferrer"><code>len... | python|pandas | 1 |
364,042 | 44,637,679 | How do I index a numpy array of zeroes with a boolean datatype to True? | <p>So I'm recreating a Matlab project they made last year, part of which involves creating mask that pull out the RGB bands.
They did this by an array of logical zeroes.</p>
<pre><code>GMask_Whole = false(ROWS,COLS);
</code></pre>
<p>which I reconstructed as a numpy array. </p>
<pre><code>self.green_mask_whole=np.z... | <p>You can translate Matlab's </p>
<pre><code>GMask_Whole(1:2:end,2:2:end) = true;
</code></pre>
<p>to python by</p>
<pre><code>green_mask_whole[::2,1::2] = True
</code></pre>
<p>(assuming <code>green_mask_whole</code> is a numpy array)</p> | python-3.x|numpy|image-processing|multidimensional-array | 1 |
364,043 | 44,763,643 | frequency and percentage uneven groups sns barplot | <p>I am trying to show relative percentage by group as well as total frequency in an sns barplot. The two groups I am comparing are very different in size, which is why I show the percentage by group in the function below.</p>
<p>Here is syntax for a sample dataframe I created that has similar relative group sizes to ... | <p>I solved this by splitting out the <code>groupby</code> operation: one to get your percentages and one to count the number of objects.</p>
<p>I adjusted your <code>percent_catergorical</code> function as follows:</p>
<pre><code>def percent_categorical(item, df=IA, grouper='Active Status') :
# plot categorical ... | python|python-3.x|pandas|matplotlib|seaborn | 4 |
364,044 | 44,659,135 | Iterating over pandas Series only executes once | <p>I have more than 8000 items in the "index", but the for loop only does the job for the first item.</p>
<pre><code>from datetime import datetime
from pandas import Series
from pandas import DataFrame
series = Series.from_csv('something.csv', header=1)
index = DataFrame(series.index)
for item in index:
dt = dat... | <p>That's not how you loop over a series's items. What you did iterates over the <em>columns</em>, and in a series, there's only one. That's why it executes only once. Use <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.iteritems.html" rel="nofollow noreferrer"><code>Series.iteritems</code... | python|pandas|datetime|for-loop | 3 |
364,045 | 44,615,866 | How to return the first index when the value are greater than something | <p>This is to simulate the "Knock out" situations in the structured investment. Generally, there are three stocks: Stock A; Stock B; Stock C, and their prices are observed monthly to check whether they are above 100% of the price of first month (KO level). </p>
<p>The basic dataframe looks like this:</p>
<pre><code> ... | <p>Here's my attempt, with some assumptions (plus, take this with a grain of salt: I don't claim to be a Pandas expert, just thought this would be an interesting problem to work on)</p>
<pre><code>df = pandas.DataFrame([
{'date': '2010-01-01', 'stock_a': 10, 'stock_b': 20, 'stock_c': 30},
{'date': '2010-01-02'... | python|pandas | 2 |
364,046 | 44,397,293 | where() takes from 1 to 2 positional arguments but 3 were given | <p>I have three arrays, <code>X</code>, <code>Y</code> and <code>Z</code>. I want to put in <code>res</code> and element of <code>X</code> in case the corresponding element from <code>Z</code> is true; otherwise, I will put an element from <code>Y</code>.</p>
<p>I implemented it like this: </p>
<pre><code>X = tf.cons... | <p>I suspect you are using an old version of TensorFlow:</p>
<p>e.g. in r0.10 <code>tf.where</code> used to take only 2 arguments.</p>
<p><code>tf.where(input, name=None)</code></p>
<p><a href="https://www.tensorflow.org/versions/r0.10/api_docs/python/math_ops/sequence_comparison_and_indexing#where" rel="nofollow no... | python|tensorflow | 1 |
364,047 | 44,566,461 | How can I manipulate my data to allow a random forest to run on it? | <p>I want to train a random forest on a bunch of matrices (first link below for an example). I want to classify them as either "g" or "b" (good or bad, a or b, 1 or 0, it doesn't matter). </p>
<p>I've called the script randfore.py. I am currently using 10 examples, but I will be using a much bigger data set once I act... | <p>Try writing:</p>
<pre><code>X_train = sources.values[:8] # Inputs
y_train = targets.values[:8] # Targets
</code></pre>
<p>I hope this will solve your problem!</p> | python|pandas|scikit-learn|random-forest | 0 |
364,048 | 44,634,448 | Adding hours to repeating minutes/seconds in pandas | <p>I have a sensor that collects only minute/second tags for my data. Because of that the tags repeat. For example:</p>
<pre><code>['00:00',
'20:00',
'40:00',
'00:00',
'20:00',
'40:00',
'00:00',
'20:00',
'40:00']
</code></pre>
<p>How can I use pandas datetimes (<a href="https://pandas.pydata.org/pandas-docs/s... | <p>Use <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.shift.html" rel="nofollow noreferrer">shift</a> to compare the previous minutes/seconds to the current and <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.cumsum.html" rel="nofollow noreferrer">cumsum</a> ... | python|pandas | 2 |
364,049 | 44,736,360 | Tensorflow-gpu installation errors in windows | <p>Recently I was installing tensorflow(gpu) for windows.
I have a graphic card with compute capability = 3.0 (compatible)
Python (3.5.2)
Cuda 8.0 (installed and working)
CudNN installed
(These are as per the tensorflow manual)
But when I installed the tensorflow </p>
<pre><code>pip3 install --upgrade tensorflow-gpu
<... | <p>I tried really hard to find a solution to this problem problem. I don't know which one is necessary or not for you. But lastly I did this and it worked:</p>
<p>You must change <code>cudnn64_?.dll</code> in directory <code>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin</code> to <code>cudnn64_5.dll</cod... | python|machine-learning|tensorflow | 2 |
364,050 | 44,678,829 | How to transpose dataframe columns into rows in pandas | <p>I have below dataframe and want to transpose the columns aftr 3rd column into rows. Please help on this.</p>
<pre><code>df:
country year perc data1 data2 data3
IN 2015 hjk 75 81 96
US 2015 KTM 100 289 632
Results:
country year perc Transpose... | <p>use <code>melt</code>:</p>
<pre><code>df.melt(id_vars=['country','year','perc'])
</code></pre>
<p>older versions of Pandas:</p>
<pre><code>pd.melt(df, id_vars=['country','year','perc'])
</code></pre>
<p>Output:</p>
<pre><code> country year perc variable value
0 IN 2015 hjk data1 75
1 US 2... | python|pandas | 17 |
364,051 | 44,421,001 | How to add multiple small ROI (Region of interest) to form an image in numpy? | <p>I have a list of small ROI (Region of interest) of an image, represented by numpy array. How can I add or stitch the ROI together to form a larger image (numpy array)? Each ROI is 50x50 and I want it to stitch together into 500x400 image.
I know how to do it using basic loops, but is there a numpy function that I ca... | <p>You can use <code>np.vstack</code> or <code>np.hstack</code> depending on how you want them stitched. </p>
<p>An example of <code>np.vstack</code>:</p>
<pre><code>>>> a = np.array([1, 2, 3])
>>> b = np.array([2, 3, 4])
>>> np.vstack((a,b))
array([[1, 2, 3],
[2, 3, 4]])
</code></pr... | python|arrays|numpy | 1 |
364,052 | 44,631,033 | Python: Compare String to whole next column | <p>I have the following dataframe: </p>
<pre><code>df1:
2000 2001 2002
a a a
b b c
c c d
</code></pre>
<p>So, in 2002 the value b got replaced by c. What I want now is for every column, to check whether each value of the column, i.e. for a, b, and c separately, is... | <p>A useful tool to look at here is <code>pd.DataFrame().stack()</code>:</p>
<pre><code>df1.stack()
Out[24]:
0 2000 a
2001 a
2002 a
1 2000 b
2001 b
2002 c
2 2000 c
2001 c
2002 d
dtype: object
</code></pre>
<p>Because your column names sort nicely, you can sort this and... | python|pandas|string-comparison | 1 |
364,053 | 44,397,372 | How to apply multiple masks to an array and count occurrences per row | <p>Let's say I have a 2D array with positive integers:</p>
<pre><code>a = numpy.array([[1, 1, 2],
[1, 2, 5],
[1, 3, 6],
[3, 3, 3],
[3, 4, 6],
[4, 5, 6],
])
</code></pre>
<p>and a threshold (positive integer). I want t... | <p><strong>Approach #1</strong></p>
<p>Making use of <code>elementwise comparison</code> against the thresholds and summing each row -</p>
<pre><code>t = 3 # threshold
mask0 = (a<t)
mask2 = a>=t+2
mask1 = (a>=t) & ~mask2
out = np.c_[mask0.sum(1), mask1.sum(1), mask2.sum(1)]
</code></pre>
<hr>
<p><stron... | python|numpy|count | 2 |
364,054 | 44,668,678 | TypeError: unhashable type: 'matrix' | <p>I struggle with a error like below.
I saw this code from another book, but it doesn't work.
How can I solve it?
Thanks in advance!</p>
<pre><code>import numpy as np
a = [1, 2, 3, 2]
Ma = np.mat(a)
Sa2 = set(Ma) #error
</code></pre> | <p>You can use the following in order to flatten the matrix to an ndarray.</p>
<pre><code>import numpy as np
a = [1, 2, 3, 2]
Ma = np.mat(a)
Sa2 = set(np.asarray(Ma).ravel())
print (Sa2)
>>> '{1, 2, 3}'
</code></pre> | python|numpy | 3 |
364,055 | 44,459,845 | GridSearchCV.best_score_ meaning when scoring set to 'accuracy' and CV | <p>I'm trying to find the best model Neural Network model applied for the classification of breast cancer samples on the well-known Wisconsin Cancer dataset (569 samples, 31 features + target). I'm using sklearn 0.18.1. I'm not using Normalization so far. I'll add it when I solve this question.</p>
<pre><code># some i... | <p>The <code>grid.best_score_</code> is the average of all cv folds for a single combination of the parameters you specify in the <code>tuned_params</code>. </p>
<p>In order to access other relevant details about the grid searching process, you can look at the <code>grid.cv_results_</code> attribute. </p>
<p>From the... | python|pandas|scikit-learn|cross-validation|grid-search | 12 |
364,056 | 60,789,505 | 3 dif cols all of them with different date formats, efficient way to uniform? | <p>so, I got 3 different cols, referring to dates, with different formats, like this:</p>
<pre><code> col A| colB| colC
0 1512086400000000 20180109 12/23/2017
1 1514851200000000 20180109 1/10/2018
2 1512086400000000 20180109 12/27/2017
3 151485... | <p>In python/ pandas for datetimes is always same format - <code>YYYY-MM-DD</code>, for convert use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.to_datetime.html" rel="nofollow noreferrer"><code>to_datetime</code></a>:</p>
<pre><code>df['colA'] = pd.to_datetime(df['colA'], unit='us')
df['c... | python|pandas|datetime | 0 |
364,057 | 61,120,047 | Date time no atribute microseconds | <p>I have this:</p>
<pre><code>1900-01-01 00:00:00.003
1900-01-01 00:00:00.003
1900-01-01 00:00:00.007
1900-01-01 00:00:00.007
1900-01-01 00:00:00.011
1900-01-01 00:00:00.011
1900-01-01 00:00:00.015
1900-01-01 00:00:00.015
</code></pre>
<p>I converted my df to datetime like this:</p>
<pre><code>x = pd.to_datetime(d... | <p>IIUC:</p>
<pre><code>x = pd.to_datetime(df['Time'], format='%Y-%m-%d %H:%M:%S.%f')
x.dt.microsecond
</code></pre>
<p>If you want in that form you could really just get the final 3 characters:</p>
<pre><code>df['Time'].str[-3:]
003
003
007
007
011
011
015
015
</code></pre> | pandas | 2 |
364,058 | 60,864,030 | Group entries in Pandas data frame where rows have identical values | <p>I have a Pandas data frame where I want to group all rows that have the same values and group them by the index column.</p>
<p>Example:</p>
<pre><code>data = {'Number':[5, 10, 15, 20, 25, 28],
'Letter':['a','a','b','b','c','c'],
'Type':['X','X','Y','Y','Z','Z']}
df = pd.DataFrame(data)
df = df.set_... | <p>First idea is convert index to column and aggregate <code>list</code>:</p>
<pre><code>print (df.reset_index().groupby(['Letter', 'Type'])['Number'].agg(list).tolist())
[[5, 10], [15, 20], [25, 28]]
</code></pre>
<p>Or you can use lambda function:</p>
<pre><code>print (df.groupby(['Letter', 'Type']).apply(lambda x... | pandas|pandas-groupby | 2 |
364,059 | 61,102,832 | I want to add randomly a to z in columns using loops.how can i do this? | <p>I want to add randomly a to z in columns using loops.how can i do this?</p>
<pre>
I want to add randomly a to z in columns using loops.how can i do this?
example:
this my columns
name
0 Tim
1 Mit
2 Jason
3 Jasim
4 Sible
Expected results:
name
0 Tima
1 Mitb
2 Jasonc
3 Jasim
... | <pre><code>import numpy as np
import string
# create a list of characters
choice_list = list(string.ascii_lowercase)
# generate sudo random letter from the list
rand = np.random.choice(choice_list, len(df))
# append strings
df['name_new'] = df['name'].values + rand
name name_new
0 Tim Tima
1 Mit Mite... | pandas|dataset|rows | 1 |
364,060 | 61,007,229 | Get value and line number for non unique parameters in csv file | <p>I need to check the csv file for uniqueness of all values in each column and get the number of the row where the nonunique parameter is located and its value. Example file</p>
<pre><code>Vendor,Email,Country
Nick,nick@gmail.com,US
Joe,joe@gmail.com,NL
Nick,nk@gmail.com,GB
Mary,nk@gmail.com,AU
</code></pre>
<p>Expe... | <p>Pandas solution - get duplicated values (all without first by <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.duplicated.html" rel="nofollow noreferrer"><code>Series.duplicated</code></a>), filter by <a href="http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#boolea... | python|pandas|csv | 1 |
364,061 | 61,112,596 | How to apply a function to get the encoded specific columns in pandas | <p>I have this function:</p>
<pre><code>get_class(cols):
if cols == 1:
return 1
elif cols ==2:
return 2
else:
return 0
</code></pre>
<p>I made a list of certain columns like this:</p>
<pre><code>cols = ['night', 'day']
cols_en = []
for each in cols:
each = cols + '_en'
co... | <p>IIUC, you want to create a new column with 0 if the value is not 1 nor 2 in the original, for example, you can use <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.where.html" rel="nofollow noreferrer"><code>np.where</code></a>. and create a loop over your list <code>cols</code> to create the new ... | python|pandas|label-encoding | 0 |
364,062 | 61,123,785 | Is there a way to use tf.keras.model.predict within a tf.data pipeline? | <p>I have a trained model that I would like to employ in the <code>tf.data</code> pipeline for a second model. When I try to do this, I get a <code>ValueError: Unknown graph. Aborting.</code> I don't know quite what to make of this error message.</p>
<p>My code looks something like this:</p>
<pre><code>def load_data(... | <p>One of the simplest ways to tackle this is to pass the input to the model directly, rather than using <code>model.predit</code> method. The reason for this is that <code>model.predict</code> returns a <code>numpy.ndarray</code>. This causes an error because <code>tf.data</code> uses graph execution, which means it's... | python|tensorflow|keras|tensorflow2.0|tensorflow-datasets | 3 |
364,063 | 60,963,900 | Writing loop values within a function into Pandas dataframe | <p>The function below is part of googlesheets quickstart.py to allow people to read a Googlesheet URL.
I am able to run the test and getting the print to work.
See the print statement in the function below:
print('%s, %s,%s,%s,%s,%s,%s,%s' % (row[0],row[1],row[2],row[3], row[4], row[5],row[6],row[7]))
My ultimate goal ... | <p>Since <strong>values</strong> seems to be a 2D list, try doing </p>
<pre class="lang-py prettyprint-override"><code>pd.DataFrame.from_records(values, columns=['Date', 'Cases', 'Country_Region', 'Lat', 'Long'])
</code></pre> | pandas|function|loops | 0 |
364,064 | 61,066,596 | Pandas df.shift(axis=1) adds extra entries, why? | <p>Here is a sample of the original table. </p>
<pre><code> # z speed dir U_geo V_geo U U[QCC] U[ign] U[siC] U[siD] V
0 40 2.83 181.0 0.05 2.83 -0.20 11 -0.20 2.24 0.95 2.83 11
1 50 2.41 184.8 0.20 2.40 -0.01 11 -0.01 2.47 0.94 2.41 11
2 60 1.92 192.4 0.... | <p>You can use iloc and create another dataframe:</p>
<pre><code>df = pd.DataFrame(data=df.iloc[:, :-1], columns=df.columns[1:], index=df.index)
</code></pre> | pandas|dataframe|shift | 0 |
364,065 | 60,759,649 | Easily generate edge list from specific structure using pandas | <p>This is a question about how to make things properly with pandas (I use version <code>1.0</code>).
Let say I have a DataFrame with missions which contains an origin and one or more destinations:</p>
<pre><code> mid from to
0 0 A [C]
1 1 A [B, C]
2 2 B [B]
3 3 C [... | <p>Your operation is basically <code>explode</code> and <code>concat</code>:</p>
<pre><code># turn series of lists in to single series
tmp = df[['mid','to']].explode('to')
# new `from` is concatenation of `from` and the list
df1 = pd.concat((df[['mid','from']],
tmp.rename(columns={'to':'from'})
... | python-3.x|pandas|graph|code-readability | 3 |
364,066 | 60,923,378 | How to concat/join columns from multiple csv files into 1 DataFrame()? | <p>The Dataset I'm using is: <a href="https://www.kaggle.com/rohanrao/nifty50-stock-market-data" rel="nofollow noreferrer">https://www.kaggle.com/rohanrao/nifty50-stock-market-data</a></p>
<p>It contains stock market data from all NIFTY50 Companies since 2000 up to 2020.
Each file contains the following columns: <code... | <p>I am not clear on what output you are looking for. Anyway, I'll explain what I did. First, I unzipped the files into a <code>Kaggle</code> folder on my <code>C-drive</code>, and then changed that to my current directory with <code>os.chdir()</code> Then, I created a blank list, where we will later append dataframes ... | python|database|pandas|dataframe|merge | 0 |
364,067 | 61,150,018 | Python, CX freeze Error, when I try to launch my exe | <p>hello</p>
<p>I try to learn Python ...
I did by myself a little software for read data from XLSX, <strong>every things runs good when I launch by the "normal way</strong> / python way " (ctrl + B in sublime text).
... BUT ...
When I compil it to get my ".exe" with "cx.freeze" and when launch my .exe, I get this e... | <p>I found that CXFreeze had not worked well in many cases. So I prefer to use <strong>Nuitka</strong> as an alternative. It's quite straightforward to use.</p>
<p><code>nuitka --file-reference-choice=runtime --recurse-to=[some_module] main.py</code></p>
<p>I used Nuitka to freeze a very big Python app (integrated we... | python|pandas|matplotlib|tkinter|cx-freeze | 1 |
364,068 | 60,795,375 | Unable to load model weights while predicting (using pytorch) | <p>I have trained a Mask RCNN network using PyTorch and am trying to use the obtained weights to predict the location of apples in an image..</p>
<p>I am using the dataset from this <a href="https://arxiv.org/abs/1909.06441" rel="nofollow noreferrer">paper</a>, and here is the <a href="https://github.com/nicolaihaeni/... | <p>There is no <code>'model'</code> parameter in the saved checkpoint. If you look in <code>train_rcnn.py:106</code>:</p>
<pre class="lang-py prettyprint-override"><code>torch.save(model.state_dict(), os.path.join(args.output_dir, 'model_{}.pth'.format(epoch)))
</code></pre>
<p>you see that they save just the model p... | python|tensorflow|machine-learning|pytorch|image-segmentation | 1 |
364,069 | 61,164,760 | Join two pandas series of text with NA | <p>I have two pandas Series with text which I want to join to obtain a Series with the joined text.</p>
<p>Both Series are based on the same index but one Series has fewer values which leads to NA values when joining.</p>
<p>Here is a toy example:</p>
<pre class="lang-py prettyprint-override"><code>import pandas as ... | <p>Another option </p>
<pre><code>s1.append(s2).groupby(level=0).agg(','.join)
1 red,large
2 blue
3 green,small
4 black
dtype: object
</code></pre> | python|pandas|join|series|na | 1 |
364,070 | 61,078,461 | Python Pandas in Sage Math 9.0 (Jupyter) - Windows | <p>I've just installed Sage Math 9.0 on Windows and it comes with a jupyter environment.
I do have Python installed on my PC and from within the command line i can use python and pandas.
But from the jupyter that came with SageMath i can not use pandas.</p>
<p>It looks like the jupyter that came with sage does not "kn... | <p>After installing on Windows you have three icons on the desktop: SageMath, SageMath Notebook, SageMath Shell.</p>
<p>Open the SageMath Shell and run this command:</p>
<pre><code>pip install pandas
</code></pre>
<p>Then you can use Pandas in Sage's Python.</p> | python|pandas|windows|jupyter|sage | 1 |
364,071 | 60,894,411 | Can you have more than one variable contributing factor when splitting your dataframe into two groups? pandas | <p>I'm working on the number of COVID-19 death cases by state and seeing whether a high state population contributes to a higher death likelihood from those who have caught COVID-19.</p>
<p>Currently working on splitting my dataframe into two groups, but the way I have things set up, that split would rely on two factor... | <p>You want to combine the two Boolean vectors. This way for each position in the dataframe, pandas will evaluate both statements and only if both are true, keep the data.</p>
<pre><code>highpop_highdeath = df.loc[(df'StatePopulation' > 4342705.0) & (df'deaths_to_cases' > 0.012143070253953211)]
ighpop_lowde... | python|pandas|dataframe|split | 0 |
364,072 | 60,949,768 | Python: Add numpy array to another one | <pre><code>arr = np.array([])
b = np.array([1,2,3,4,5])
c = np.array([1,1,1,1,1])
</code></pre>
<p>I now would like to add b and c to arr.
The result I need:</p>
<pre><code>[[1,2,3,4,5], [1,1,1,1,1]]
</code></pre>
<p>More general: Considering such a method:</p>
<pre><code>def get_array(input):
# …
</code></pre>
<p... | <pre><code>>>> b = np.array([1,2,3,4,5])
>>> np.tile(b, (3,1))
array([[1, 2, 3, 4, 5],
[1, 2, 3, 4, 5],
[1, 2, 3, 4, 5]])
</code></pre> | python|arrays|numpy | 1 |
364,073 | 61,009,862 | Pandas: Groupby names in index and columns | <p>I have a dataframe that uses MultiIndex for both index and columns.
For example:</p>
<pre><code>df = pd.DataFrame(index=pd.MultiIndex.from_product([[1,2], [1,2,3], [4,5]], names=['i','j', 'k']), columns=pd.MultiIndex.from_product([[1,2], [1,2]], names=['x', 'y']))
for c in df.columns:
df[c] = np.random.randint(... | <p>You can use <code>stack</code> to put the 'y' level of column as index and then <code>groupby</code> only i to get:</p>
<pre><code>print (df.stack(level='y').groupby(['i']).std())
x 1 2
i
1 32.966811 23.933462
2 28.668825 28.541835
</code></pre> | python|pandas|pandas-groupby | 1 |
364,074 | 60,970,199 | plotly can't seem to create my interactive plot in pycharm | <p>I'm trying to use plotly and cufflinks for python in pycharm. I use iplot but it's just not working.
Does anyone knows why?</p>
<p>Thanks in advance!</p>
<pre><code>import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from plotly.offline import download_plotlyjs, plot, iplot
import cufflinks as c... | <p>Use <code>fig.show()</code>:</p>
<pre class="lang-py prettyprint-override"><code>import numpy as np
import pandas as pd
import cufflinks as cf
df = pd.DataFrame(np.random.randn(100, 4), columns=['a','b','c','d'])
fig = df.iplot(asFigure =True,
xTitle = "The X Axis",
yTitle = "The Y A... | python|python-3.x|pandas|pycharm|plotly | 0 |
364,075 | 60,808,065 | X axis invisible for large dataset | <p>I am new to python and I am trying to plot the data where date and time is on the X axis. The data is about the number of tweets over hours, over the span of few days. Since the data is huge, the X axis scale becomes invisile. Below is the snippet from main data (The data I want to plot)</p>
<pre><code>> Date ... | <p>Probably the latest pandas version isn't installed. On my system with pandas 1.0.3, the x-ticks are displayed as <code>[2017-06-01 00:00:00, 0]</code>. Setting a label rotation with <code>df.plot(marker='*', rot=30)</code> makes that they don't overlap.</p>
<p>But anyway, this isn't a very pleasing output. (I'm sup... | python|pandas|matplotlib|large-data | 0 |
364,076 | 60,944,376 | Repeating headings in for-loop in Python | <p>I have <code>df</code>:</p>
<pre><code> id timestamp data Date
27001 27242 2020-01-01 09:07:21.277 19.5 2020-01-01
27002 27243 2020-01-01 09:07:21.377 19.0 2020-01-01
27581 27822 2020-01-02 07:53:05.173 19.5 2020-01-02
</code></pre>
<p>and a for-loop generating gra... | <p>You are generating a new dataframe each iteration, try to append them all together and display once at the end:</p>
<pre class="lang-py prettyprint-override"><code># Initialize df_number
df_number = pd.DataFrame(columns=['Date', 'Count'])
for date in df['Date'].unique():
df_date = df[df['Date'] == date]
..... | python|pandas|numpy|dataframe|for-loop | 0 |
364,077 | 60,801,746 | TensorFlow 2.0 learning rate scheduler with tf.GradientTape | <p>I am using TensorFlow 2.0 and Python 3.8 and I want to use a learning rate scheduler for which I have a function. I have to train a neural network for 160 epochs with the following where the learning rate is to be decreased by a factor of 10 at 80 and 120 epochs, where the initial learning rate = 0.01.</p>
<pre><co... | <p>The learning rate for different epochs can be set using lr attribute of tensorflow keras optimizer. lr attribute of the optimizer still exists since tensorflow 2 has backward compatibility for keras (For more details refer the source code <a href="https://github.com/tensorflow/tensorflow/blob/2b96f3662bd776e277f8699... | python-3.x|tensorflow2.0 | 4 |
364,078 | 61,015,728 | RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed. Specify retain_graph=True | <p>I'm a student and a beginner in Python and PyTorch both. I have a very basic Neural Network for which I am encountering the mentioned RunTimeError. The code to reproduce the error is this: </p>
<pre><code>import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
import matplotlib.py... | <p>You need to add <code>optimizer.zero_grad()</code> after <code>optimizer.step()</code> to zero out the gradients. </p>
<p>Why you need to do this?</p>
<p>When you do <code>loss.backward()</code> torch will compute gradients for parameters and update the parameter's <code>.grad</code> property. When you do <code>op... | python|machine-learning|deep-learning|pytorch | 6 |
364,079 | 61,097,181 | DataFrame: cumulative sum of column until condition is reached and return sum in new column | <p>I am new in Python and am currently facing an issue I can't solve. I really hope you can help me out. English is not my native language so I am sorry if I am not able to express myself properly.</p>
<p>Lets suppose i have a data frame like:</p>
<pre><code>import pandas as pd
df = pd.DataFrame({'a': [1111,2222,3333... | <p>Use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.shift.html" rel="nofollow noreferrer"><code>Series.shift</code></a> with cumulative sum by <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.cumsum.html" rel="nofollow noreferrer"><code>Series.cumsum</... | python|pandas|dataframe|sum | 2 |
364,080 | 60,964,660 | extrapolate pandas dataframe with lmfit | <p>I am trying to extrapolate my data </p>
<pre><code>14 , 18 , 38 , 57 , 100 , 130 , 191
18 , 26 , 48 , 74 , 79 , 130 , 165
3 , 3 , 3 , 3 , 3 , 3 , 6
323 , 470 , 655 , 889 , 1128 , 1701 , 203
0 , 0 , 0 , 0 , 1 , 1 , 1
977 , 1261 , 1766 , 2337 , 3150 , 3736 ,... | <p>You probably want to use</p>
<pre><code> pred = result.eval(x=x_pre)
</code></pre>
<p>That is, you want to use the result of the fit, not the model itself.</p> | python|pandas|extrapolation | 1 |
364,081 | 60,949,306 | Python - Can't apply Data Validation to column group | <p>I am exporting a Excel file with a drop-down list.</p>
<p>For that I am using the code below:</p>
<pre><code>with pd.ExcelWriter('draft.xlsx', engine='xlsxwriter') as writer:
df.to_excel(excel_writer=writer, sheet_name='Filter', index=False)
worksheet = writer.sheets['Filter']
worksheet.data_validation... | <p>The range 'B:B' isn't supported syntax. You need to specify the entire column range. Like this:</p>
<pre class="lang-py prettyprint-override"><code> worksheet.data_validation('B1:B1048576',
{'validate': 'list',
'source': ['open', 'high', 'close']})
<... | python|validation|pandas.excelwriter | 0 |
364,082 | 61,107,088 | Get predicted values with model.predict using ImageDataGenerator - keras 2.1.0 (deep learning) | <p>I am trying to get all correct and incorrect predicted values (I want predict class of images)</p>
<p>So, my code is:</p>
<pre><code>#Load the trained model
loaded_model= tf.keras.models.load_model('C:/Desktop/data/model.h5')
#ImageDataGenerator for reading data from directory
test_generator = ImageDataGenerator(... | <p>Based on your shape, I'm assuming you have 2 classes.</p>
<pre><code>#Load the trained model
loaded_model= tf.keras.models.load_model('C:/Desktop/data/model.h5')
#ImageDataGenerator for reading data from directory
test_generator = ImageDataGenerator().flow_from_directory(
'C:/Desktop/data/test',
target_siz... | python|tensorflow|keras | 0 |
364,083 | 61,049,335 | Does it make sense to replace nan values by -99999? | <p>how does it make sense to replace <code>nan</code> values in the dataframe by the value <code>-99999</code>? I found it here, example 3: <a href="https://www.geeksforgeeks.org/python-pandas-dataframe-replace/" rel="nofollow noreferrer">https://www.geeksforgeeks.org/python-pandas-dataframe-replace/</a> </p>
<p><code... | <p>I would recommend replacing missing values with <code>0</code>. Like @Bruno mentioned most <code>machine learning algorithms</code> do not work with missing values in your dataset.</p>
<pre><code>df.fillna(0, inplace=True)
</code></pre> | pandas|dataframe|machine-learning | 1 |
364,084 | 60,982,456 | How to achieve Image recognition using phone camera | <p>I'm trying to build an app to make image recognition using the phone camera... I saw a lot of videos where using the camara the app identify where is the person or which feelings they have or things like that in real time.</p>
<p>I need to do a built an app like this, I know it's not an easy task, but I need to kno... | <p>If you are trying to do this for the iOS platform, you could use a starter kit here: <a href="https://developer.ibm.com/patterns/build-an-ios-game-powered-by-core-ml-and-watson-visual-recognition/" rel="nofollow noreferrer">https://developer.ibm.com/patterns/build-an-ios-game-powered-by-core-ml-and-watson-visual-re... | tensorflow|machine-learning|image-processing|image-recognition | 0 |
364,085 | 61,140,079 | anaconda - downgrade the cudnn to be compatable with tensorflow 1.15 | <p>I have tensorflow 1.15 installed on my anaconda environment, and keras 2.3.1. also, windows 10 and python 3.6. based on <a href="https://www.tensorflow.org/install/source_windows#tested_build_configurations" rel="nofollow noreferrer">this</a>, it seems like I need cudnn 5. but the one that conda installed for me is... | <p>you must have the miniconda2 == 4.5.4 version</p> | tensorflow|anaconda | -1 |
364,086 | 60,955,410 | python - numpy - get index of matrix that contains True | <p>In the following code </p>
<pre><code>import numpy as np
np.array([
[False, True, False],
[False, False, False],
[False, False, True],
[False, False, False]
])
</code></pre>
<p>I want to get retrieve the array <code>[True, False, True, False]</code> corresponding to the lists that contain at lea... | <p><strong>Try this:</strong></p>
<p>You can use <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.any.html" rel="nofollow noreferrer">np.any</a> which test whether any array element along a given axis evaluates to <code>True</code>.</p>
<pre><code>result = np.any(arr, axis=1)
</code></pre>
<p><str... | python|numpy | 1 |
364,087 | 60,965,207 | Nan values in a list of dictionaries | <p>Am Trying to print if there is a nan value in a list of dictionaries but failed to do so. </p>
<pre><code>data = [{'A' : 2, 'B' : 'ssss'}, {'A' : 3, 'B' : 'xxx'}, {'A' :nan, 'B' : 'ssss'}]
</code></pre>
<p>Code :</p>
<pre><code>for x in data:
if (x['A']== 2):
print('two')
elif (x['A']== np.nan)
... | <p>Use <code>np.isnan()</code> instead:</p>
<pre><code>for x in data:
if (x['A']== 2):
print('two')
elif (np.isnan(x['A']))
print('null')
else:
print('nothing')
</code></pre>
<p>Sources:</p>
<p><a href="https://docs.scipy.org/doc/numpy-1.13.0/user/misc.html" rel="nofollow noreferr... | python|numpy | 3 |
364,088 | 60,937,325 | Aggregating over random subsets of n rows of dataframe in python | <p>I am trying to aggregate over random subsets of a python data frame with n rows. My current approach is to loop through rows and assign a "group id" in a new column then aggregate on this column, but my data frame has hundreds of thousands of rows and this is much too slow. What is a more efficient way to do this? ... | <p>You can use <a href="https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.random.shuffle.html" rel="nofollow noreferrer">np.random.shuffle</a> function to shuffle an array at random:</p>
<pre class="lang-py prettyprint-override"><code>n = df.shape[0]
for gs in group_size:
a = np.hstack([np.repeat(... | python|pandas|dataframe | 1 |
364,089 | 60,813,103 | NumPy slicing over variable size, multidimensional array | <p>Suppose having the following lines of code</p>
<pre><code>import numpy as np
# The values equal to 1 inside this nested list indicate where the data need to be loaded. a = [7 x 6]
a = [
[0, 1, 0, 1, None, None],
[0, 0, 0, 0, None, 0],
[0, 0, 1, 0, None, 0],
[0, 1, 0, 1, None, 1],
[0, 0, 0, 1, N... | <p>The slicing isn't working properly for cases where you inserted more than one zero array into the row because of using <code>b[i, col[i]]</code>.</p>
<p>Just consider your first row. This gives you <code>row=[0]</code>, <code>col =[[1,3]]</code>. This means that <code>b[0,0]</code> references the zeros arrays for c... | python|arrays|list|numpy|numpy-slicing | 0 |
364,090 | 60,873,052 | Replace column in Pandas dataframe with the mean of that column | <p>I have a dataframe:</p>
<pre><code>df = pd.DataFrame([[1, 2], [1, 3], [4, 6]], columns=['A', 'B'])
A B
0 1 2
1 1 3
2 4 6
</code></pre>
<p>I want to return a dataframe <strong>of the same size</strong> containing the mean of each column:</p>
<pre><code> A B
0 2 3.666
1 2 3.666
2 2 3.666
</c... | <p>You can only provide one single line at DataFrame creation time:</p>
<pre><code>pd.DataFrame(data = [df.mean()], index = df.index)
</code></pre>
<p>It gives:</p>
<pre><code> A B
0 2.0 3.666667
1 2.0 3.666667
2 2.0 3.666667
</code></pre> | python|pandas | 2 |
364,091 | 61,092,662 | Uploading pandas dataframe to google spreadsheet | <p>I followed the steps <a href="https://gspread.readthedocs.io/en/latest/oauth2.html" rel="nofollow noreferrer">here</a> and <a href="https://stackoverflow.com/questions/45540827/appending-pandas-data-frame-to-google-spreadsheet">here</a> but couldn't upload a pandas dataframe to google sheets.</p>
<p>First I tried t... | <p>You are not importing the package properly.</p>
<p>Just do this</p>
<pre><code>from df2gspread import df2gspread as d2g
</code></pre>
<p>When you convert a worksheet to Dataframe using</p>
<pre><code>existing = gd.get_as_dataframe(ws)
</code></pre>
<p>All the blank columns and rows in the sheet are now part of the d... | python|pandas|google-sheets|google-sheets-api|gspread | 3 |
364,092 | 60,819,124 | MySql Commands out of sync when storing stored procedure result in dataframe | <p>I am trying to import data from a MySql database into a pandas dataframe by calling a stored procedure.</p>
<p>But I am getting the following error which I do not understand after the exception is thrown it seems like the data is actually in the dataframe. So how can I get rid of this exception?</p>
<pre><code>imp... | <p>For stored procedures, you need to use the connection object per <a href="https://docs.sqlalchemy.org/en/13/core/connections.html#calling-stored-procedures" rel="nofollow noreferrer">SQLAlchemy docs</a> to access <a href="https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlcursor-callproc.html" r... | python|mysql|sql|pandas|sqlalchemy | 1 |
364,093 | 60,960,284 | How to return a data frame cell value as the variable name passed to a function | <p>I made a function that returns a few statistics, but I would like the last column to be the name of the parameter that is inserted into the function. </p>
<p>The code below shows the function and I would like the last column "Region" to give the value of the parameter that I used to initiate the function "NameofRe... | <p>Suppose you have regions a, b, c, d. Instead of doing something like:</p>
<pre><code>roia = #something a
roib = #something b
roic = #something c
roid = #something d
</code></pre>
<p>Consider doing:</p>
<pre><code>roi_dict = {
'a': #something a,
'b': #something b,
'c': #something c,
'd': #something d
}
</code></p... | python|pandas|function|image-processing|multidimensional-array | 0 |
364,094 | 60,891,163 | pandas using .where() to replace in .groupby() object | <p>Consider a dataframe which contains several groups of integers:</p>
<pre class="lang-py prettyprint-override"><code>d = pd.DataFrame({'label': ['a','a','a','a','b','b','b','b'], 'value': [1,2,3,2,7,1,8,9]})
d
label value
0 a 1
1 a 2
2 a 3
3 a 2
4 b 7
5 b 1
6 b 8
7 b 9
</code></... | <p>IIUC, you can use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.cummax.html" rel="nofollow noreferrer"><code>cummax</code></a> in the <code>groupby</code> like:</p>
<pre><code>d['val_max'] = d.groupby('label')['value'].cummax()
print (d)
label value val_max
0 a 1 ... | python|pandas|pandas-groupby | 3 |
364,095 | 60,967,438 | Unable load Tensor RT SavedModel after conversion in Tensorflow 2.1 | <p>I have been attempting to convert a <a href="https://github.com/zzh8829/yolov3-tf2" rel="nofollow noreferrer">YOLOv3 model implemented in Tensorflow 2</a> to Tensor RT by following the tutorial on the NVIDIA website (<a href="https://docs.nvidia.com/deeplearning/frameworks/tf-trt-user-guide/index.html#worflow-with-s... | <p>I found that this happens because the libnvinfer_plugin.so.* doesn't get loaded when infering using a saved engine (I'm guessing it gets loaded and used when convert.build() is used).</p>
<p>I forced a plugins init using <code>trt.init_libnvinfer_plugins(None,'')</code> (import tensorrt as trt) at the start of my in... | python|tensorflow|tensorrt | 3 |
364,096 | 61,012,038 | Appending a single row from multiple CSV files to another CSV | <p>I'm using python 3 and pandas. I have a folder of multiple CSV files where each contain stats on a given date for all the regions of a country. I have created another folder for CSV files I created for each of the regions, one named for each of the regions listed in the CSV files in the first folder. I want to appen... | <p>I would not use pandas here because there is little data processing and mainly file processing. So I would stick to the csv module.</p>
<p>I would look over the csv files in the first directory and process them one at a time. For each row I would just append it in the file with the relevant name in the second folde... | python|pandas|csv | 0 |
364,097 | 60,790,229 | Need to group by month and region and return the sum in Python Pandas | <p>Hi I have a dataset like below</p>
<pre><code>region Month price
AI February 8827
AI April 9000
AI July 3453
ANZ February 1714
ANZ April 2991
ANZ July 3453
</code></pre>
<p>I need to retrieve the <strong>sum</strong> for a particular <strong>r... | <p>You can try <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.groupby.html" rel="nofollow noreferrer"><code>df.groupby</code></a> along with <a href="https://www.python.org/dev/peps/pep-0274/" rel="nofollow noreferrer"><code>dict-comprehension</code></a>:</p>
<pre><code>>>&g... | python|python-3.x|pandas|numpy|pandas-groupby | 0 |
364,098 | 61,143,264 | Python np.append does not work on dictionary value which is of type numpy.ndarray | <p>I have a function which given two numpy array converts them into a dictionay as follows</p>
<pre><code>def seggregate_based_on_y(X,y):
dictionary={}
for index in range(len(y)):
if y[index] in dictionary.keys():
np.append(dictionary[y[index]],X[index])
else:
dictionary... | <p>you may use the built-in function <code>zip</code>:</p>
<pre><code>def seggregate_based_on_y(X,y):
d = {}
for k, v in zip(y, X):
if k in d:
d[k] = np.append(d[k], v.reshape(1, 2), axis=0)
else:
d[k] = v.reshape(1, 2)
return d
X=np.array([[1,1],[2,2],[3,3],[4,4]... | python|arrays|numpy|append | 1 |
364,099 | 61,148,181 | Pandas/regex based approach to match first string from a list of strings | <p>Apologies if this is cross-listed; I searched for a while! </p>
<p>I'm working with some very large, very messy data in Pandas. The variable of interest is a string, and contains one or more instances of business names with(out) typical business suffixes (e.g., LLC, LP, LTD). For example, I might have "ABC LLC XYZ,... | <p>To get the texts that come before and including the keywords, you may use</p>
<pre><code>pattern = r"^(.*?\b(?:{}))(?!\w)".format("|".join(map(re.escape, names)))
</code></pre>
<p>and then </p>
<pre><code>df['results'] = df['texts'].str.extract(pat, expand=False)
</code></pre>
<p>Adjust the column names to match... | python|regex|pandas | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.