By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. F

    How to change line width of a KDE plot in seaborn

    I can't change the tickness of the kde line in seaborn. Here is the line of the code: sns.kdeplot(ax=ax2,x=dots['Longitude'],y=dots['Latitude'],kde_kws={'linestyle':':'},lw=0.1,levels=10) Is it missing something?
  2. F

    pd.read_sql and pd.read_sql_query hang upon execution, how to troubleshoot this?

    I am currently trying to read from a local MySQL database table on my computer. This table has about 2M rows of data. So when I call read_sql() or read_sql_query() I tried passing it chunksize = 1000, chunksize=10 and then chunksize=1, all of which in my debug session in PyCharm, it just...
  3. F

    How to match the exact string and replace all with other string using regular expression?

    You can do it like this: const output = input.replace(/\{+(.*?)\}+/g, (match, p1) => { return `{{{${p1}}}}`; }); The regular expression pattern /\{+(.*?)\}+/g matches any number of curly braces, including none, and captures the text inside the braces in group 1. Demo const input =...
  4. F

    DRF Allow AnonymousUser owner with HyperlinkedModelSerializer

    AnonymousUser is a different model, instead of using that, you can check request.user.is_authenticated and if it's False, set owner=None Here's an example: class BookViewSet(viewsets.ModelViewSet): serializer_class = BookSerializer queryset = Book.objects.all() def...
  5. F

    How to speed up custom function

    By not using a custom function at all: # Cast inum to int in one go df['inum_int'] = df['inum'].astype(int) # Fill column with empties df['new_recs'] = '' # Fill the rest according to the criteria above df['new_recs', df['inum_int'].isin(list1) & (df['DESC_1'] == 1)] = df['recs']...