St Louis
-
4 min readIn pandas, you can combine columns from a dataframe by using the "+" operator. You simply need to select the columns you want to combine and use the "+" operator to concatenate them together. This will create a new column in the dataframe that contains the combined values from the selected columns. You can also use the "pd.concat()" function to combine columns from a dataframe by specifying the axis along which to concatenate the columns.
-
6 min readTo get the count for multiple columns in pandas, you can use the value_counts() method on each column separately and then combine the results. For example, if you have a DataFrame named df and you want to get the count for columns "column1" and "column2", you can use the following code: count_column1 = df["column1"].value_counts() count_column2 = df["column2"].value_counts() count_both_columns = pd.
-
4 min readTo compute row percentages in pandas, you can use the div() method along with the axis parameter set to 1. This will divide each row by the sum of that row and multiply the result by 100 to get the percentage value. You can also use the apply() method along with a lambda function to achieve the same result. By dividing each row by the sum of that row and multiplying by 100, you can compute the row percentages in pandas efficiently and effectively.
-
6 min readTo deploy a React app on an Ubuntu server using Bitbucket Pipeline, you will first need to set up a Bitbucket repository for your project and configure a pipeline for continuous integration and deployment. Inside the pipeline script, you will need to add the necessary commands to build the React app, create a production-ready build, and transfer the build files to your Ubuntu server via SSH.Make sure to install Node.js and npm on your Ubuntu server before deploying the app.
-
5 min readTo use Prettier on Bitbucket Pipeline, you can add a step in your pipeline configuration file to run the Prettier tool on your codebase. This step should include commands to install Prettier and then run it on your project files to format them according to your configuration. Additionally, you may want to set up a pre-commit hook in your repository to ensure that all code changes are formatted properly before being committed to your repository.
-
7 min readTo completely remove a merged commit from Bitbucket, you will need to use the "git reset" command. This command allows you to move the HEAD pointer to a specific commit, effectively undoing the merge.First, identify the commit hash of the merged commit that you want to remove. You can do this by checking the commit history using the "git log" command.
-
5 min readTo change the development branch in Bitbucket, you need to go to the repository where you want to change the branch. Then, click on the "Branches" option in the left sidebar menu. From there, you can select the branch that you want to set as the development branch. Once you have selected the desired branch, click on the "Set as default" button to make it the new development branch.
-
4 min readTo do a merge request on Bitbucket, first, navigate to the repository where you want to merge your changes. Then, locate the "Pull requests" tab and click on it. Next, click on the "Create pull request" button. Select the branch that contains your changes as the source branch and the branch you want to merge into as the destination branch. Provide a title and description for your pull request, detailing the changes you made.
-
4 min readIntegrating Bitbucket with IntelliJ allows developers to easily manage their code repositories and collaborate with team members seamlessly. By connecting Bitbucket with IntelliJ, developers can perform version control tasks such as pushing and pulling code changes, creating branches, merging code, and reviewing code with ease. This integration provides a more efficient workflow for developers, enhancing their overall productivity and making it easier to work on projects in a team environment.
-
6 min readTo change the author of commits in Bitbucket, you can use the built-in feature called "rebase." Essentially, you need to perform an interactive rebase to edit the author of specific commits. Start by opening the terminal and navigating to your local repository. Then, run the following command: git rebase -i HEAD~n (replace "n" with the number of commits you want to edit). This will open an editor showing all the commits you will rebase.
-
3 min readTo query Bitbucket commits by date, you can use the following command in the terminal: git log --after="YYYY-MM-DD" --before="YYYY-MM-DD" Replace "YYYY-MM-DD" with the specific dates you want to query between. This command will provide you with a list of commits made within that date range. Additionally, you can use other options with the git log command to further refine your search, such as author or specific file paths.