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 |
|---|---|---|---|---|---|---|
360,300 | 58,340,081 | I need to merge 2 dataframes with Pandas and add a filter | <p>I need to merge 2 data frames with Pandas. I'm using Jupyter Notebook.
I can merge but I cannot filter the data (like a WHERE statement on SQL).
The data frames have equal messages that were labeled with 0 or 1 by the labelers.
The data frames have 3 columns with equal values - <code>Id</code>, <code>timestamp</cod... | <p>As I understood:</p>
<pre><code>df1 = df1.merge(df2, on = ['Id'], how='left')
df1.where((df1['high_df1'] == 1) & (df1['low_df2'] == 1))
</code></pre> | python|pandas|dataframe|merge | 0 |
360,301 | 58,380,077 | How can I convert an unstructured string to a dataframe? | <p>I have a long string text that I would like to convert to a dataframe to analyze. Please see below for a sample of the data below. I would like the columns to be "Facility", "Street", "City", "Phone", and "Store Hours".</p>
<pre><code>string = AlaskaUSCG Base Ketchikan 1300 Stedman Street Ketchikan, AK (907) 228-... | <p>You may use simple web-scraping techniques, such as <code>bs4</code> and <code>requests</code>.</p>
<pre><code>import bs4
r = requests.get(URL)
b = bs4.BeautifulSoup(r.text)
</code></pre>
<p></p>
<pre><code>addresses = []
for val in b.find_all(name='p'):
s = list(val.stripped_strings)
if s and not s[0].sta... | python|string|pandas|dataframe|data-manipulation | 1 |
360,302 | 58,404,136 | Get y coordinates given x and z for a plane in 3D | <p>I've generated a 3D circular plane that has been rotated along the x-axis by 45 degrees:</p>
<p><a href="https://i.stack.imgur.com/Ri1Ps.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ri1Ps.png" alt="enter image description here"></a></p>
<p>I want to determine the y-coordinate of the plane, gi... | <p>This is straightforward 3D analytic geometry. First, note that there is no such thing as a "circular plane"; you have describe a circle and its interior, which, by definition, are embedding in a particular plane.</p>
<p>The equation of that plane is <code>y + z = 0</code>; <code>x</code> is an unconstrained variab... | python|arrays|numpy|scipy|interpolation | 1 |
360,303 | 58,422,129 | Creating Multiple DataFrames from single DataFrame based on different values of single column | <p>I have 3 days of time series data with multiple columns in it. I have one single DataFrame which includes all 3 days data. I want 3 different DataFrames based on Column name "Dates" i.e df["Dates"]</p>
<p>For Example:</p>
<p>Available Dataframe is: df</p>
<p><a href="https://i.stack.imgur.com/RaqFU.png" rel="nof... | <p>Unsure if your saving your variable into a csv or keep it in memory for further use, </p>
<p>you could pass each unique value into a dict and access by it's value : </p>
<pre><code> print(df)
Cal Dates
0 85 23
1 75 23
2 74 23
3 97 23
4 54 24
5 10 24
6 77 24... | python|pandas|dataframe | 1 |
360,304 | 58,237,556 | Forward fill missing values by group after condition is met in pandas | <p>I'm having a bit of trouble with this. My dataframe looks like this:</p>
<pre><code>id amount dummy
1 130 0
1 120 0
1 110 1
1 nan nan
1 nan nan
2 nan 0
2 50 0
2 20 1
2 nan nan
2 nan nan ... | <p>The way I will use </p>
<pre><code>s = df.groupby('id')['dummy'].ffill().eq(1)
df.loc[s&df.dummy.isna(),'amount']=0
</code></pre> | python|pandas|group-by|nan | 7 |
360,305 | 58,402,973 | How to create train, test and validation splits in tensorflow 2.0 | <p>I am new to tensorflow, and I have started to use tensorflow 2.0</p>
<p>I have built a tensorflow dataset for a multi-class classification problem. Let's call this <code>labeled_ds</code>. I have prepared this dataset by loading all the image files from their respective class wise directories. I have followed along... | <p>Please refer below code to create train, test and validation splits using tensorflow dataset "oxford_flowers102" </p>
<pre><code>!pip install tensorflow==2.0.0
import tensorflow as tf
print(tf.__version__)
import tensorflow_datasets as tfds
labeled_ds, summary = tfds.load('oxford_flowers102', split='train+test+va... | python|tensorflow|tensorflow-datasets|tensorflow2.0 | 2 |
360,306 | 58,383,374 | Reading in specific columns of a dataset with python | <p>I have been trying to take a very large csv file and read it into python and write a new reduced csv file. I have created a list of column names I would like to use. Below is the code I'm trying to use</p>
<pre><code>redfile = open(file_path,'r')
import csv
reader=csv.reader(redfile)
names=next(reader)
for elem in... | <p>I suppose, you just want to copy the content of file <code>file_path</code> into <code>reduced.csv</code> with all columns removed, that start with one of the characters <code>X</code>, <code>P</code>, <code>W</code> and without the columns <code>SCH_ID</code>, <code>STRAT_ID</code>, <code>STU_ID</code>.</p>
<p>If ... | python|python-3.x|numpy|csv | 0 |
360,307 | 58,493,779 | how to iterate each row of one dataframe and compare with rows in another dataframe in Python? | <p>I have two dataframes:</p>
<p>DF1:</p>
<pre><code>ID v1 v2 v3
289 1455.0 2.0 0.62239
289 1460.0 0.0 0.46037
289 1465.0 4.0 0.41280
290 1470.0 0.0 0.39540
290 1475.0 2.0 0.61809
290 1475.0 2.0 0.61... | <p>The code block you have looks pretty close to what you do in python. Take a row from one dataframe and iterate through the other dataframe looking for matches.</p>
<pre><code>for index, row in results_01.iterrows():
diff = []
compare_item = row['col_name']
for index, row in results_02.iterrows():
... | python|pandas|loops|dataframe|comparison | 1 |
360,308 | 58,327,708 | How to train a simple neural network to implement median filter? | <p>Task: Given the random sequential number of {0,1,2,3,4}, train a neural network to find the position index of number "2". This network mimics the median filter which finds the index of the median number instead of the median number itself. For example, given the input [3,1,0,2,4], the output/label is "3" (or [0,0,0,... | <p>About the model:</p>
<ul>
<li>It seems your initializers are wildly big. Let the standard initializers instead. </li>
<li>Also, you're using relu with such a tiny dimensional data. The chance of getting all-zeros with it is great. </li>
</ul> | tensorflow|machine-learning|keras|neural-network | 2 |
360,309 | 58,550,648 | Getting an output of 'None' but not sure what exactly is triggering it | <p>I have a function to plot two histograms as well as a method to compute some stats from tables given to me in a homework problem. When I run this function in my jupyter notebook I am given the following output:</p>
<pre><code>None #Not quite sure where this came from
(26.54, 4269775.77) #This is calc... | <p>In your notebook: <code>compute_statistics(full_data)</code> is called, which <code>print</code>s one result from a <code>.hist</code> method, and then <code>return</code>s another. In both cases, the method returns <code>None</code>, so the <code>print</code> displays that, and then the <code>return</code>ed value ... | python|function|numpy | 0 |
360,310 | 58,295,764 | Import wav file in Tensorflow 2 | <p>Using Python 3.7 and Tensorflow 2.0, I'm having a hard time reading wav files from the UrbanSounds dataset. <a href="https://stackoverflow.com/questions/58096095/how-does-tf-audio-decode-wav-get-its-contents/58097046#58097046">This question and answer</a> are helpful because they explain that the input has to be a s... | <p>It seems like your error has to do with TensorFlow expecting the fmt part as the beginning. </p>
<p>The code of TensorFlow for the processing can be found here: <a href="https://github.com/tensorflow/tensorflow/blob/c9cd1784bf287543d89593ca1432170cdbf694de/tensorflow/core/lib/wav/wav_io.cc#L225" rel="noreferrer">ht... | wav|tensorflow2.0 | 7 |
360,311 | 69,042,209 | Fetching Standard Meteorological Week from pandas dataframe date column | <p>I have a pandas dataframe which is having long term data,</p>
<pre><code>
point_id issue_date latitude longitude rainfall
0 1.0 2020-01-01 6.5 66.50 NaN
1 2.0 2020-01-02 6.5 66.75 NaN
... ... ... ... ... ... ... ...
... | <p>Use:</p>
<pre><code>df = pd.DataFrame({'issue_date': pd.date_range('2000-01-01','2000-12-31')})
#inspire https://stackoverflow.com/a/61592907/2901002
normal_year = np.append(np.arange(363) // 7 + 1, np.repeat(52, 5))
leap_year = np.concatenate((normal_year[:59], [9], normal_year[59:366]))
days = df['issue_dat... | python|pandas|dataframe|date|datetime | 1 |
360,312 | 69,032,879 | how to append longs array to a dataframe in define positions | <p>I would like to append some numpy array to a dataframe in defined positions.
This is the example that have set to try to explain my problem.</p>
<p>Let's say that I have this data frame:</p>
<pre><code>dfr = pd.DataFrame()
cols = ['a','b','c','d','e','f']
dfr = pd.DataFrame(columns = cols)
</code></pre>
<p>and th... | <p>You have 4 element in vv but only 3 in dfr.loc[0,2:5].
Just run <code>dfr.loc[0,1:5] = vv[:]</code> or <code>dfr.loc[0,2:6] = vv[:]</code> instead.</p> | python|arrays|pandas|dataframe|append | 1 |
360,313 | 69,086,966 | Updating multiple Cell Values in Dataframe | <p>My dataset is in this form:</p>
<pre><code>df = pd.DataFrame({'ID': [1,2,3,4],
'Type': ['A', 'B', 'B', 'B'],
'Value': [100, 200, 201, 120]})
</code></pre>
<p>I want to update the dataframe in the following way:</p>
<pre><code>df = pd.DataFrame({'ID': [1,2,3,4],
... | <p>Try this instead:</p>
<pre><code>df.loc[df['Type'].eq('B') & df['Value'].eq(200), 'Type'] = 'B1'
</code></pre> | python|pandas | 1 |
360,314 | 68,998,938 | Create a new row for each day (pd.date_range) - Merge, Join or Concat? | <p>I'm trying to create a dataframe by "multiplying" two others.
Let me show you what I've tried to do.</p>
<p>1 - Create a dataframe from a data range</p>
<pre><code>df_dates = pd.DataFrame({'date_prediciton':pd.date_range(start='2021-08-01', end='2021-08-31', freq='W-SUN')})
df_dates.head()
date_predici... | <p>You can use <a href="https://pandas.pydata.org/docs/reference/api/pandas.MultiIndex.from_product.html" rel="nofollow noreferrer"><code>pd.MultiIndex.from_product</code></a> to create cartesian product of the two:</p>
<pre><code>print (pd.MultiIndex.from_product([client, df_dates["date_prediciton"]]).to_fra... | python|pandas|date-range | -1 |
360,315 | 69,123,787 | Sklearn One Hot Encoding produces non-tabular output | <p>I have a data set like this:</p>
<pre><code> Entity Year Mean
0 Afghanistan 2016 0.99
1 Africa 2016 0.99
2 Albania 2016 0.99
3 Algeria 2016 0.99
4 Americas 2016 0.99
... ... ... ...
11346 World 1961 0.05
11347 Yemen 1961 ... | <p>The column transformer has opted to transform into a scipy sparse matrix because the one-hot encoder does and it has sufficiently many columns compared to the passthrough.</p>
<p>Many ML models will accept sparse input, and this will be much more memory-efficient.</p>
<p>Otherwise, you can force dense arrays through... | python|numpy|scikit-learn | 2 |
360,316 | 68,873,119 | how to calculate total against each month and create new excel | <p>INPUT excel file:</p>
<pre><code>PRODUCTPRICE TIMEPLACED
2 14-JUN-18 02.53.33.347000 AM
3 14-JUN-18 03.05.15.210000 AM
4 14-JUN-18 02.26.11.959000 AM
30 14-JUL-18 02.53.33.347000 AM
20 14-JUL-18 03.05.15.210000 AM
20 14-MAR-19 02.53.33.347000 AM
10 14-MAR-18 03.05.15.210000 A... | <p>This would be my approach:</p>
<p>Step 0: Try to get a better input format. Excel is not suitable for data processing.</p>
<p><strong>Step 1. Read the original excel:</strong><br />
If step 0 fails, I would use <code>pandas</code>' <code>read_excel</code> function to get a DataFrame:</p>
<pre><code>import pandas as ... | python|python-3.x|pandas | 0 |
360,317 | 69,260,116 | How to Keep Previous Pandas Plots? | <p>I am plotting a frequency graph for each of my features in my machine learning data set. The problem is I am using pandas and the graphs are not staying when the next one is plotted.</p>
<pre><code>for col in X_train.columns:
if "ThreeMonthAvg" in col:
X_train[col] = pd.cut(X_train[col], bins=[... | <p>IIUC, you want to combine all the plots.</p>
<p>You can set up the axes and reuse it:</p>
<pre><code>import matplotlib.pyplot as plt
ax = plt.subplot()
for col in X_train.columns:
if "ThreeMonthAvg" in col:
X_train[col] = pd.cut(X_train[col], bins=[-np.inf, 0, 100, 500, 1000, 2000, 4000, np.i... | python|pandas|graph | 0 |
360,318 | 68,921,894 | How to get last non empty value of each columns in pandas? | <p>I have a dataframe of half rectangle, something like this</p>
<pre><code> a_1 a_2 a_3 a_4
1 Apple Nuts Plum Cucumber
2 Grapes Kiwi Apple ''
3 Melon Lime '' ''
4 Peach '' '' ''
</code></pre>
<p>I want a list of last non empty value of each columns. So the output expecting is ... | <p>First create mising values instead empty strings, forward filling them and select last row by <code>iloc</code>:</p>
<pre><code>L = df.replace('', np.nan).ffill().iloc[-1].tolist()
print (L)
['Peach', 'Lime', 'Apple', 'Cucumber']
</code></pre> | python|pandas|dataframe | 2 |
360,319 | 69,164,779 | Asking help of pandas as groupby function? | <p><img src="https://i.stack.imgur.com/Rtaw8.png" alt="enter image description here" /></p>
<p>As my new comer for python using, could help me how to create the "Number column" by number sequence under different name of "test1" column, thanks.
(for example: pandas groupby function??)</p> | <p>Try:</p>
<pre class="lang-py prettyprint-override"><code>df["Number"] = (df.test1 != df.test1.shift()).cumsum()
print(df)
</code></pre>
<p>Prints:</p>
<pre class="lang-none prettyprint-override"><code> test1 Number
0 AAA 1
1 AAA 1
2 AAA 1
3 AAA 1
4 BBB 2
5 ... | pandas|pandas-groupby | 1 |
360,320 | 69,266,134 | Extract the mapping dictionary between two columns in pandas | <p>I have a dataframe as shown below.</p>
<p>df:</p>
<pre><code>id player country_code country
1 messi arg argentina
2 neymar bra brazil
3 tevez arg argentina
4 aguero arg argentina
5 rivaldo bra brazil
... | <p>Dictionary has unique keys, so is possible convert <code>Series</code> with duplicated <code>index</code> by column <code>country_code</code>:</p>
<pre><code>d = df.set_index('country_code')['country'].to_dict()
</code></pre>
<p>If there is possible some <code>country</code> should be different per <code>country_cod... | python-3.x|pandas|dataframe | 1 |
360,321 | 69,092,381 | Filter values in a column based on set rules | <p>I have a dataframe</p>
<pre><code> Group ID
1 09239820
2 2872498938
2 1267
3 23219823983
3 267839236
4 33287442
</code></pre>
<p>I want to replace the 1st, 2nd and 4th numbers in the ID column with letters</p>
<pre><code> Replace 1st with N
Replace 2nd with X
... | <p>You can use <code>.str.replace</code> with captured groups and back reference:</p>
<pre><code>df.ID = df.ID.astype(str)
df.ID.str.replace('..(.).(.*)', r'NX\1D\2')
0 NX3D820
1 NX7D498938
2 NX6D
3 NX2D9823983
4 NX7D39236
5 NX2D7442
Name: ID, dtype: object
</code></pre> | python|pandas|numpy | 5 |
360,322 | 69,055,889 | Issue with reproducibility across different sessions | <p>I am trying to make a script reproducible but having some issue. The code is in Tensorflow 2.x and doesn't use keras API. It has many layers build with tf.compat. The model is created and trained with a function <code>get_model()</code></p>
<pre><code>os.environ['tf_deterministic_ops'] = "2"
os.environ[&qu... | <p>I'd say everything behaves normally:
Setting a random-seed always produces the same sequence of random variables, e.g.</p>
<pre><code>import numpy as np
# set seed
np.random.seed(2)
for i in range(5):
print(np.random.randint(10)) # prints: 8, 8, 6, 2, 8
for i in range(5):
np.random.seed(2)
print(n... | python|tensorflow|deep-learning | 0 |
360,323 | 69,276,961 | How to extract loss and accuracy from logger by each epoch in pytorch lightning? | <p>I want to extract all data to make the plot, not with tensorboard. My understanding is all log with loss and accuracy is stored in a defined directory since tensorboard draw the line graph.</p>
<pre><code>%reload_ext tensorboard
%tensorboard --logdir lightning_logs/
</code></pre>
<p><a href="https://i.stack.imgur.co... | <p>Lightning do not store all logs by itself. All it does is <em>streams</em> them into the <code>logger</code> instance and the logger decides what to do.</p>
<p>The best way to retrieve all logged metrics is by having a custom callback:</p>
<pre><code>class MetricTracker(Callback):
def __init__(self):
self.col... | logging|pytorch|tensorboard|pytorch-lightning | 1 |
360,324 | 69,212,047 | How to create a column that starts with and end with string value in another column? | <p>How do I create a column that starts from "\"" and ends in "]" in another column?</p>
<p>For example</p>
<pre><code>A new_column
\\loc\ggg.x]ddj \\loc\ggg.x]
+\\lol\lll.d]aaa \\lol\lll.d]
</code></pre>
<p>I tried doing this</p>
<pre><code>df['new_column'] = df['A'].st... | <p>Try <code>.str.extract</code>:</p>
<pre class="lang-py prettyprint-override"><code>df["new_column"] = df["A"].str.extract(r"(\\.*?\])")
print(df)
</code></pre>
<p>Prints:</p>
<pre class="lang-none prettyprint-override"><code> ... | python|pandas|dataframe|slice | 1 |
360,325 | 69,242,492 | Numpy - Same Dtype Arrays Comparison - Depreciationwarning: Elemetwise comparison failed | <p>I am given an original list of floats, where the integer value indicates the type of experiment, and the decimal value indicates which number of times it was conducted.</p>
<p>My job is to remove all the floats whose integer value appear less than 3 times.</p>
<p>This is my 3rd time using Numpy, so I googled around ... | <p>With your <code>arr</code> (<code>id</code>):</p>
<pre><code>In [322]: import math
In [323]: maxMinOne = math.floor(max(arr))
In [324]: newId = np.array([math.floor(y) for y in arr if 0<y and y<(maxMinOne +1) ])
In [325]: newId
Out[325]: array([1, 2, 2, 4, 5, 3, 5, 3, 2, 1, 5, 3])
</code></pre>
<p>comparing t... | python|numpy|sorting | 1 |
360,326 | 68,941,048 | Backfill timeseries in pandas with last available data point | <p>I have a data-frame (<code>df</code>) which takes a snapshot every hour of every day. Below is a partial output:</p>
<pre><code> date_time score distance
12/08/2021 21:00 1.7655 1538061.73
12/08/2021 22:00 1.7520 1531284.36
12/08/2021 23:00 1.7343 1595898.01
13/08/2021 00:00 1.8340 ... | <p>If you set the index of the dataframe to use the timestamps, you can use pandas.resample() on your dataframe, setting it to generate a row every hour and forward-filling when null values are encountered...</p>
<pre><code>df.set_index('date_time', drop=True, inplace=True)
df = df.resample('1H', fill_method='ffill')
<... | python|pandas | 3 |
360,327 | 68,972,340 | How to convert a nested list of strings to a one list? | <p>I wanted to convert a nested list of strings into a single list.
For example,
if there is a list like,</p>
<p><code>fruits = ['apple','orange, ['pineapple','grapes']]</code></p>
<p>I want to convert this to:</p>
<p><code> fruits = ['apple','orange','pineapple','grapes']</code></p>
<p>I tried using the <code>more_ite... | <p>see below (assuming <code>fruits</code> contains strings or lists only)</p>
<pre><code>fruits = ['apple', 'orange', ['pineapple', 'grapes']]
flat = []
for f in fruits:
if isinstance(f, str):
flat.append(f)
else:
flat.extend(f)
print(flat)
</code></pre>
<p>output</p>
<pre><code>['apple', 'oran... | python|pandas|list|dataframe|more-itertools | 2 |
360,328 | 69,252,056 | Shifting Values in Python | <p>I have a problem that sounds easy, however, I could not find a solution. I would like to shift values according to the first year of the release. I mean the first column represents the years of the release and the columns are years when the device is broken (values are numbers of broken devices).</p>
<p>See example:... | <p>Use custom function with compare columnsnames without <code>Delivery Year, Freq</code> with <code>Delivery Year</code> and shifting by this value:</p>
<pre><code>def f(x):
shifted = np.argmin((x.index.astype(int)< x.name[0]))
return x.shift(-shifted)
df = df.set_index(['Delivery Year', 'Freq']).apply... | python|pandas | 1 |
360,329 | 69,076,747 | Shift only selected rows in Pandas | <p>I would like to shift only specific rows in my DataFrame by 1 period on the columns axis.</p>
<pre><code>Df
Out:
Month Year_2005 Year_2006 Year_2007
0 01 NaN 31 35
1 02 NaN 40 45
2 03 NaN 87 46
3 04 NaN 55 41
4 05 NaN 36 28
5 06 ... | <p>Try:</p>
<pre><code>df = df.set_index("Month")
df[df["Year_2005"].notnull()] = df[df["Year_2005"].notnull()].shift(axis=1)
>>> df
Year_2005 Year_2006 Year_2007
Month
1 NaN 31.0 35.0
2 NaN 40.0 ... | python|pandas | 1 |
360,330 | 68,924,007 | How to combine 2 datasets to make this dataset? | <p>I would like to ask you how to combine 2 datasets to the merged one that would look like this:
<a href="https://i.stack.imgur.com/5BfsM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5BfsM.png" alt="merged dataset" /></a></p>
<p>I need to merge those datasets:</p>
<div class="s-table-container">
... | <p>You can use <code>concat</code> and <code>unstack</code>:</p>
<pre><code>(pd.concat([df1, df2])
.set_index(['Shop', 'Segment'])
.unstack(-1)
.swaplevel(axis=1)
.sort_index()
.rename(columns={'Evolution': 'Z'}, level=1)
.sort_index(axis=1, ascending=[False, True])
.rename(columns={'Z': 'Evolution... | python|pandas | 0 |
360,331 | 69,281,548 | When is .repeat used when loading a Tensorflow dataset for training? | <p>I have seen tutorials which use .repeat() while doing the loading, shuffling, mapping, batching, prefetching etc. for a Tensorflow dataset while there are others that completely skip it.</p>
<p>I know what repeat does and how it is used, but am not able to figure out <strong>when</strong> it is used and when it is n... | <p>It depends. Let's use MNIST as an example. Say we build a dataset using <code>from_tensor_slices</code>. The training dataset has 60000 samples.</p>
<p>Let's say we use batch size 100 and do not use <code>repeat</code>. This means the dataset will provide 600 batches. Now, if we try to train a model, for example usi... | tensorflow|tensorflow-datasets | 1 |
360,332 | 69,194,208 | Element-wise multiplication of a 3D array with a 2D array | <p>I have a <code>portion</code> of a RGB image as numpy array, the <code>shape</code> of which is <code>(height, width, channel) = (5, 5, 3)</code>.</p>
<p>What I want to do with this is to get the sum of element-wise multiplication with 5x5 <code>kernel</code> matrix, channel by channel. So it should yield a vector o... | <p>I'll show here two methods of doing this. The first one is basically the "manual" version that relies on <a href="https://numpy.org/doc/stable/user/basics.broadcasting.html" rel="nofollow noreferrer">broadcasting</a>, which is an important concept to understand for using <code>numpy</code> and similar lib... | python|numpy | 2 |
360,333 | 69,178,695 | python numpy array reduction distance between elements | <p>I have an array in python made like this:</p>
<pre><code>array([ 18, 36, 54, ..., 9893804, 9893822, 9893840],
dtype=int64)
</code></pre>
<p>I wish to obtain an array containing the "distances" bewteen ech byte...</p>
<p>in this case it would be:
[18,18,18, ..., xxx, 18, 18]</p>
<p>to do... | <p>How about <code>np.diff(arr)</code>?</p>
<pre><code>arr = np.array(...)
print(np.diff(arr)) # [18 18 18 ... 18 18 18]
</code></pre> | python|arrays|numpy|flatten | 2 |
360,334 | 69,055,763 | Unknown behavior of hooks on batch norm in pytorch | <p>I try to freeze the batch_norm layer and analyse their inputs/outputs with forward hooks</p>
<p>For fixed BN layers, I just couldn't understand why the hooked output is different from the output reproduced by the hooked input.</p>
<p>Really appreciate that if anyone could help me</p>
<p>Here's the code:</p>
<pre><co... | <p><strong>TLDR; Some operators will only appear in the <code>forward</code> of the module: such as non-parametrized layers.</strong></p>
<p>Some components are not registered in the child module list. This can usually be the case for activation functions but will ultimately depend on the module implementation. In your... | pytorch | 0 |
360,335 | 69,232,129 | Timeseries several events forecasting | <p>I am new to timeseries and I have a problem, I have a dataset of 3 columns, time, category, frequency of this category. The time is from 2016 to end of 2017. I need to forecast the frequency of each category during 2018: Dataset:
<a href="https://i.stack.imgur.com/aiscc.png" rel="nofollow noreferrer"><img src="https... | <p>As mentioned in Neuraprophet docs, here <a href="https://neuralprophet.com/model-overview/" rel="nofollow noreferrer">https://neuralprophet.com/model-overview/</a>:</p>
<blockquote>
<p>If you have many series that you expect to produce forecasts for, you
need to do this one at a time.</p>
</blockquote>
<p>In your ca... | python|pandas|deep-learning|time-series|forecasting | 1 |
360,336 | 69,030,546 | Pytorch creating model from load_state_dict | <p>I'm trying to learn how to <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow noreferrer">save and load</a> trained models in Pytorch, but so far, I'm only getting errors. Let's consider the following self-contained code:</p>
<pre><code>import torch
lin=tor... | <p>Hey you have two problems:</p>
<ol>
<li>Remove the <code>.__class__()</code></li>
<li>Separate the definition of ann3 and ann4.</li>
</ol>
<pre><code>ann1.load_state_dict(ann1.state_dict())
ann3 = ann1
print(ann3(x))
ann2.load_state_dict(ann2.state_dict())
ann4 = ann2
print(ann4(x))
</code></pre>
<p>But, what is the... | python|import|neural-network|pytorch|export | 1 |
360,337 | 69,209,264 | Trouble vectoring a NumPy | <p>I am trying to write some efficient code for a school project using LIDAR. The goal is to filter out anything in the point cloud past 10 meters in the point cloud and pass it out. I can write a for loop to do this but it's not very optimized. My goal is to this efficiently with NumPy.</p>
<pre><code>def get_distance... | <p>Calculate sum of square inner rows and no need to sqrt, directly compare with square distance</p>
<pre class="lang-py prettyprint-override"><code>def filter_by_distance(cloud, distance=10):
# np.sum is implemented c and very fast
# axis = 1 for summing row
# no need to sqaure root (save computation)
... | python|performance|numpy|ros|lidar | 4 |
360,338 | 69,223,097 | Downloading "Imdb_reviews" from Tensorflow_datasets: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 30 invalid continuation byte | <p>When I was downloading "imbd_reviews" dataset I am facing the below error,</p>
<p><strong>'utf-8' codec can't decode byte 0xc5 in position 171: invalid continuation byte</strong></p>
<pre><code>import tensorflow_datasets as tfds
datasets, info = tfds.load("imdb_reviews",as_supervised=True, with_i... | <p>My tensorlflow version is 2.4.1 and I solved it by updating tfds to 4.5.2. Therefore, update tfds to a new version may be useful.</p> | python-3.x|deep-learning|nlp|tensorflow2.0|tensorflow-datasets | 0 |
360,339 | 69,113,170 | Count Non-Null Values Pandas | <p>I have this set of data:</p>
<pre><code>UserID AccountNum
A001 12345
A001 NaN
A001 56789
</code></pre>
<p>My wish output is like this, I want to count number of AccNum but I don't want to count the null value</p>
<pre><code>UserID TotalAccNum
A001 2
</code></pre>
<p>I have tried this query:</p... | <p>try this:</p>
<pre><code>df[df['AccountNum'].notnull()].count()
</code></pre> | python|pandas|numpy|null|pandas-groupby | 1 |
360,340 | 68,944,084 | Pandas: How to include all columns and all indexes for multiple pivot table | <p>I am trying to create pivot tables for different locations from the following dataframe (<code>df</code>):</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: center;">Location</th>
<th style="text-align: center;">Category</th>
<th style="text-align: center;">Status</th>
<... | <p>You can create the pivot table before splitting by <code>Location</code>.</p>
<p>For <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.pivot_table.html" rel="nofollow noreferrer"><code>pd.pivot_table</code></a>:</p>
<ul>
<li>set index with <code>index=['Location', 'Status']</code></li>
<li>p... | python|pandas|dataframe|pivot-table | 4 |
360,341 | 69,162,411 | Filtering if list elements are same in a pandas column | <p>I have a dataframe, which simply looks like this:</p>
<pre><code>edges
id node_id ...
0 'AX' ['A', 'B']
1 'BX' ['B', 'C']
2 'CX' ['C', 'C']
</code></pre>
<p>The <code>'id'</code> column has string elements, and the <code>'node_id'</code> column has lists (with strings inside).</p>
<p>I... | <p>Another version using only <strong>vectorized functions</strong> and <strong>without using <code>.apply()</code></strong>:</p>
<p>Filter to keep only rows with <em>"length of unique items in the list"</em> is equal to <em>"length of the list"</em>:</p>
<p>Set mask for the condition <em>"leng... | python|pandas|dataframe|filter|apply | 1 |
360,342 | 68,978,732 | How to covert json str to dataframe in Python | <p>Update Json sample:</p>
<pre><code>{
"header":{"time_cost_ms":3.638,"time_cost":0.003638,"core_time_cost_ms":3.6,"ret_code":"succ"},
"norm_str":"Women's March finally replaces three original leaders after anti-Semitism accusations",
&quo... | <p>I would assume that you received this json from an API because of header key.</p>
<p>Lets load the json file first:</p>
<pre><code>with open(<json file path>, 'r') as json_file:
json_example = json.loads(json_file)
</code></pre>
<p>The <code>pd.json_normalize()</code> may not work as intended if you supply... | python|json|pandas | 0 |
360,343 | 69,226,739 | pandas: load multiple files into dataframe | <p>I have six CSV files for six different years and I'd like to combine them into a single dataframe, with the column headers appropriately labelled.</p>
<p>Each raw CSV file looks like this (e.g. 2010.csv)</p>
<pre><code>state,gender,population
FL,m,2161612
FL,f,2661614
TX,m,3153523
TX,f,3453523
...
</code></pre>
<p>A... | <p>Try concat on axis 1 after setting state and gender as index</p>
<pre><code>l = ['2010.csv','2012.csv']
out = pd.concat((pd.read_csv(file).set_index(['state','gender'])
.add_suffix(file.split(".")[0]) for file in l),axis=1)
out = out.reset_index() #finally reset the index if needed
</code></pre>
<p... | python|pandas | 0 |
360,344 | 69,192,568 | tensorflow save and load variational auto encoder model | <p>I run a python script based on this <a href="https://colab.research.google.com/github/tensorflow/probability/blob/main/tensorflow_probability/examples/jupyter_notebooks/Probabilistic_Layers_VAE.ipynb#scrollTo=ow7rfh6YLLx1" rel="nofollow noreferrer">tensorflow colab</a> : I rewrote the colab content into a script whi... | <p>partial answer to my own question--</p>
<p>Probabilistic layers seems not to be possibly saved with <code>keras.models.save_model()</code> only weights can be saved and reloaded on a model created with the Functional API.</p>
<p>I could do so successfully on the encoder with</p>
<pre><code>decoder.save_weights('save... | python|tensorflow|machine-learning|deep-learning|autoencoder | 0 |
360,345 | 69,099,062 | How can I edit FlatBuffers file? | <p>I am using TensorFlow Lite.</p>
<p>The converted model file does not work on some mobile device due to its NNAPI driver's bug.</p>
<p>In order to avoid the bug, I need to insert reshape op before fullyconnected op.</p>
<p>I inserted it into the original model but an optimizer in the converter removed it.</p>
<p>How ... | <p>It's recommended that you don't update the TFLite file without using existing libraries, if any. You can add a feature request in the TFLite converter so the team can take a look at it in detail. <a href="https://github.com/tensorflow/tensorflow/issues/new?assignees=&labels=TFLiteConverter&template=60-tflite... | tensorflow-lite|flatbuffers | 0 |
360,346 | 69,105,294 | Randomly assign constant value to Numpy array | <p>The objective is randomly assign a constant value to <code>tril</code> of a numpy array.
I wonder whether there is more efficient and compact than the proposed solution below.</p>
<pre><code>import numpy as np
import random
rand_n2 = np.random.randn(10,10)
arr=np.tril(rand_n2,-1)
n=np.where(arr!=0)
nsize=n[0].shape... | <p>Don't know if this is much more efficient and compact, but I feel it's a bit cleaner and easier to read:</p>
<pre class="lang-py prettyprint-override"><code>import numpy as np
rand_n2 = np.random.randn(10,10)
arr=np.tril(rand_n2,-1)
# create list of lower trianguler indices
tril_idx = [(i,j) for i in range(1,10) f... | python|numpy | 1 |
360,347 | 69,147,143 | AttributeError: module 'pandas' has no attribute 'DataReader' | <p>I'm trying to get stock info of Pfizer (PFE)
I have tried to install Pandas and Pandas-datareader by</p>
<pre><code>pip install pandas
pip install pandas-datareader
</code></pre>
<p>Here's my code:</p>
<pre><code>import pandas_datareader.data as pdr
import datetime
start = pdr.datetime(2020,1,1)
end = pdr.datetime(2... | <p>You're calling pd.DataReader(), but the pandas module doesn't have the data reader function. pandas-datareader is the module with the DataReader() function.</p>
<p>If you imported pandas_datareader as pdr, call pdr.DataReader("PFE", "yahoo", start, end) instead.</p> | python|pandas | 0 |
360,348 | 68,933,998 | How to find right coordinates from numpy array | <p>I have a numpy array with 4 coordinates of rect/quadrilateral:</p>
<pre class="lang-py prettyprint-override"><code>pts = np.array([(690, 110), (345, 130), (690, 300), (445, 298)])
</code></pre>
<p>Note that these are not in order.</p>
<p>Now I want to find the top_left, top right, bottom left, bottom right of a rect... | <pre><code>l_d = (pts[:,0].min(), pts[:,1].min())
r_u = (pts[:,0].max(), pts[:,1].max())
l_u = (pts[:,0].min(), pts[:,1].max())
r_d = (pts[:,0].max(), pts[:,1].min())
print(f"0:{r_u} 1:{l_u} 2:{r_d},3:{l_d}")
</code></pre>
<p><a href="https://i.stack.imgur.com/UDfeu.png" rel="nofollow noreferrer"><img sr... | python|arrays|numpy|rectangles | -3 |
360,349 | 69,295,626 | create new dataframe once time-delta is higher than xy | <p>I have a dataframe with the following scheme:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>time</th>
<th>parameter</th>
<th>TimeDelta</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>800</td>
<td>-</td>
</tr>
<tr>
<td>3</td>
<td>788</td>
<td>2</td>
</tr>
<tr>
<td>4</td>
<td>544</td>
<t... | <p>You can use a custom group and split with <code>groupby</code>.</p>
<p>First ensure that your "TimeDelta" values are numeric with <code>pd.to_numeric</code>, then asses whether they are geater than 1.5, and apply a cumsum() to flag all the following rows up to the next value above threshold. Finally <code>... | python|pandas|dataframe | 1 |
360,350 | 68,978,375 | The channel dimension of the inputs should be defined. Found `None` | <p>I'm trying to make some LSTM+CNN hybrid for my college project and here's my code</p>
<pre><code>def model_robo():
grid=tf.keras.Input(shape=(1,10,12),dtype=tf.float32)
print(grid.shape)
cnn_result=tf.keras.layers.TimeDistributed(Conv2D(1,kernel_size=(3,3),data_format="channels_first"))(grid)
cnn_r... | <p>It works after I delete the <code>channels_first</code> (and changed it to <code>Conv1D</code> but that's another matters. see <a href="https://stackoverflow.com/questions/68992377/conv2d-lost-a-dimension-from-tensor-resulting-in-incompatible-dimension-error">here</a> for detail)</p>
<p>My hypothesis is <code>channe... | python|tensorflow|keras|deep-learning | 1 |
360,351 | 68,928,072 | how to get a list of sorted values filling missing ones in python? | <p>given a list of goods:<br />
<code>goodlist = ['bread', 'water', 'salt', 'saffron', 'mustard']</code><br />
and given a pandas dataframe with values for <em>some</em> of the goods:<br />
<code>new_qty = pd.DataFrame(zip(['water', 'saffron'], [42, 1.5]), columns = [ 'good', 'qty'])</code><br />
I would like to return... | <p>Try with <code>reindex</code></p>
<pre><code>l = new_qty.set_index('good')['qty'].reindex(goodlist,fill_value=0).tolist()
Out[700]: [0.0, 42.0, 0.0, 1.5, 0.0]
</code></pre> | python|pandas|numpy | 2 |
360,352 | 69,062,229 | How to set a breakpoint inside a custom metric function in keras | <p>I am trying to write my own custom metric functions in keras and I wanted to start with a test function so I implemented a f1_score function using sklearn, next I will need to customize the calculation of the metrics according to my evaluation metrics and therefore I want to set a breakpoint inside the custom metric... | <p>You should use <code>breakpoint()</code> built-in method.</p>
<pre><code>breakpoint()
</code></pre> | python|tensorflow|keras | 1 |
360,353 | 68,904,113 | Extracting the text starting with a character and ends with another into new column in python | <p>I am trying to extract an ID from a link given in a column.</p>
<p>ID started after "tt" and ends before "/". Trying to extract it into new column.</p>
<p>Input dataset:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Movie</th>
<th>Link</th>
</tr>
</thead>
<tbody>
<t... | <p>If you want to modify the link, use a regular expression with <code>str.replace</code>:</p>
<pre><code>df['Link'] = df['Link'].str.replace(r'(.*/title/tt)(\d+)(/.*)', r'\1\2\3/ \2')
</code></pre>
<p>If as I believe, your example is incorrect and you want in fact to create a new column with the number:</p>
<pre><code... | python|pandas|find|extract|extend | 0 |
360,354 | 68,888,938 | python/dataframe - merge duplicated rows | <p>I have a dataframe like this:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>id</th>
<th>year</th>
<th>data_1</th>
<th>data_2</th>
</tr>
</thead>
<tbody>
<tr>
<td>A</td>
<td>2019</td>
<td>nan</td>
<td>11</td>
</tr>
<tr>
<td>A</td>
<td>2019</td>
<td>abc</td>
<td>11</td>
</tr>
<tr>
<td>A<... | <p>Something that will work in this particular case is taking the max per group:</p>
<pre><code>df.groupby(['id', 'year'], as_index=False).max()
</code></pre>
<p>output:</p>
<pre><code> id year data_1 data_2
0 A 2019 123.0 11.0
1 A 2020 NaN 22.0
2 B 2019 345.0 456.0
3 B 2020 234.0 33.0
... | python|pandas|dataframe | 2 |
360,355 | 69,028,379 | can only concatenate str (not "tuple") to str | <pre><code>def chek_stationary(x):
result=adfuller(x)
label=['ADF statestic test','p value','num of legs','num of observation']
for value,label in zip(result,label):
print(label + ":" + result)
if result[1] <= 0.05 :
print ('there is evedincee null hypothesis')
print... | <p>Example of your situation:</p>
<pre><code>str_var = 'aaa'
tuple_var = ('b','B')
print(str_var + ":" + tuple_var)
</code></pre>
<p><strong>Result with the same error thrown:</strong>
TypeError: can only concatenate str (not "tuple") to str</p>
<p><strong>Fix:</strong> - just add str() function b... | python|pandas|statmodels | 0 |
360,356 | 69,186,756 | dataframe lookup using another dataframe as column reference | <p>I have DF A with 3 columns (L,M,N) and n rows as:</p>
<pre><code>L M N
1 2 3
4 5 6
7 8 9
</code></pre>
<p>And DF B with 2 columns (X and Y) and n rows as:</p>
<pre><code> X Y
'L' NaN
'M' 'N'
'N' 'L'
</code></pre>
<p>And I want a DF with n rows like:</p>
<pre><code>1 NaN
5 6
9 7
</code></pre>
<p>Basica... | <p>Bit hacky but one way using <code>pandas.Series.reset_index</code>:</p>
<pre><code>def getloc(index):
try:
return df.loc[index[0], index[1]]
except KeyError:
return np.nan
new_df = df2.apply(lambda x: x.reset_index().apply(tuple, axis=1)).applymap(getloc)
print(new_df)
</code></pre>
<p>Outpu... | python|pandas | 0 |
360,357 | 69,027,042 | pandas dataframe drop problem, want to delete specific rows? | <p>I have a problem to delete specific rows from my dataframe. I want to delete rows that are by matching account number. Here is code:</p>
<pre><code>def main():
# Collecting data from .csv
df1 = pd.read_csv("./2018/Member last activited.csv",
sep=";", dtype={"Account Number&... | <p>You can use the <code>.isin()</code> method of pandas Series</p>
<pre class="lang-py prettyprint-override"><code>df2["Account Number"].isin(df1["Account Number"])
</code></pre>
<p>This will give you Series of boolean values which will be true for all rows where <code>Account Number</code> in <cod... | python|pandas|dataframe | 1 |
360,358 | 69,187,935 | Trying to get a value from a df to use as a value for axis range in an indicator axis | <p>I have been trying to put together a Plotly Dash app that will pull up our clients current hours and historical hours with the current hours being represented as a gauge of how many have been used versus how many are allowed, which varies from client to client so there is no set value I can input as an overall value... | <ul>
<li>have simulated your data...</li>
<li>simple case of <code>reset_index()</code> after filtering dataframe then allows you to always access row as index 0 (assumes one row per client)</li>
<li>have used <strong>dash</strong> 1.0.0 hence <strong>html</strong> and <strong>dcc</strong> packages are not imported but... | python|pandas|plotly|plotly-dash | 0 |
360,359 | 68,941,251 | Bulk upload string columns as VARCHAR to Amazon Redshift | <h3>Is it possible to pass VARCHARS to an SQL DB (AWS Redshift) instead of Strings in bulk without creating the table on my own?</h3>
<p>I have the following code:</p>
<pre><code>import pandas as pd
d = {'actually_a_string': "Super_Long_String_Even_Longer_Than_256_Characters"}
df = pd.DataFrame(data=d)
</co... | <br>
I found a way to bulk upload it
<pre><code>orders.to_sql(con=engine,
dtype={col_name: sqlalchemy.types.VARCHAR (length=60000) for col_name in orders},
name='orders_shopify_de', if_exists='replace', index=False, method='multi')
</code></pre>
<p>With this it's working, although defining a hardcoded length for eve... | python|pandas|postgresql|sqlalchemy|amazon-redshift | 0 |
360,360 | 69,287,704 | Write functions resilient to variable dimension array | <p>I'm struggling when writing a function that would seemlessly apply to any numpy arrays whatever its dimension.</p>
<p>At one point in my code, I have boolean arrays that I consider as mask for other arrays (0 = not passing, 1 = passing).
I would like to "enlarge" those mask arrays by overriding zeros adjac... | <p>The operation that you are described seems very much like a convolution operation followed by clipping to ensure that values remain 0 or 1.</p>
<p>For your example input:</p>
<pre><code>import numpy as np
input = np.array([0,0,0,0,0,1,0,0,0,0,1,0,0,0], dtype=int)
print(input)
def enlarge_ones(x, k):
mask = np.... | python|numpy|multidimensional-array | 0 |
360,361 | 69,219,855 | Pandas read_csv Bad lines - Seperator in strings with uneven quoting | <p>I'm trying to read a bunch of .csv files from an FTP dump which I want to load into our SQL server. However, I am getting a lot of bad lines errors when trying to do so. I narrowed the problem down and it seems to be happening in lines where the string quotes are bad.</p>
<p>Example csv-data:</p>
<pre class="lang-te... | <p>As there is only one badly formatted field, one approach would be to accept all fields up to it, and backwards from the end all correct fields and then join all remaining fields together.</p>
<pre><code>import pandas as pd
import csv
data = []
with open('input.csv') as f_input:
csv_input = csv.reader(f_input)
... | python|pandas|csv | 1 |
360,362 | 44,815,802 | keras merge AttributeError: 'Merge' object has no attribute 'is_placeholder' | <p>I have been trying to get some open source code to run, but can get out of this one error. </p>
<pre><code>mnist = input_data.read_data_sets('../../MNIST_data', one_hot=True)
X_train = mnist.train.images
y_train = mnist.train.labels
X = Input(batch_shape=(m, n_x))
cond = Input(batch_shape=(m, n_y))
merged = merge(... | <p>You don't need to merge the inputs when creating model.</p>
<pre><code>mnist = input_data.read_data_sets('../../MNIST_data', one_hot=True)
X_train = mnist.train.images
y_train = mnist.train.labels
X = Input(batch_shape=(m, n_x))
cond = Input(batch_shape=(m, n_y))
...................
# do whatever you want to crea... | tensorflow|keras|tensor | 3 |
360,363 | 44,499,537 | Tensorflow encoding png | <p>Tesorflow novice here. I'm trying to load a png, run it through <code>tf.image.resize_images()</code>, then save the resized image back to disk.</p>
<pre><code>import tensorflow as tf
file = tf.read_file('./img/img-01.png')
img = tf.image.decode_png(file, channels=3)
large = tf.image.resize_images(img, size=(40, 7... | <p>Looks like the problem was that I was casting the tensor created by <code>tf.resize_images()</code> to <code>tf.uint16</code>, but it had to be <code>tf.uint8</code>.</p> | python|image-processing|tensorflow | 0 |
360,364 | 44,376,358 | Filtering Dataframe Using Headers From Other Dataframes in Python | <p>I am trying to filter a dataframe based on the columns I have previously obtained from filtering the dataframe below. </p>
<pre><code>AA BB CC DD EE FF GG
0 1 1 0 1 0 0
</code></pre>
<p>The dataframe is coming from a file where the data in each row is either a 0 or a 1 and will change based on the file tha... | <p>Here's one way you can do this:</p>
<pre><code>headers = InterestingFactors.columns.append(pd.Index(['ID','Postion_X','Position_Y']))
PivotTable = InfoTable.loc[:, headers]
</code></pre>
<p>This combines the columns you're looking for from <code>InterestingFactors</code> with the 3 columns you mention above. This ... | python|pandas|dataframe | 1 |
360,365 | 44,547,024 | Determine if rolling mean is increasing or decreasing using pandas | <p>Is there a quick way, using pandas, to determine if a rolling mean over a series is increasing or decreasing?</p>
<p>Right now I do this to plot a rolling mean on my plots:</p>
<pre><code>grouped.get_group(key)['COUNT'].rolling(window=30, center=False).mean()
</code></pre>
<p>This gives me a 30 day average. I'd l... | <p>You could use the shift function to shift the Series and then compare, like so</p>
<pre><code>import pandas as pd
import numpy as np
df = pd.DataFrame ({'a':np.random.rand(100)})
df = df.assign (b = df.a.shift(30))
df.assign (c = df.a>df.b)
a b c
0 0.812733 NaN False
1 0.458400 NaN False
2 0.24... | python|pandas | 1 |
360,366 | 44,717,774 | Load file into pandas dataframe using pre-specified dtypes and replacing 'DIV0' strings with nan | <p>I'm trying to find ways to load a large (>10 gb) file into a pandas dataframe. This is currently taking several minutes, presumably due to pandas dtype detection. In order to make this faster, and ideally reduce the memory footprint, I'd like to pre-specify the data type of each column in the file. I have tried t... | <p>Use the argument <code>na_values</code> of the function <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_csv.html" rel="nofollow noreferrer"><code>read_csv</code></a>. From the docs :</p>
<blockquote>
<p>na_values : scalar, str, list-like, or dict, default None</p>
<p>Additional strings to... | python|csv|pandas|type-conversion | 1 |
360,367 | 44,801,521 | How to predict the output in a tensorflow model? | <p>I am building a tensorflow model which should give output as 0 or 1 in case of some parameters or features being exceeded. I have the training data set, and I have trained the model but the given a set of data the predictions are wrong. The accuracy of the model is being given as 94% still, the predictions are wrong... | <p>Try these changes for the network to train better:</p>
<ol>
<li>Scale your inputs: your csv file inputs are not scaled. You can use something like sklearn <code>StandardScaler</code> to normalize your inputs</li>
<li>You are not training enough. I see the number of steps (20) is way low. Try atleast 10000 and train... | machine-learning|tensorflow | 2 |
360,368 | 44,482,095 | Dataframe filtering rows by column values | <p>I have a Dataframe <code>df</code></p>
<pre><code> Num1 Num2
one 1 0
two 3 2
three 5 4
four 7 6
five 9 8
</code></pre>
<p>I want to filter rows that have value bigger than 3 in Num1 and smaller than 8 in Num2.</p>
<p>I tried this</p>
<pre><code>df = df[... | <p>You need add <code>()</code> because operator precedence with bit-wise operator <code>&</code>:</p>
<pre><code>df1 = df[(df['Num1'] > 3) & (df['Num2'] < 8)]
print (df1)
Num1 Num2
three 5 4
four 7 6
</code></pre>
<p>Better explanation is <a href="https://stackoverflow.com/a/25... | python|pandas|dataframe|filter | 29 |
360,369 | 44,737,393 | Reading data from .csv or .txt in python | <p>I'm a beginner for python and TensorFlow. Following the instruction of "Reading data" in TensorFlow website, I want to load some data in to my project in python. That is my code, very simple</p>
<pre><code>import tensorflow as tf
files = tf.train.match_filenames_once("*.txt")
print(files)
</code></pre>
<p>And the ... | <p>Your variable <code>Files</code> is a Tensor (a node in the TensorFlow graph). You need to run it in a TensorFlow session, in order to get access to its value.</p>
<pre><code>files = tf.train.match_filenames_once("*.txt")
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
print(sess.run(... | python|tensorflow | 0 |
360,370 | 44,797,985 | TensorFlow: How does one check for bottlenecks in data input pipeline? | <p>I'm currently using tf-slim to create and read tfrecord files into my models, and through this method there is an automatic tensorboard visualization available showing:</p>
<ol>
<li><p>The tf.train.batch <code>batch/fraction_of_32_full</code> visualization, which is consistently near 0 value. I believe this should ... | <p>I had a similar problem. If batch/fraction_of_32_full gets close to zero, it means that you are consuming data faster than you are producing it.</p>
<p>32 is the default size of the queue, regardless of your batch size. It is wise to set it at least as large as the batch size.</p>
<p>This is the relevant doc: <a h... | machine-learning|tensorflow|deep-learning | 1 |
360,371 | 44,690,454 | how to remove redundant date time when x-axis is incontinuous pandas DatetimeIndex | <p>I want to plot a pandas series which index is incountinuous DatatimeIndex. My code is as follows:</p>
<pre><code>import matplotlib.dates as mdates
index = pd.DatetimeIndex(['2000-01-01 00:00:00', '2000-01-01 00:01:00',
'2000-01-01 00:02:00', '2000-01-01 00:03:00',
'2000-01-01 00:07:00',
... | <p>One possible solution is convert index to <code>string</code> by <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DatetimeIndex.strftime.html" rel="nofollow noreferrer"><code>strftime</code></a> and use <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.plot.html" rel="... | python|pandas|matplotlib|series | 2 |
360,372 | 44,511,056 | Python pandas subtraction calculation of columns with criteria | <p>I am trying to subtract one column in a data frame from another column in the same data frame. However, I need some additional criteria. For example if both columns are NaNs then I want the result to be NaN. If column 'Feb' is Nan but the corresponding 'Jan'is a number then I want to turn 'Feb'into a zero for the ca... | <p>You can replace the missing values with zero in <em>Feb</em> column and then do the subtraction:</p>
<pre><code>df['SubtractionResult'] = df['Jan'] - df['Feb'].fillna(0)
df
# account Jan Feb SubtractionResult
#0 Jones LLC 222.0 NaN 222.0
#1 Alpha Co 240.0 50.0 ... | python|pandas|dataframe|subtraction | 3 |
360,373 | 44,767,874 | Determining what is modifying a TensorFlow Graph | <p>I'm attempting to use a <code>tf.train.Supervisor()</code>, but I'm receiving the following error: <code>RuntimeError: Graph is finalized and cannot be modified.</code></p>
<p>The problem is clearly that I'm modifying my graph after instantiating a supervisor (and confirmed by <a href="https://stackoverflow.com/que... | <p>The stack trace that is printed with the <code>RuntimeError</code> ought to indicate what function is being called when the error arises.</p>
<p>However, based on your code, I suspect it is the call to <a href="https://www.tensorflow.org/api_docs/python/tf/global_variables_initializer" rel="nofollow noreferrer"><co... | tensorflow | 0 |
360,374 | 44,660,072 | Filter pandas DataFrame by string length within group | <p>Let's say I have the following data</p>
<pre><code>import pandas as pd
df = pd.DataFrame(data=[[1, 'a'], [1, 'aaa'], [1, 'aa'],
[2, 'bb'], [2, 'bbb'],
[3, 'cc']],
columns=['key', 'text'])
key text
0 1 a
1 1 aaa
2 1 aa
3 2 b... | <p>No need for the intermediate step. You can get a series with the string lengths like this:</p>
<pre><code>df['text'].str.len()
</code></pre>
<p>Now juut groupby key, and return the value indexed where the length of the string is largest using idxmax()</p>
<pre><code>In [33]: df.groupby('key').agg(lambda x: x.loc[... | python|pandas | 5 |
360,375 | 44,383,136 | pandas groupby where you get the max of one column and the min of another column | <p>I have a dataframe as follows:</p>
<pre><code>user num1 num2
a 1 1
a 2 2
a 3 3
b 4 4
b 5 5
</code></pre>
<p>I want a dataframe which has the minimum from num1 for each user, and the maximum of num2 for each user. </p>
<p>The output should be like: ... | <p>Use <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.groupby.html" rel="noreferrer"><code>groupby</code></a> + <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.core.groupby.GroupBy.aggregate.html" rel="noreferrer"><code>agg</code></a> by <code>dict</code>, so then ... | python|pandas|pandas-groupby | 23 |
360,376 | 44,806,449 | Fill N/A between values, by group, in pandas or numpy | <p>I have a DF that looks like</p>
<pre><code>df=pd.DataFrame.from_items([('i', [1, 1, 2,2]), ('j', [3, 3, 3,3]), ('t', [20170101, 20170115, 20170108,20170129]), ('x', [1.2, 1.4, 8,8.3])])
</code></pre>
<p>or</p>
<pre><code>>>> df
i j t x
0 1 3 20170101 1.2
1 1 3 20170115 1.4
2 2 3... | <p>Let's using DateTimeIndex with <code>resample</code>.
First, we need to convert column t to datetime dtype and set column t as the index.
Next, we <code>groupby</code> and <code>resample</code> to weekly data filling gaps:</p>
<pre><code>df=pd.DataFrame.from_items([('i', [1, 1, 2,2]), ('j', [3, 3, 3,3]), ('t', [201... | python|pandas|numpy|dataframe|panel | 2 |
360,377 | 44,486,523 | Should the variables of the (initial) state of a dynamic rnn among the inputs of a batch be shared? | <p>Here is a tutorial for variable length sequences and RNN for Tensorflow:<br>
<a href="https://r2rt.com/recurrent-neural-networks-in-tensorflow-iii-variable-length-sequences.html" rel="nofollow noreferrer">https://r2rt.com/recurrent-neural-networks-in-tensorflow-iii-variable-length-sequences.html</a></p>
<p>Inside y... | <p>You're right, <code>tf.tile</code> will replicate the variable as described in the <a href="https://www.tensorflow.org/api_docs/python/tf/tile" rel="nofollow noreferrer">API</a></p>
<blockquote>
<p>This operation creates a new tensor by replicating input multiples times. The output tensor's i'th dimension has inp... | tensorflow | 1 |
360,378 | 44,768,808 | Python / Pandas - merging two dataframes based in a non-index column | <p>I want to join two dataframes. Already tried concat, merge and join but I should be doing something wrong.</p>
<pre><code>df 1:
index cnpj country state
1 7468 34 23
4 3421 23 12
7 2314 12 45
df 2:
index cnpj street number
2 7468 ... | <p>Let's use <code>merge</code> with <code>suffixes</code> and <code>drop</code>:</p>
<pre><code>df1.merge(df2, on='cnpj',suffixes=('','_y')).drop('index_y',axis=1)
</code></pre>
<p>Output:</p>
<pre><code> index cnpj country state street number
0 1 7468 34 23 32 34
1 4 3421 ... | python|pandas|dataframe|data-analysis | 6 |
360,379 | 44,804,285 | Finding the average time of pandas column | <p>I have a panda that has the following format:</p>
<pre><code>title | decision | Time submitted
Book1 | 1 | 1486507594
Book1 | 2 | 1485450353
</code></pre>
<p>What I would like to do is find the average time of submission for books with decision = 1 and then average submission ... | <p>I think you can convert datetime to <code>ns</code> unix format first and then <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.groupby.html" rel="nofollow noreferrer"><code>groupby</code></a> with aggregate <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.core.gro... | python|pandas|datetime | 4 |
360,380 | 44,620,648 | create a list of pandas data frame variable names with similar spelling | <p>In my environment I have a list of several pandas data frames that are similarly named. </p>
<p>For example:</p>
<pre><code> import pandas as pd
import numpy as np
df_abc = pd.DataFrame(np.random.randn(6,4), index=dates, columns=list('ABCD')
df_xyz = pd.DataFrame(np.random.randn(6,4), index=dates, columns=l... | <p><code>globals()</code> should return a dictionary of variable_name:variable_value for the global variables.</p>
<p>If you want a list of defined variables with names starting with 'df_' you could do:</p>
<pre><code>list_of_dfs = [variable for variable in globals().keys()
if variable.startswith('df_'... | python|regex|list|pandas | 2 |
360,381 | 44,513,738 | Pandas create empty DataFrame with only column names | <p>I have a dynamic DataFrame which works fine, but when there are no data to be added into the DataFrame I get an error. And therefore I need a solution to create an empty DataFrame with only the column names.</p>
<p>For now I have something like this:</p>
<pre><code>df = pd.DataFrame(columns=COLUMN_NAMES) # Note th... | <p>You can create an empty DataFrame with either column names or an Index:</p>
<pre><code>In [4]: import pandas as pd
In [5]: df = pd.DataFrame(columns=['A','B','C','D','E','F','G'])
In [6]: df
Out[6]:
Empty DataFrame
Columns: [A, B, C, D, E, F, G]
Index: []
</code></pre>
<p>Or</p>
<pre><code>In [7]: df = pd.DataFra... | python|pandas|dataframe | 342 |
360,382 | 44,383,064 | How to read tabular format pdf document using python pandas? | <p>I want to read one pdf file which is in below format-</p>
<p><strong>data.pdf</strong></p>
<pre><code> Jan1 Jan2 Jan3 Jan4 Jan5 total
ABC 1.0 2.0 3.0 4.0 5.0 15.0
PQR 1 2 3 4 5 15
XYZ 2 2 2 2 2 10
</code></pre>
<p>I'm trying to read this file using python pandas b... | <p>If you have tabula installed then:</p>
<pre><code>from tabula import read_pdf
data = read_pdf('data.pdf')
</code></pre>
<p>then you can print your data</p>
<pre><code>print (df)
</code></pre>
<p>I hope this will help you !</p> | python|csv|pandas|pdf | 0 |
360,383 | 44,783,249 | How to find the first of week from a series of dtype('<M8[ns]') | <p>I have a series <code>p</code> of timestamps of type: <code>dtype('<M8[ns]')</code></p>
<p>I am trying to convert it to the first day of the week like so:</p>
<pre><code>p - pd.Timedelta(days=p.dt.dayofweek)
</code></pre>
<p>This clearly is not the right answer</p>
<pre><code>TypeError: Invalid type <clas... | <p>Your current code is trying to make a single timedelta object out of a series, and so the constructor is failing. </p>
<pre><code>p - pd.to_timedelta(p.dt.dayofweek, unit='D')
</code></pre>
<p>should do what you want.</p>
<p><strong>Edit:</strong></p>
<p>Ex:</p>
<pre><code>help(pd)
Help on package pandas:
...
... | python-3.x|pandas|numpy | 1 |
360,384 | 44,466,418 | Python: Calculate the average speed and the standard deviation of every timestep | <p>I have the following problem. I have a list of arrays. In every array are a different number of speed values for a cell. Now i want to calculate the average speed for each timestep for all cells. Some of the cells do move at specific time or disappear and the arrays are not of the same length. Some has 60 timesteps,... | <p>If you're using numpy you can use</p>
<pre><code>np.mean(stepwiseSpeed, axis=1)
</code></pre>
<p>this will compute the mean of each array in <code>stepwiseSpeed</code></p> | python|arrays|numpy|scipy | 3 |
360,385 | 44,704,253 | How to correctly use TensorFlow tensorflow.contrib.seq2seq | <p>I'm misusing TensorFlow's <code>tf.contrib.seq2seq</code> module in some manner, but no errors are produced so I'm having trouble find the bug. My problem is that my decoder outputs the same value (in my case, a categorical label between 0 and 3, inclusive) for every output in the output sequence. In the below examp... | <p>The problem was indeed that I needed to set <code>output_attention=False</code> because I am using Bahdanau Attention.</p> | tensorflow | 0 |
360,386 | 44,445,277 | Dataframe Sorting | <p>I am working on Python pandas, beginning with sorting a dataframe I have created from a csv file. I am trying to create a for loop eventually, using values to compare. However, when I print the new values, they are using the original dataframe instead of the sorted version. How do I properly do the below?</p>
<p>Or... | <p>I believe you are still accessing the old index of x. After you sort, insert this to reindex:</p>
<pre><code>df.reset_index(drop=True, inplace=True)
</code></pre> | python|sorting|pandas | 1 |
360,387 | 44,600,488 | Draw multivariate Gaussian distribution samples using Python numpy.random.randn | <p>I'm studying about Gaussian Mixture Model and came across this code which draws a number of samples from 2 bivariate Gaussian distributions. Which I don't understand is the technique that is used in the code:</p>
<pre><code>import numpy as np
# Number of samples per component
n_samples = 500
# Generate random sam... | <p><code>X</code> is a mixture of two bivariate normal distributions. Half the samples are computed with <code>np.dot(np.random.randn(n_samples, 2), C)</code>, where <code>C = np.array([[0., -0.1], [1.7, .4]])</code>. This distribution is equivalent to a distribution whose covariance is <code>C.T.dot(C)</code>. That... | numpy|random|gaussian | 5 |
360,388 | 44,620,582 | NameError when opening Keras model that uses Tensorflow Backend | <p>I wanted to resize my input image in my first Keras layer so I followed <a href="https://stackoverflow.com/questions/42260265/resizing-an-input-image-in-a-keras-lambda-layer">this</a> SO question. Solution worked great until I saved my model, and then tried to use it in another file and it throws</p>
<pre><code>Na... | <p>Solution was the workaround as described, which was to import backend as 'k':</p>
<p>train.py:</p>
<pre><code>from keras import backend as K
#Other stuff...
model = Sequential()
model.add(Lambda(lambda x: K.tf.image.resize_images(x, (80, 160)), \
input_shape=(160, 320, 3))) #Resize 80x160x3
#Re... | python|tensorflow|keras | 5 |
360,389 | 44,767,752 | Finding same values in two dataframes of different length | <p>I have lists of varying size (AAA, BBB, CBC). I would like to compare the lists and record which lists have similar values. For example:</p>
<pre><code>AAA BBB CBC
--- --- ---
A01 A01 A01
B02 C03 B02
C03 F06 D04
E05 F06
G07
</code></pre>
<p>The result I am looking for would look like ... | <p>Let's use the following approach:</p>
<pre><code>AAA = ['A01','B02','C03','E05','G07']
BBB = ['A01','C03','F06']
CBC = ['A01','B02','D04','F06']
lists = ['AAA','BBB','CBC']
df_out = pd.concat([pd.Series(eval(i)) for i in lists], axis=1, keys=lists)
df_out.stack().reset_index(name='value').groupby('value')['lev... | python|pandas | 2 |
360,390 | 44,502,344 | Applying TimeZoneFinder function on a Pandas DataFrame | <pre><code>from timezonefinder import TimezoneFinder
import pandas as pd
tf = TimezoneFinder()
df = pd.DataFrame({'latitude': [-22.540556,-22.950556,-22.967778], 'longitude': [-43.149167,-43.230833,-43.234444], 'timezone': [0,0,0]})
TimeZone = tf.timezone_at(lng=df['longitude'], lat=df['latitude'])
df['timezone'].appl... | <p>You were quite close actually! My preferred way of using columns as input to the random function and saving it into a new column is the most highly rated one in <a href="https://stackoverflow.com/questions/19914937/applying-function-with-multiple-arguments-to-create-a-new-pandas-column">this thread</a>. According to... | python-3.x|pandas|dataframe|timezone|apply | 3 |
360,391 | 44,384,687 | Count of islands of negative and positive numbers in a NumPy array | <p>I have an array containing chunks of negative and chunks of positive elements. A much simplified example of it would be an array <code>a</code> looking like: <code>array([-3, -2, -1, 1, 2, 3, 4, 5, 6, -5, -4])</code></p>
<p><code>(a<0).sum()</code> and <code>(a>0).sum()</code> give me the total number o... | <p>Here's one vectorized approach -</p>
<pre><code>def pos_neg_counts(a):
mask = a>0
idx = np.flatnonzero(mask[1:] != mask[:-1])
count = np.concatenate(( [idx[0]+1], idx[1:] - idx[:-1], [a.size-1-idx[-1]] ))
if a[0]<0:
return count[1::2], count[::2] # pos, neg counts
else:
ret... | python|arrays|numpy | 3 |
360,392 | 44,708,735 | TypeError: Timestamp subtraction | <p>I have a script that goes and collects data. I am running into the <code>TypeError: Timestamp subtraction must have the same timezones or no timezones</code> error. I have looked at other postings on this error, but had trouble finding a solution for me. </p>
<p>How can I bypass this error. Once the data is colle... | <p>When I run your sample code I get the following warning from XlsxWriter at the end of the stacktrace:</p>
<pre><code>"Excel doesn't support timezones in datetimes. "
TypeError: Excel doesn't support timezones in datetimes.
Set the tzinfo in the datetime/time object to None or use the
'remove_timezone' Workbook() o... | python|python-2.7|pandas|datetime-format|python-datetime | 8 |
360,393 | 44,510,224 | merge/duplicate two data sets by pandas | <p>I am trying to merge two datasets by using pandas. One is location (longitude and latitude) and the other is time frame (0 to 24hrs, 15 mins step = 96 datapoints)</p>
<p>Here is the sample code:</p>
<pre><code>s1 = pd.Series([1, 2, 3])
s2 = pd.Series([4, 5, 6])
df = pd.DataFrame([list(s1), list(s2)], columns = [... | <p>While not particularly elegant, this should work:</p>
<pre><code>from __future__ import division # only needed if you're using Python 2
import pandas as pd
from math import ceil
# Constants
timeframe = 15
total_t = 3600
</code></pre>
<p>Create <code>df1</code>:</p>
<pre><code>s1 = [1, 2, 3]
s2 = [4, 5, 6]
df1 =... | python|pandas|merge | 0 |
360,394 | 44,565,558 | Difference between two datetime64[ns] column showing error | <p>As show in figure I have two dataframe columns of type datetime64[ns]. I need to find difference between them. When I try to do so, I am getting error. If I try to find difference between one element of each column in same data frame, it is giving me time delta.Is there something that I may be missing?</p>
<p><a hr... | <p>Ok I managed to solve it by doing an update of pandas to v0.20.2. Actually as I'm using Anaconda I did a <code>conda update pandas</code> which update things that depends on pandas too (which is to say everything).</p> | python|pandas|datetime|numpy | 0 |
360,395 | 44,676,248 | Is this a bug in tensorflow? | <p>I am trying to generate Fibonacci number: F(n+2)=F(n+1)+F(n) using tensorflow. Every time I run my code, it produce different results, very strange. The code is simple and pasted below.</p>
<pre><code>import tensorflow as tf
a = tf.Variable(1)
b = tf.Variable(1)
c = tf.Variable(2)
sum=tf.add(a,b)
as0 = tf.assign... | <p>I think that @gdelab answer it's not <strong>totally</strong> right. I mean, it's true that solves the problem, but I think that it's not the real reason. Here comes my guess.</p>
<p>I strongly think that you're trying to run that code on a Jupyter Notebook. If that's not true, then probably I'm wrong. Well, suppos... | tensorflow | 3 |
360,396 | 44,567,221 | Plotting large datasets as kind=bar ineffective | <p>I am working with a semi-large data set of approx 100,000 records. When I plot a df column as a line with the code below the plot takes approx 2 seconds. </p>
<pre><code>with plt.style.context('ggplot'):
plt.figure(3,figsize=(16,12))
plt.subplot(411)
df_pca_std['PC1_resid'].plot(title ="PC1 Residual", ... | <p>Not the best charts visually but at least it renders. Plotted 2.1 million bars in 14.2 secs.</p>
<pre><code>import pygal
bar_chart = pygal.Bar()
bar_chart.add('PC1_residuals',df_X_std['PC1_resid']) ... | pandas|matplotlib|plot|python-ggplot | 1 |
360,397 | 44,468,702 | numpy.array(list) being slow | <p>So I have a list with 5,000,000 integers. And I want to cover the list to a numpy array. I tried following code:</p>
<pre><code>numpy.array( list )
</code></pre>
<p>But it is very slow. </p>
<p>I benchmarked this operation for 100 times and loop over the list for 100 times. There is no much difference. </p>
<p>A... | <p>If you have <a href="/questions/tagged/cython" class="post-tag" title="show questions tagged 'cython'" rel="tag">cython</a> you can create a function that is definetly faster. But just a warning: It will crash if there are invalid elements inside your list (not-integers or too big integers).</p>
<p>I use th... | arrays|performance|list|numpy | 3 |
360,398 | 61,065,243 | Indexing array from second element for all elements | <p>I think it must be easy, but I cannot google it. Suppose I have array of numbers 1, 2, 3, 4.</p>
<pre><code>import numpy as np
a = np.array([1,2,3,4])
</code></pre>
<p>How to index array if I want sequence 2, 3, 4, 1??
I know that for sequence 2, 3, 4 I can choose e.g.:</p>
<pre><code>print(a[1::1])
</code></pr... | <p>If you want to rotate the list, you can use a <a href="https://docs.python.org/3.8/library/collections.html#deque-objects" rel="nofollow noreferrer">deque</a> instead of a numpy array. This data structure is designed for this kind of operation and directly provides a rotate function.</p>
<pre class="lang-py prettyp... | python|numpy|slice | 1 |
360,399 | 60,820,852 | Pandas data frame multi-index and group-by | <p>Given the following DataFrame:</p>
<pre><code>import pandas as pd
d = {'RAOPeriodOrFrequency': [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
'RAOSurgeAmp': [28.57, 45.71, 83.49, 21.46 ,40.77, 101.26, 13.88, 31.26, 110.74, 0.01, 20.74, 100.54],
'RAOSwayAmp': [-4.10, -10.81 , 7.25, -2.07, 6.69, 33.90, -1.13, 2... | <p>IIUC, you can do:</p>
<pre><code>df['Heading'] = hd[df.RAOPeriodOrFrequency.diff().lt(0).cumsum()]
</code></pre>
<p>Output:</p>
<pre><code> RAOPeriodOrFrequency RAOSurgeAmp RAOSwayAmp Heading
0 1 28.57 -4.10 0
1 2 45.71 -10.81 ... | pandas|pandas-groupby|multi-index | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.