Can I set max_retries for requests.request?

It is the underlying urllib3 library that does the retrying. To set a different maximum retry count, use alternative transport adapters: The max_retries argument takes an integer or a Retry() object; the latter gives you fine-grained control over what kinds of failures are retried (an integer value is turned into a Retry() instance which only handles connection failures; errors after a connection is made … Read more

Issue with virtualenv – cannot activate

source is a shell command designed for users running on Linux (or any Posix, but whatever, not Windows). On Windows, virtualenv creates a .bat/.ps1 file, so you should run venv\Scripts\activate instead (per the virtualenv documentation on the activate script). Just run activate, without an extension, so the right file will get used regardless of whether you’re using cmd.exe or PowerShell.

Read data (.dat file) with Pandas

You can use parameter usecols with order of columns: Edit: You can use separator regex – 2 and more spaces and then add engine=’python’ because warning: ParserWarning: Falling back to the ‘python’ engine because the ‘c’ engine does not support regex separators (separators > 1 char and different from ‘\s+’ are interpreted as regex); you … Read more

How can I copy a Python string?

You don’t need to copy a Python string. They are immutable, and the copy module always returns the original in such cases, as do str(), the whole string slice, and concatenating with an empty string. Moreover, your ‘hello’ string is interned (certain strings are). Python deliberately tries to keep just the one copy, as that … Read more

cannot convert the series to

Your error is line 2. df[‘intage’] = int(df[‘age’]) is not valid, you can’t pass a pandas series to the int function. You need to use astype if df[‘age’] is object dtype. Or since you are subtracting two dates, you need to use dt accessor with the days attribute to get the number of days as … Read more