Quantcast
Channel: User Lukas - Stack Overflow
Browsing latest articles
Browse All 19 View Live

Comment by Lukas on Concatenate Two DataFrames With Hierarchical Columns

Is the title appropriate? As the answer for you is only a concat not a merge. Shouldn't the title be "Concatenate two dataframes ..."?

View Article



Comment by Lukas on How to get rid of "RuntimeWarning: invalid value...

But the readability is reduced. What about setting this to be the default way?

View Article

Comment by Lukas on Concatenate Two DataFrames With Hierarchical Columns

Answer to my own question: To merge A and B and retain the hierarchical columns and avoid having suffixes in the columns I used this: (inner join on colum 'time') dfs=[A,B]; for df in dfs:...

View Article

Comment by Lukas on Basemap library using Anaconda Jupyter Notebooks -...

Is there really no other way than putting that line into the code?! I got this error after building a new conda environment from scratch.

View Article

Comment by Lukas on dask computation not executing in parallel

The syntax for newer versions of dask is now: import dask.multiprocessing dask.config.set(scheduler=dask.multiprocessing.get)

View Article


Comment by Lukas on Rename MultiIndex columns in Pandas

Another thing you can't do is df.rename(columns={('d', 'f'): ('e', 'g')}), even though it seems correct. In other words: .rename() does not do what one expects, because even though the key for every...

View Article

Comment by Lukas on Atom setting to open files in the same window?

any update for 2019? this is driving me crazy with the new version

View Article

Comment by Lukas on How to have one colorbar for all subplots

if the range of values of the plots is different, the colorbar range would only show the last plot's range, right? any suggestions?

View Article


Comment by Lukas on In which conda environment is Jupyter executing?

import sys; print(sys.executable) was the only thing that worked for me

View Article


Comment by Lukas on How do I tell a Python script to use a particular version

What if the path is too long for the shebang? It allows just 128 characters. Should we set an alias for python in some install.py?

View Article

Comment by Lukas on Authenticate with GitHub using a token

the command you are looking for is git remote set-url origin https://<USERNAME>:<MYTOKEN>@github.com/<USERNAME>/<REPO>.gi‌​t

View Article

Comment by Lukas on Is process-pinning like with Intel-MPI possible in OpenMPI?

does not work as ``` --report-bindings ``` tells me then MCW rank 0 is not bound (or bound to all available processors) MCW rank 1 is not bound (or bound to all available processors) and so on

View Article

Comment by Lukas on error on sphinxs generated documentation on readthedocs

this worked for me to resolve the error!

View Article


Matlab's Logicals for Array Indexing - Python Equivalent

In MATLAB there is a masking type of operation with logicals like this one:A=randn(1,10) % vector with 10 random values% logical mask indexing:A(A<0)=NaN % setting values smaller than 0 to NaNIs...

View Article

IFFT and frequency information

Suppose there is a real signal Amp_time (Amplitude as a function of time) at Sample Rate SampRate.I can transform it into frequency domain with fftLength = length(Amp_time);FT_freq =...

View Article


TypeError / Array indexing; 'int' object does not support item assignment

I have a function which works on arrays with more than one item, but fails if the array contains only one item. Let's consider this exampleimport numpy as npdef checker(a): a[a>5] = np.nana =...

View Article

RuntimeError: Lock objects should only be shared between processes through...

I'm getting a ValueError: Lock objects should only be shared between processes through inheritance when writing a xarray.DataArray to_netcdf(). Everything works until writing to disk. But I found a...

View Article


Answer by Lukas for python for Google Trends: "ValueError: year is out of...

As recommended in the documentation you can convert timestamps like this: tstamp.to_datetime64().astype('O')

View Article

Why does "pip install" raise a SyntaxError in setup.py?

I tried to install a python package through pip, which raises a SyntaxError within setup.py:$ /usr/bin/pip install dash --userDEPRECATION: Python 2.6 is no longer supported by the Python core team,...

View Article
Browsing latest articles
Browse All 19 View Live




Latest Images