Quantcast
Channel: CodeSection,代码区,Python开发技术文章_教程 - CodeSec
Browsing all 9596 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Python for data science : Part 3

python for data science: Part3 In the previous parts of the “Python for data science” series, we looked at: Part 1: Basic in-built features in Python like functions, data types, date/time, map, reduce,...

View Article


Python relative path problems

I am trying to create some helper functions that will give me a folder based on the relative paths: def get_BASE_dir_path(): cur_dir = os.path.dirname(os.path.abspath(__file__)) BASE =...

View Article


Image may be NSFW.
Clik here to view.

Dynamically import Quilt packages

This post is primarily aimed at Quilt users. Read-only section 2 if you were looking for examples of dynamically importing python modules. In this post, we will show you how to use the same code to...

View Article

Creating a Trading Platform with Tables - Suggestions for a Python GUI Library

I am building a small program to retrieve data from the market and chart it in real time. While the trading decisions will be largely automated, the charts are updated continuously so that someone can...

View Article

Python : **kwargs | Functions that accept variable length key value pair as...

In this article we will discuss how to create functions in python that can accept variable length arguments in key value pair format. Suppose we want to define a function that will print the provided...

View Article


Video: How to run R and Python in SQL Server from a Jupyter notebook

Did you know that you can run R and python code within a SQL Server instance? Not only does this give you a powerful server to process your data science calculations, but it makes things faster by...

View Article

Python solutions for managing the scientific data dependency graph by...

I have a scientific data management problem which seems general, but I can't find an existing solution or even a description of it, which I have long puzzled over. I am about to embark on a major...

View Article

Login to a website using Python

python is often used for web automation, scraping and process automation. Through this post, I intend to host a set of example code snippets to login to a website programmatically. Often the initial...

View Article


Image may be NSFW.
Clik here to view.

A hitchhiker guide to python NumPy Arrays

A hitchhiker guide to python NumPyArrays A hitchhiker guide to python NumPyArrays If you’re using python for data science, either you have used NumPy or must have heard about it. Most of the...

View Article


Create a loop for a set of similar python statements

I have a 2D matrix called A0 A0 = [[0 for x in range(3)] for y in range(3)] I have a function called newProb which takes this as an argument and returns another 2D matrix in the following way:- A1 =...

View Article

Image may be NSFW.
Clik here to view.

PyCharm: PyCharm 2018.2 EAP 1

We’re getting started with the Early Access Program for PyCharm 2018.2! Even better, you can download the firstversion now from our website ! New in PyCharm Improved Pytest support: Fixtures, and more...

View Article

Django 2.0 model on_delete错误小记

1、前言 今天用 Django 2.0 时模型的外键报了一个错误: TypeError: __init__() missing 1 required positional argument: 'on_delete' 2、原因 经过筛查,在创建多对一的关系的,需要在 Foreign 的第二参数中加入 on_delete=models.CASCADE...

View Article

Image may be NSFW.
Clik here to view.

Python Automation Testing: Pytest and Pytest-bdd

This is part of the python Automation Testing blog series. You can review the code from this article on the Python Automation Git repo. A while back I started working on a new project where I had to...

View Article


Tastypie accesses fields from legacy models

Is it possible to include fields on related models, using tastypie? As per my models below: if I persist one VideoContent and one TextContent instance to the DB, I can then get 2 objects back from my...

View Article

Extract the string between quotation marks spread over several lines in Python

I have a file containing multiple entries. Each entry is of the following form: "field1","field2","field3","field4","field5" All of the fields are guaranteed to not contain any quotes, however they can...

View Article


Image may be NSFW.
Clik here to view.

Cascading Soft Deletion in Django

Cascading Soft-Deletes in Django Rest Framework The past few years ofrapid growth have left Button with unused data which cluttered our internal dashboards. In particular, there were a lot of accounts...

View Article

Can not be used as static files, Django 1.6

I am unable to get Django 1.6 to serve static files. In my settings.py I have: DEBUG = True #... INSTALLED_APPS = ( #... 'django.contrib.staticfiles', #... ) STATIC_URL = '/static/' STATIC_ROOT =...

View Article


Create your own Telegram bot with Django on Heroku Part 3

In theprevious part ofthis series, I explained how to register bots on Telegram , how to configure it and how to validate everything is working. Today I will explain a bit more on how the HTTP API...

View Article

Scrapy xpath: can not have google next page

I want to get next page in https://www.google.com.tw/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=test But my code not work. Please guide me. Thank you so much. scrapy shell...

View Article

Repeat a regular Python expression up to a certain char

Regular python expression for a matching phone with separator This regular expression should match phone numbers with or without separators: phonePattern =...

View Article
Browsing all 9596 articles
Browse latest View live